Skip to content

Commit fd8e6f0

Browse files
ci: introduce changesets
1 parent cd4ef5c commit fd8e6f0

File tree

8 files changed

+410
-226
lines changed

8 files changed

+410
-226
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/config@3.1.1/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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## 🎯 Changes
2+
3+
<!-- What changes are made in this PR? Is it a feature or a package submission? -->
4+
5+
## ✅ Checklist
6+
7+
- [ ] I have followed the steps listed in the [Contributing guide](https://github.com/TanStack/config/blob/main/CONTRIBUTING.md).
8+
- [ ] I have tested and linted this code locally.
9+
- [ ] I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) for this PR, or this PR should not release a new version.

.github/workflows/release.yml

Lines changed: 10 additions & 14 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

@@ -19,6 +14,7 @@ env:
1914
permissions:
2015
contents: write
2116
id-token: write
17+
pull-requests: write
2218

2319
jobs:
2420
release:
@@ -39,16 +35,16 @@ jobs:
3935
- name: Stop Nx Agents
4036
if: ${{ always() }}
4137
run: npx nx-cloud stop-all-agents
42-
- name: Publish
43-
run: |
44-
git config --global user.name 'Tanner Linsley'
45-
git config --global user.email 'tannerlinsley@users.noreply.github.com'
46-
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
47-
pnpm run cipublish
38+
- name: Run Changesets (version or publish)
39+
uses: changesets/action@v1.5.3
40+
with:
41+
version: pnpm run changeset:version
42+
publish: pnpm run changeset:publish
43+
commit: 'ci: Version Packages'
44+
title: 'ci: Version Packages'
4845
env:
49-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5047
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51-
TAG: ${{ inputs.tag }}
5248
- name: Upload coverage to Codecov
5349
uses: codecov/codecov-action@v4.6.0
5450
with:

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

integrations/angular-cli-20/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "angular-cli-20",
3-
"version": "0.0.0",
3+
"private": true,
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
77
"build": "ng build",
88
"watch": "ng build --watch --configuration development"
99
},
10-
"private": true,
1110
"dependencies": {
1211
"@angular/common": "^20.0.0",
1312
"@angular/compiler": "^20.0.0",

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"prettier:write": "pnpm run prettier --write",
3030
"docs:generate": "node scripts/generateDocs.ts",
3131
"verify-links": "node scripts/verify-links.ts",
32-
"cipublish": "node scripts/publish.ts"
32+
"changeset": "changeset",
33+
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write",
34+
"changeset:publish": "changeset publish"
3335
},
3436
"nx": {
3537
"includedScripts": [
@@ -39,8 +41,10 @@
3941
},
4042
"devDependencies": {
4143
"@arethetypeswrong/cli": "^0.15.3",
44+
"@changesets/cli": "^2.29.5",
4245
"@cspell/eslint-plugin": "^9.2.1",
4346
"@eslint-react/eslint-plugin": "^1.53.1",
47+
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
4448
"@tanstack/config": "^0.20.2",
4549
"@testing-library/jest-dom": "^6.8.0",
4650
"@types/node": "^22.15.3",

0 commit comments

Comments
 (0)