Skip to content

Commit f275343

Browse files
authored
Merge branch 'TanStack:main' into fix-rsc
2 parents 3fa7ef9 + b0024d6 commit f275343

465 files changed

Lines changed: 18269 additions & 5048 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-skills.yml

Lines changed: 69 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
# check-skills.yml — Drop this into your library repo's .github/workflows/
22
#
3-
# Checks for stale intent skills after a release and opens a review PR
4-
# if any skills need attention. The PR body includes a prompt you can
5-
# paste into Claude Code, Cursor, or any coding agent to update them.
3+
# Validates intent skills on PRs. After a release or manual run, opens or
4+
# updates one review PR when existing skills, artifact coverage, or workspace
5+
# package coverage need review.
66
#
7-
# Triggers: new release published, or manual workflow_dispatch.
7+
# Triggers: pull requests touching skills/artifacts, pushes to main affecting
8+
# docs/source paths, new release published, or manual workflow_dispatch.
89
#
9-
# Template variables (replaced by `intent setup`):
10-
# @tanstack/react-router — e.g. @tanstack/query
10+
# intent-workflow-version: 4
1111
#
12-
# Adapted for TanStack Router monorepo: loops over all packages with skills.
12+
# Template variables (replaced by `intent setup`):
13+
# @tanstack/router — e.g. @tanstack/query or my-workspace workspace
1314

1415
name: Check Skills
1516

17+
concurrency:
18+
group: check-skills-${{ github.ref }}
19+
cancel-in-progress: true
20+
1621
on:
22+
pull_request:
23+
paths:
24+
- 'skills/**'
25+
- '**/skills/**'
26+
- '_artifacts/**'
27+
- '**/_artifacts/**'
28+
push:
29+
branches: [main]
30+
paths:
31+
- 'docs/**'
32+
- 'packages/*/src/**'
1733
release:
1834
types: [published]
1935
workflow_dispatch: {}
@@ -23,8 +39,28 @@ permissions:
2339
pull-requests: write
2440

2541
jobs:
26-
check:
27-
name: Check for stale skills
42+
validate:
43+
name: Validate intent skills
44+
if: github.event_name == 'pull_request'
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
50+
- name: Setup Node
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 20
54+
55+
- name: Install intent
56+
run: npm install -g @tanstack/intent
57+
58+
- name: Validate skills
59+
run: intent validate --github-summary
60+
61+
review:
62+
name: Check intent skill coverage
63+
if: github.event_name != 'pull_request'
2864
runs-on: ubuntu-latest
2965
steps:
3066
- name: Checkout
@@ -37,136 +73,42 @@ jobs:
3773
with:
3874
node-version: 20
3975

40-
- name: Install intent CLI
76+
- name: Install intent
4177
run: npm install -g @tanstack/intent
4278

