Skip to content

Conversation

lachlancollins
Copy link
Member

@lachlancollins lachlancollins commented Jul 26, 2025

🎯 Changes

As discussed on Discord (private channel): https://discord.com/channels/719702312431386674/1345158793675276319

See also: TanStack/config#218 and TanStack/virtual#946

βœ… Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

πŸš€ Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Chores

    • Adopted Changesets for versioning, changelogs, and publishing; added Changesets config, scripts, and dev tooling.
    • Removed a custom publish script and simplified package metadata for an internal integration package.
  • Documentation

    • Updated CONTRIBUTING to a Changesets-based release workflow and clarified test/setup guidance.
    • Added a PR template with change summary, checklist, and release-impact guidance.
  • CI

    • Updated release workflow to run on push with staged versioning, automatic commit of version files, and publish steps via Changesets.

Copy link

nx-cloud bot commented Jul 26, 2025

View your CI Pipeline Execution β†— for commit 64146bf

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... βœ… Succeeded 15s View β†—
nx run-many --target=build --exclude=examples/*... βœ… Succeeded 1s View β†—

☁️ Nx Cloud last updated this comment at 2025-09-22 07:55:00 UTC

@lachlancollins lachlancollins requested a review from TkDodo July 26, 2025 08:56
Copy link

pkg-pr-new bot commented Jul 26, 2025

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@9502

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@9502

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@9502

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@9502

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@9502

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@9502

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@9502

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@9502

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@9502

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@9502

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@9502

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@9502

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@9502

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@9502

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@9502

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@9502

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@9502

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@9502

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@9502

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@9502

commit: 64146bf

Copy link

github-actions bot commented Jul 26, 2025

Sizes for commit 64146bf:

Branch Bundle Size
Main
This PR

Copy link

codecov bot commented Jul 26, 2025

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 46.38%. Comparing base (cd4ef5c) to head (64146bf).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9502   +/-   ##
=======================================
  Coverage   46.38%   46.38%           
=======================================
  Files         214      214           
  Lines        8488     8488           
  Branches     1919     1921    +2     
=======================================
  Hits         3937     3937           
  Misses       4108     4108           
  Partials      443      443           
Components Coverage Ξ”
@tanstack/angular-query-experimental 93.85% <ΓΈ> (ΓΈ)
@tanstack/eslint-plugin-query 83.24% <ΓΈ> (ΓΈ)
@tanstack/query-async-storage-persister 43.85% <ΓΈ> (ΓΈ)
@tanstack/query-broadcast-client-experimental 24.39% <ΓΈ> (ΓΈ)
@tanstack/query-codemods 0.00% <ΓΈ> (ΓΈ)
@tanstack/query-core 97.48% <ΓΈ> (ΓΈ)
@tanstack/query-devtools 3.48% <ΓΈ> (ΓΈ)
@tanstack/query-persist-client-core 79.60% <ΓΈ> (ΓΈ)
@tanstack/query-sync-storage-persister 84.61% <ΓΈ> (ΓΈ)
@tanstack/query-test-utils 77.77% <ΓΈ> (ΓΈ)
@tanstack/react-query 96.00% <ΓΈ> (ΓΈ)
@tanstack/react-query-devtools 10.00% <ΓΈ> (ΓΈ)
@tanstack/react-query-next-experimental βˆ… <ΓΈ> (βˆ…)
@tanstack/react-query-persist-client 100.00% <ΓΈ> (ΓΈ)
@tanstack/solid-query 78.06% <ΓΈ> (ΓΈ)
@tanstack/solid-query-devtools βˆ… <ΓΈ> (βˆ…)
@tanstack/solid-query-persist-client 100.00% <ΓΈ> (ΓΈ)
@tanstack/svelte-query 87.58% <ΓΈ> (ΓΈ)
@tanstack/svelte-query-devtools βˆ… <ΓΈ> (βˆ…)
@tanstack/svelte-query-persist-client 100.00% <ΓΈ> (ΓΈ)
@tanstack/vue-query 71.10% <ΓΈ> (ΓΈ)
@tanstack/vue-query-devtools βˆ… <ΓΈ> (βˆ…)
πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

coderabbitai bot commented Sep 22, 2025

Walkthrough

Adds Changesets-based release tooling and config, replaces a custom publish script and CI publish step with Changesets steps, updates package scripts and devDependencies, introduces a PR template, updates CONTRIBUTING, and adjusts one integration package.json metadata.

Changes

Cohort / File(s) Summary
Changeset config
.changeset/config.json
Adds Changesets configuration: changelog: github-compact (TanStack/query), commit: false, access: "public", baseBranch: "main", internalDependencyOptions.updateInternalDependents: "patch".
Release workflow
.github/workflows/release.yml
Renames workflow to Release, removes workflow_dispatch inputs, triggers on pushes to branches, splits publish into changeset version β†’ commit version files (uses GITHUB_TOKEN) β†’ changeset publish; removes prior npm auth / pnpm cipublish steps.
PR template
.github/pull_request_template.md
Adds a PR template with sections "🎯 Changes", "βœ… Checklist", and "πŸš€ Release Impact" including guidance for changesets or marking docs/CI/dev-only.
Contributing docs
CONTRIBUTING.md
Replaces Angular-style commit guidance and semantic-release workflow with Changesets-based release instructions and updated local/test/Nx guidance.
Root package.json updates
package.json
Removes cipublish script; adds changeset, changeset:version, changeset:publish scripts; adds devDependencies @changesets/cli and @svitejs/changesets-changelog-github-compact.
Removed publish script
scripts/publish.ts
Deletes custom multi-package publish script that invoked @tanstack/config/publish.
Integration package metadata
integrations/angular-cli-20/package.json
Removes version field and consolidates a single top-level private: true metadata change.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant Repo as Repository
    participant CI as GitHub Actions
    participant CS as Changesets Action
    participant Registry as Package Registry

    Dev->>Repo: Push commits (may include a changeset)
    activate CI
    CI->>CI: Run tests & checks
    CI->>CS: Run `changeset version`
    CS-->>Repo: Create version & changelog updates
    CI->>Repo: Commit & push version files (GITHUB_TOKEN)
    deactivate CI

    Dev->>Repo: Merge PR / push to main
    activate CI
    CI->>CS: Run `changeset publish`
    CS->>Registry: Publish packages
    CS-->>Repo: Update releases/changelogs
    deactivate CI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I nibble notes and hop along,
Changesets hum a tidy song.
CI trades old scripts for sensible springs,
Version carrots tied to release strings.
Little rabbit cheers β€” the repo sings! πŸ₯•βœ¨

Pre-merge checks and finishing touches

βœ… Passed checks (3 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check βœ… Passed The title "ci: introduce changesets" is a concise, conventional-commit style summary that accurately reflects the main changeβ€”adding Changesets tooling and CI/workflow updatesβ€”and is clear to reviewers scanning PR history. It is specific to the changeset-related CI work and does not include vague or noisy wording.
Docstring Coverage βœ… Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
πŸ§ͺ Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch changesets

πŸ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between fe0ae4f and 64146bf.

πŸ“’ Files selected for processing (1)
  • .github/pull_request_template.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/pull_request_template.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test
  • GitHub Check: Preview

Comment @coderabbitai help to get the list of available commands and usage tips.

@lachlancollins lachlancollins changed the title chore: introduce changesets ci: introduce changesets Sep 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
package.json (2)

32-34: Add a status script for local DX.

Consider adding a convenience script to preview pending releases locally.

Apply:

   "prettier:write": "pnpm run prettier --write",
   "docs:generate": "node scripts/generateDocs.ts",
   "verify-links": "node scripts/verify-links.ts",
   "changeset": "changeset",
   "changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write",
   "changeset:publish": "changeset publish"
+  ,"changeset:status": "changeset status --since=origin/main"

47-47: Changelog provider dependency: LGTM; document its output style.

Looks good. Consider mentioning in CONTRIBUTING the β€œgithub‑compact” format so contributors know what to expect in PRs.

.github/pull_request_template.md (1)

7-9: Fix link to the correct Contributing guide in this repo.

The template points to TanStack/config. Link should reference TanStack/query.

Apply:

- - [ ] I have followed the steps listed in the [Contributing guide](https://github.com/TanStack/config/blob/main/CONTRIBUTING.md).
+ - [ ] I have followed the steps listed in the [Contributing guide](https://github.com/TanStack/query/blob/main/CONTRIBUTING.md).
CONTRIBUTING.md (2)

158-160: Typo: duplicate β€œrun”.

Small nit.

-This repo uses [Changesets](...) to automate releases. If your PR should release a new package version (patch, minor, or major), please run run `pnpm changeset` and commit the file.
+This repo uses [Changesets](...) to automate releases. If your PR should release a new package version (patch, minor, or major), please run `pnpm changeset` and commit the file.

170-170: Clarify when the preview PR is created.

Make it explicit that the preview PR appears only when changesets are present.

-For each new commit added to `main`, a GitHub Workflow is triggered which runs the Changesets Action. This generates a preview PR showing the impact of all changesets. When this PR is merged, the package will be published to NPM.
+On pushes to `main`, a GitHub Workflow runs the Changesets Action. If there are pending changesets, it opens/updates a preview PR showing the release impact. When that PR is merged, packages are published to npm.
πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between cd4ef5c and fd8e6f0.

β›” Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
πŸ“’ Files selected for processing (7)
  • .changeset/config.json (1 hunks)
  • .github/pull_request_template.md (1 hunks)
  • .github/workflows/release.yml (3 hunks)
  • CONTRIBUTING.md (2 hunks)
  • integrations/angular-cli-20/package.json (1 hunks)
  • package.json (2 hunks)
  • scripts/publish.ts (0 hunks)
πŸ’€ Files with no reviewable changes (1)
  • scripts/publish.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Preview
  • GitHub Check: Test
πŸ”‡ Additional comments (6)
package.json (1)

44-44: Changesets CLI dependency: LGTM.

Pinned to a recent version; aligns with the workflow step.

.changeset/config.json (1)

2-13: Config aligns with the Action usage.

  • github‑compact changelog with repo set: OK
  • commit: false pairs fine with the Action’s commit/title inputs
  • baseBranch/main and public access: OK

No changes required.

.github/workflows/release.yml (2)

17-17: Permission update: LGTM.

pull-requests: write is required for the Changesets Action to open/update the version PR.


38-47: Consider re‑adding a manual trigger for emergency/forced releases.

You removed workflow_dispatch; maintainers asked about manual releases previously. Re‑introducing it keeps flexibility for hotfixes.

Apply:

 on:
-  push:
+  push:
     branches: [main, alpha, beta, rc, v4]
+  workflow_dispatch:
+    inputs:
+      mode:
+        description: "Run version or publish"
+        required: false
+        default: "auto"
+        type: choice
+        options:
+          - auto
+          - version
+          - publish

Optionally gate the step:

-      - name: Run Changesets (version or publish)
+      - name: Run Changesets (version or publish)
         uses: changesets/[email protected]
         with:
-          version: pnpm run changeset:version
-          publish: pnpm run changeset:publish
+          version: ${{ inputs.mode == 'publish' && 'false' || 'pnpm run changeset:version' }}
+          publish: ${{ inputs.mode == 'version' && 'false' || 'pnpm run changeset:publish' }}
           commit: 'ci: Version Packages'
           title: 'ci: Version Packages'
CONTRIBUTING.md (1)

164-167: Commit message guidance: keep a concise convention section.

You removed the detailed conventions but still ask for β€œappropriate commit type.” Consider adding a short section and link (as suggested in review discussion).

Proposed snippet:

### Commit messages (short guideline)
We squash-merge, so write clear, imperative messages (e.g., "Fix flaky test"). Conventional types are optional, but recommended for clarity. See a concise example in Zustand’s guide: https://github.com/pmndrs/zustand/blob/main/CONTRIBUTING.md#committing
integrations/angular-cli-20/package.json (1)

3-3: Marking package private: good β€” confirm TypeScript range for Angular CLI v20

npm shows @angular/compiler-cli 20.0.0–20.1.7 require typescript ">=5.8 <5.9"; starting at 20.2.0 the range is ">=5.8 <6.0". If this integration uses 20.0/20.1 pin TypeScript to ~5.8.x; if it targets >=20.2 you may allow up to <6.0. Check integrations/angular-cli-20/package.json for the exact @angular/* versions and align the TypeScript devDependency accordingly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

πŸ“œ Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between fd8e6f0 and 65ee7ac.

πŸ“’ Files selected for processing (1)
  • .github/workflows/release.yml (2 hunks)
πŸ”‡ Additional comments (5)
.github/workflows/release.yml (5)

1-1: LGTM: Clear workflow name change

The workflow name change from "ci" to "Release" better reflects its purpose and aligns with the introduction of changesets for release management.


14-16: LGTM: Appropriate permissions for changesets workflow

The permissions correctly include contents: write for pushing version commits and id-token: write for npm publishing with OIDC, which aligns with modern secure publishing practices.


29-29: Confirmed: .nx/workflows/dynamic-changesets.yaml exists
Found .nx/workflows/dynamic-changesets.yaml with distribute-on mappings (small-changeset, medium-changeset, large-changeset); no further action required.


37-38: No action required β€” changeset:version script present

package.json defines "changeset:version" as: changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write


47-50: changeset:publish exists β€” verify NPM_TOKEN secret

package.json defines "changeset:publish" -> "changeset publish" and the workflow uses NPM_TOKEN from secrets (.github/workflows/release.yml lines 47–50). Ensure the repository/GitHub Actions secret NPM_TOKEN is present and contains a valid npm token with publish permissions for the registry used.

Comment on lines +39 to +46
- name: Commit version files
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email '[email protected]'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm run cipublish
git config --global user.email '[email protected]' git add -A
git commit -m "ci: Version Packages"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix git configuration and add conditional logic for version commits

The current implementation has several issues:

  1. Line 42 has a syntax error - missing newline between email and git add
  2. The commit will fail if there are no changes to commit
  3. No validation that version changes actually occurred
       - name: Commit version files
         run: |
           git config --global user.name 'Tanner Linsley'
-          git config --global user.email '[email protected]'            git add -A
-          git commit -m "ci: Version Packages"
-          git push
+          git config --global user.email '[email protected]'
+          git add -A
+          if git diff --staged --quiet; then
+            echo "No version changes to commit"
+          else
+            git commit -m "ci: Version Packages"
+            git push
+          fi
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Commit version files
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email '[email protected]'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm run cipublish
git config --global user.email '[email protected]' git add -A
git commit -m "ci: Version Packages"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit version files
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email '[email protected]'
git add -A
if git diff --staged --quiet; then
echo "No version changes to commit"
else
git commit -m "ci: Version Packages"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
πŸ€– Prompt for AI Agents
.github/workflows/release.yml around lines 39 to 46: fix the malformed git
command by placing the git add on its own line after configuring user.email, and
add conditional checks so the workflow only attempts to commit/push when version
files actually changed; implement a pre-commit check that detects changes (e.g.,
git diff --name-only or git status --porcelain) and only run git add/commit/push
if that check finds relevant files (validate by matching expected version files
or package manifests), otherwise skip committing to avoid failure when there are
no changes.

@AhmedBaset
Copy link
Contributor

There is one disadvantage of using Changesets over the current setup, though I'm not sure if it's a valid point for you to consider here. With the current setup, people subscribing to GitHub releases receive a single notification/a single release on the releases page. With Changesets, however, there would be tons. A "RELEASE ALL" in the query repo would make 23 releases and send 23 notifications to subscribers.

Screenshot_20250922_122955_Chrome

@lachlancollins
Copy link
Member Author

There is one disadvantage of using Changesets over the current setup, though I'm not sure if it's a valid point for you to consider here. With the current setup, people subscribing to GitHub releases receive a single notification/a single release on the releases page. With Changesets, however, there would be tons. A "RELEASE ALL" in the query repo would make 23 releases and send 23 notifications to subscribers.

Hey @AhmedBaset , it's definitely quite noisy. One "solution" is to disable release notifications by choosing custom watch events. If you want to keep these notifications though, I don't think there is a way to merge them together, sorry!

image

@lachlancollins lachlancollins merged commit 2a15f36 into main Sep 26, 2025
8 checks passed
@lachlancollins lachlancollins deleted the changesets branch September 26, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants