refactor(react-router): Reduce bundle size by sharing hook structural… #122
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # check-skills.yml — Drop this into your library repo's .github/workflows/ | |
| # | |
| # Validates intent skills on PRs. After a release or manual run, opens or | |
| # updates one review PR when existing skills, artifact coverage, or workspace | |
| # package coverage need review. | |
| # | |
| # Triggers: pull requests touching skills/artifacts, pushes to main affecting | |
| # docs/source paths, new release published, or manual workflow_dispatch. | |
| # | |
| # intent-workflow-version: 4 | |
| # | |
| # Template variables (replaced by `intent setup`): | |
| # @tanstack/router — e.g. @tanstack/query or my-workspace workspace | |
| name: Check Skills | |
| concurrency: | |
| group: check-skills-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: | |
| paths: | |
| - 'skills/**' | |
| - '**/skills/**' | |
| - '_artifacts/**' | |
| - '**/_artifacts/**' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - 'packages/*/src/**' | |
| release: | |
| types: [published] | |
| workflow_dispatch: {} | |
| permissions: {} | |
| jobs: | |
| validate: | |
| name: Validate intent skills | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Install intent | |
| run: npm install -g @tanstack/intent | |
| - name: Validate skills | |
| run: intent validate --github-summary | |
| review: | |
| name: Check intent skill coverage | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true # review job pushes a generated branch | |
| - name: Setup Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| - name: Install intent | |
| run: npm install -g @tanstack/intent | |
| - name: Check skills | |
| id: stale | |
| run: | | |
| intent stale --github-review --package-label "@tanstack/router" | |
| - name: Open or update review PR | |
| if: steps.stale.outputs.has_review == 'true' | |
| env: | |
| BASE_BRANCH: ${{ github.event.repository.default_branch }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VERSION: ${{ github.event.release.tag_name || 'manual' }} | |
| run: | | |
| BRANCH="skills/review-${VERSION}" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git fetch origin "$BRANCH:refs/remotes/origin/$BRANCH" || true | |
| if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then | |
| git checkout -B "$BRANCH" "origin/$BRANCH" | |
| else | |
| git checkout -b "$BRANCH" | |
| git commit --allow-empty -m "chore: review intent skills for ${VERSION}" | |
| git push origin "$BRANCH" | |
| fi | |
| PR_URL="$(gh pr list --head "$BRANCH" --json url --jq '.[0].url')" | |
| if [ -n "$PR_URL" ]; then | |
| gh pr edit "$PR_URL" --body-file pr-body.md | |
| else | |
| gh pr create \ | |
| --title "Review intent skills (${VERSION})" \ | |
| --body-file pr-body.md \ | |
| --head "$BRANCH" \ | |
| --base "$BASE_BRANCH" | |
| fi |