Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@svitejs/changesets-changelog-github-compact",
{ "repo": "TanStack/query" }
],
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"fixed": [],
"linked": []
}
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## 🎯 Changes

<!-- What changes are made in this PR? Describe the change and its motivation. -->

## ✅ Checklist

- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/query/blob/main/CONTRIBUTING.md).
- [ ] I have tested this code locally with `pnpm test:pr`.

## 🚀 Release Impact

- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
- [ ] This change is docs/CI/dev-only (no release).
23 changes: 11 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: ci
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: override release tag
required: false
push:
branches: [main, alpha, beta, rc, v4]

Expand Down Expand Up @@ -39,16 +34,20 @@ jobs:
- name: Stop Nx Agents
if: ${{ always() }}
run: npx nx-cloud stop-all-agents
- name: Publish
- name: Version Packages
run: pnpm run changeset:version
- name: Commit version files
run: |
git config --global user.name 'Tanner Linsley'
git config --global user.email 'tannerlinsley@users.noreply.github.com'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm run cipublish
git config --global user.email 'tannerlinsley@users.noreply.github.com' git add -A
git commit -m "ci: Version Packages"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +39 to +46
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 'tannerlinsley@users.noreply.github.com'            git add -A
-          git commit -m "ci: Version Packages"
-          git push
+          git config --global user.email 'tannerlinsley@users.noreply.github.com'
+          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 'tannerlinsley@users.noreply.github.com'
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm run cipublish
git config --global user.email 'tannerlinsley@users.noreply.github.com' 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 'tannerlinsley@users.noreply.github.com'
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.

- name: Publish Packages
run: pnpm run changeset:publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ inputs.tag }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.6.0
with:
Expand Down
76 changes: 3 additions & 73 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,79 +155,9 @@ You can use Gitpod (An Online Open Source VS Code like IDE which is free for Ope

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/query)

## Commit message conventions
## Changesets

`TanStack/query` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).

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**.

### Commit Message Format

Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:

```text
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

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.

### Type

Must be one of the following:

- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation

### Scope

The scope could be anything specifying place of the commit change. For example `query-core`, `react-query` etc...

You can use `*` when the change affects more than a single scope.

### Subject

The subject contains succinct description of the change:

- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (.) at the end

### Body

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.

### Footer

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).

**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.

### Example

Here is an example of the release type that will be done based on a commit messages:

| Commit message | Release type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| fix(pencil): stop graphite breaking when too much pressure applied | Patch Release |
| feat(pencil): add `graphiteWidth` option | ~~Minor~~ Feature Release |
| 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 |

### Revert

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.
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.

## Pull requests

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

## Releases

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.
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.

## 🧪 Test

Expand Down
3 changes: 1 addition & 2 deletions integrations/angular-cli-20/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "angular-cli-20",
"version": "0.0.0",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development"
},
"private": true,
"dependencies": {
"@angular/common": "^20.0.0",
"@angular/compiler": "^20.0.0",
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"prettier:write": "pnpm run prettier --write",
"docs:generate": "node scripts/generateDocs.ts",
"verify-links": "node scripts/verify-links.ts",
"cipublish": "node scripts/publish.ts"
"changeset": "changeset",
"changeset:version": "changeset version && pnpm install --no-frozen-lockfile && pnpm prettier:write",
"changeset:publish": "changeset publish"
},
"nx": {
"includedScripts": [
Expand All @@ -39,8 +41,10 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
"@changesets/cli": "^2.29.5",
"@cspell/eslint-plugin": "^9.2.1",
"@eslint-react/eslint-plugin": "^1.53.1",
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
"@tanstack/config": "^0.20.2",
"@testing-library/jest-dom": "^6.8.0",
"@types/node": "^22.15.3",
Expand Down
Loading
Loading