Skip to content

Commit a114b10

Browse files
Merge branch 'main' into katt/hydrate-query-keys
2 parents 33df077 + db60bdd commit a114b10

File tree

351 files changed

+8669
-4850
lines changed

Some content is hidden

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

351 files changed

+8669
-4850
lines changed

.changeset/config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@svitejs/changesets-changelog-github-compact",
5+
{ "repo": "TanStack/query" }
6+
],
7+
"commit": false,
8+
"access": "public",
9+
"baseBranch": "main",
10+
"updateInternalDependencies": "patch",
11+
"fixed": [],
12+
"linked": []
13+
}

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## 🎯 Changes
2+
3+
<!-- What changes are made in this PR? Describe the change and its motivation. -->
4+
5+
## ✅ Checklist
6+
7+
- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/query/blob/main/CONTRIBUTING.md).
8+
- [ ] I have tested this code locally with `pnpm test:pr`.
9+
10+
## 🚀 Release Impact
11+
12+
- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
13+
- [ ] This change is docs/CI/dev-only (no release).

.github/workflows/autofix.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/[email protected]
21+
uses: actions/[email protected]
22+
with:
23+
fetch-depth: 0
2224
- name: Setup Tools
2325
uses: tanstack/config/.github/setup@main
2426
- name: Fix formatting

.github/workflows/pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: pr
1+
name: PR
22

33
on:
44
pull_request:
@@ -22,15 +22,15 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v4.2.2
25+
uses: actions/checkout@v5.0.0
2626
with:
2727
fetch-depth: 0
2828
- name: Start Nx Agents
2929
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
3030
- name: Setup Tools
3131
uses: tanstack/config/.github/setup@main
3232
- name: Get base and head commits for `nx affected`
33-
uses: nrwl/nx-set-shas@v4.1.2
33+
uses: nrwl/nx-set-shas@v4.3.3
3434
with:
3535
main-branch-name: main
3636
- name: Run Checks
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
steps:
5353
- name: Checkout
54-
uses: actions/checkout@v4.2.2
54+
uses: actions/checkout@v5.0.0
5555
with:
5656
fetch-depth: 0
5757
- name: Setup Tools
@@ -65,7 +65,7 @@ jobs:
6565
run: |
6666
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
6767
- name: Preview Bundle Size
68-
uses: marocchino/sticky-pull-request-comment@9c40848920de7cd32a71773ba792d8b04f03bf7a
68+
uses: marocchino/sticky-pull-request-comment@fd19551a2a7c0d29677c63257f86d8ef8bb24b48
6969
with:
7070
message: |
7171
Sizes for commit ${{ env.COMMIT_SHA }}:

.github/workflows/ci.yml renamed to .github/workflows/release.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
name: ci
1+
name: Release
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
tag:
7-
description: override release tag
8-
required: false
94
push:
105
branches: [main, alpha, beta, rc, v4]
116

@@ -21,13 +16,13 @@ permissions:
2116
id-token: write
2217

2318
jobs:
24-
test-and-publish:
25-
name: Test & Publish
19+
release:
20+
name: Release
2621
if: github.repository_owner == 'TanStack'
2722
runs-on: ubuntu-latest
2823
steps:
2924
- name: Checkout
30-
uses: actions/checkout@v4.2.2
25+
uses: actions/checkout@v5.0.0
3126
with:
3227
fetch-depth: 0
3328
- name: Start Nx Agents
@@ -39,16 +34,23 @@ jobs:
3934
- name: Stop Nx Agents
4035
if: ${{ always() }}
4136
run: npx nx-cloud stop-all-agents
42-
- name: Publish
37+
- name: Version Packages
38+
run: pnpm run changeset:version
39+
- name: Commit version files
4340
run: |
44-
git config --global user.name 'Tanner Linsley'
45-
git config --global user.email '[email protected]'
46-
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
47-
pnpm run cipublish
41+
if [[ -n "$(git status --porcelain)" ]]; then
42+
git config --global user.name 'Tanner Linsley'
43+
git config --global user.email '[email protected]'
44+
git add -A
45+
git commit -m "ci: Version Packages"
46+
git push
47+
fi
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
- name: Publish Packages
51+
run: pnpm run changeset:publish
4852
env:
49-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5053
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51-
TAG: ${{ inputs.tag }}
5254
- name: Upload coverage to Codecov
5355
uses: codecov/[email protected]
5456
with:

.npmrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
link-workspace-packages=true
2-
prefer-workspace-packages=true
31
provenance=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.4.1
1+
24.8.0

CONTRIBUTING.md

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -155,79 +155,9 @@ You can use Gitpod (An Online Open Source VS Code like IDE which is free for Ope
155155
156156
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/query)
157157
158-
## Commit message conventions
158+
## Changesets
159159
160-
`TanStack/query` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).
161-
162-
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**.
163-
164-
### Commit Message Format
165-
166-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
167-
format that includes a **type**, a **scope** and a **subject**:
168-
169-
```text
170-
<type>(<scope>): <subject>
171-
<BLANK LINE>
172-
<body>
173-
<BLANK LINE>
174-
<footer>
175-
```
176-
177-
The **header** is mandatory and the **scope** of the header is optional.
178-
179-
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
180-
181-
### Type
182-
183-
Must be one of the following:
184-
185-
- **feat**: A new feature
186-
- **fix**: A bug fix
187-
- **docs**: Documentation only changes
188-
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
189-
- **refactor**: A code change that neither fixes a bug nor adds a feature
190-
- **perf**: A code change that improves performance
191-
- **test**: Adding missing or correcting existing tests
192-
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation
193-
194-
### Scope
195-
196-
The scope could be anything specifying place of the commit change. For example `query-core`, `react-query` etc...
197-
198-
You can use `*` when the change affects more than a single scope.
199-
200-
### Subject
201-
202-
The subject contains succinct description of the change:
203-
204-
- use the imperative, present tense: "change" not "changed" nor "changes"
205-
- don't capitalize first letter
206-
- no dot (.) at the end
207-
208-
### Body
209-
210-
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
211-
212-
### Footer
213-
214-
The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).
215-
216-
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
217-
218-
### Example
219-
220-
Here is an example of the release type that will be done based on a commit messages:
221-
222-
| Commit message | Release type |
223-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
224-
| fix(pencil): stop graphite breaking when too much pressure applied | Patch Release |
225-
| feat(pencil): add `graphiteWidth` option | ~~Minor~~ Feature Release |
226-
| perf(pencil): remove `graphiteWidth` option<br/><br/>BREAKING CHANGE: The `graphiteWidth` option has been removed.<br/>The default graphite width of 10mm is always used for performance reasons. | ~~Major~~ Breaking Release |
227-
228-
### Revert
229-
230-
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
160+
This repo uses [Changesets](https://github.com/changesets/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. If needed, changeset descriptions can be more descriptive, and will be included in the changelog. If your PR affects docs, examples, styles, etc., you probably don't need to generate a changeset.
231161

232162
## Pull requests
233163

@@ -237,7 +167,7 @@ Use an appropriate commit type. Be especially careful with breaking changes.
237167

238168
## Releases
239169

240-
For each new commit added to `main` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.
170+
For each new commit added to `main`, a GitHub Workflow is triggered which runs the [Changesets Action](https://github.com/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.
241171

242172
## 🧪 Test
243173

0 commit comments

Comments
 (0)