43-
- name: Install dependencies
44-
run: npm install --ignore-scripts
45-
env:
46-
npm_config_legacy_peer_deps: 'true'
47-
48-
- name: Check staleness
79+
- name: Check skills
4980
id: stale
5081
run: |
51-
# Monorepo: collect stale reports from all packages with skills
52-
ALL_OUTPUT="["
53-
FIRST=true
54-
for dir in packages/*/; do
55-
if [ -d "$dir/skills" ]; then
56-
PKG_OUTPUT=$(cd "$dir" && npx @tanstack/intent stale --json 2>/dev/null) || true
57-
if [ -n "$PKG_OUTPUT" ] && [ "$PKG_OUTPUT" != "[]" ] && [ "$PKG_OUTPUT" != "No intent-enabled packages found." ]; then
58-
if [ "$FIRST" = true ]; then
59-
FIRST=false
60-
else
61-
ALL_OUTPUT="${ALL_OUTPUT},"
62-
fi
63-
# Strip outer brackets and append entries
64-
ENTRIES=$(echo "$PKG_OUTPUT" | node -e "
65-
const input = require('fs').readFileSync('/dev/stdin','utf8').trim();
66-
try { const arr = JSON.parse(input); process.stdout.write(JSON.stringify(arr).slice(1, -1)); } catch {}
67-
")
68-
ALL_OUTPUT="${ALL_OUTPUT}${ENTRIES}"
69-
fi
70-
fi
71-
done
72-
ALL_OUTPUT="${ALL_OUTPUT}]"
73-
74-
echo "$ALL_OUTPUT"
75-
76-
# Check if any skills need review
77-
NEEDS_REVIEW=$(echo "$ALL_OUTPUT" | node -e "
78-
const input = require('fs').readFileSync('/dev/stdin','utf8');
79-
try {
80-
const reports = JSON.parse(input);
81-
const stale = reports.flatMap(r =>
82-
r.skills.filter(s => s.needsReview).map(s => ({ library: r.library, skill: s.name, reasons: s.reasons }))
83-
);
84-
if (stale.length > 0) {
85-
console.log(JSON.stringify(stale));
86-
}
87-
} catch {}
88-
")
89-
90-
if [ -z "$NEEDS_REVIEW" ]; then
91-
echo "has_stale=false" >> "$GITHUB_OUTPUT"
92-
else
93-
echo "has_stale=true" >> "$GITHUB_OUTPUT"
94-
# Escape for multiline GH output
95-
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
96-
echo "stale_json<<$EOF" >> "$GITHUB_OUTPUT"
97-
echo "$NEEDS_REVIEW" >> "$GITHUB_OUTPUT"
98-
echo "$EOF" >> "$GITHUB_OUTPUT"
99-
fi
100-
101-
- name: Build summary
102-
if: steps.stale.outputs.has_stale == 'true'
103-
id: summary
104-
run: |
105-
node -e "
106-
const stale = JSON.parse(process.env.STALE_JSON);
107-
const lines = stale.map(s =>
108-
'- **' + s.skill + '** (' + s.library + '): ' + s.reasons.join(', ')
109-
);
110-
const summary = lines.join('\n');
111-
112-
const prompt = [
113-
'Review and update the following stale intent skills for TanStack Router:',
114-
'',
115-
...stale.map(s => '- ' + s.skill + ': ' + s.reasons.join(', ')),
116-
'',
117-
'For each stale skill:',
118-
'1. Read the current SKILL.md file',
119-
'2. Check what changed in the library since the skill was last updated',
120-
'3. Update the skill content to reflect current APIs and behavior',
121-
'4. Run \`npx @tanstack/intent validate\` to verify the updated skill',
122-
].join('\n');
123-
124-
// Write outputs
125-
const fs = require('fs');
126-
const env = fs.readFileSync(process.env.GITHUB_OUTPUT, 'utf8');
127-
const eof = require('crypto').randomBytes(15).toString('base64');
128-
fs.appendFileSync(process.env.GITHUB_OUTPUT,
129-
'summary<<' + eof + '\n' + summary + '\n' + eof + '\n' +
130-
'prompt<<' + eof + '\n' + prompt + '\n' + eof + '\n'
131-
);
132-
"
133-
env:
134-
STALE_JSON: ${{ steps.stale.outputs.stale_json }}
82+
intent stale --github-review --package-label "@tanstack/router"
13583
136-
- name: Open review PR
137-
if: steps.stale.outputs.has_stale == 'true'
84+
- name: Open or update review PR
85+
if: steps.stale.outputs.has_review == 'true'
13886
env:
13987
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14088
run: |
14189
VERSION="${{ github.event.release.tag_name || 'manual' }}"
14290
BRANCH="skills/review-${VERSION}"
91+
BASE_BRANCH="${{ github.event.repository.default_branch }}"
14392
14493
git config user.name "github-actions[bot]"
14594
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
146-
git checkout -b "$BRANCH"
147-
git commit --allow-empty -m "chore: review stale skills for ${VERSION}"
148-
git push origin "$BRANCH"
149-
150-
gh pr create \
151-
--title "Review stale skills (${VERSION})" \
152-
--body "$(cat <<'PREOF'
153-
## Stale Skills Detected
154-
155-
The following skills may need updates after the latest release:
15695
157-
${{ steps.summary.outputs.summary }}
158-
159-
---
160-
161-
### Update Prompt
162-
163-
Paste this into your coding agent (Claude Code, Cursor, etc.):
164-
165-
~~~
166-
${{ steps.summary.outputs.prompt }}
167-
~~~
96+
git fetch origin "$BRANCH" || true
97+
if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then
98+
git checkout -B "$BRANCH" "origin/$BRANCH"
99+
else
100+
git checkout -b "$BRANCH"
101+
git commit --allow-empty -m "chore: review intent skills for ${VERSION}"
102+
git push origin "$BRANCH"
103+
fi
168104
169-
PREOF
170-
)" \
171-
--head "$BRANCH" \
172-
--base main
105+
PR_URL="$(gh pr list --head "$BRANCH" --json url --jq '.[0].url')"
106+
if [ -n "$PR_URL" ]; then
107+
gh pr edit "$PR_URL" --body-file pr-body.md
108+
else
109+
gh pr create \
110+
--title "Review intent skills (${VERSION})" \
111+
--body-file pr-body.md \
112+
--head "$BRANCH" \
113+
--base "$BASE_BRANCH"
114+
fi

.github/workflows/notify-playbooks.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/validate-skills.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

benchmarks/bundle-size/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This workspace contains deterministic bundle-size fixtures for:
88
- `@tanstack/react-start`
99
- `@tanstack/solid-start`
1010

11-
Each package has two scenarios:
11+
Each package has `minimal` and `full` scenarios:
1212

1313
- `minimal`: Small route app with `__root` + index route that renders `hello world`
1414
- `full`: Same route shape plus a broad root-level harness that imports/uses the full hooks/components surface
@@ -18,7 +18,8 @@ Each package has two scenarios:
1818

1919
- Scenarios use file-based routing as the default app style.
2020
- Router scenarios use `@tanstack/router-plugin/vite` with `autoCodeSplitting: true`.
21-
- Start scenarios use `@tanstack/<framework>-start/plugin/vite` with router code-splitting enabled.
21+
- Start Vite scenarios use `@tanstack/<framework>-start/plugin/vite` with router code-splitting enabled.
22+
- React Start also includes Rsbuild scenarios using `@tanstack/react-start/plugin/rsbuild`.
2223
- Full-surface coverage is manually maintained (no strict export-coverage gate).
2324
- Metrics are measured from initial-load JS graph only and reported as raw/gzip/brotli bytes.
2425
- Gzip is the primary tracking signal for PR deltas and historical charting.

benchmarks/bundle-size/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"vue": "^3.5.16"
1818
},
1919
"devDependencies": {
20+
"@rsbuild/core": "^2.0.1",
21+
"@rsbuild/plugin-react": "^2.0.0",
2022
"@tanstack/router-plugin": "workspace:^",
2123
"@types/react": "^19.0.8",
2224
"@types/react-dom": "^19.0.3",

0 commit comments

Comments
 (0)