diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000000..0e32a8b571 --- /dev/null +++ b/.changeset/config.json @@ -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": [] +} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..5d397ac0a2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +## ๐ŸŽฏ Changes + + + +## โœ… 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 run 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). diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a746fb0de5..fda2527849 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,8 +2,6 @@ name: PR on: pull_request: - push: - branches: ['svelte-5-adapter'] concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.ref }} @@ -34,7 +32,7 @@ jobs: with: main-branch-name: main - name: Run Checks - run: pnpm run test:pr --parallel=3 + run: pnpm run test:pr - name: Verify Links run: pnpm run verify-links - name: Stop Nx Agents @@ -74,3 +72,15 @@ jobs: | Main | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.1/jsx-runtime?target=es2022%22,%22react@^19.1.1?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.1/jsx-runtime?target=es2022%22,%22react@%5E19.1.1?target=es2022%22%5D%7D%7D) | | This PR | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.1/jsx-runtime?target=es2022%22,%22react@^19.1.1?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.1/jsx-runtime?target=es2022%22,%22react@%5E19.1.1?target=es2022%22%5D%7D%7D) | continue-on-error: true + provenance: + name: Provenance + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5.0.0 + with: + fetch-depth: 0 + - name: Check Provenance + uses: danielroe/provenance-action@v0.1.1 + with: + fail-on-downgrade: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f2028696d..62d8c16434 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,10 @@ -name: ci +name: Release on: - workflow_dispatch: - inputs: - tag: - description: override release tag - required: false push: branches: [main, alpha, beta, rc, v4] + repository_dispatch: + types: [release] concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.ref }} @@ -19,6 +16,7 @@ env: permissions: contents: write id-token: write + pull-requests: write jobs: release: @@ -35,20 +33,41 @@ jobs: - name: Setup Tools uses: tanstack/config/.github/setup@main - name: Run Tests - run: pnpm run test:ci --parallel=3 + run: pnpm run test:ci - name: Stop Nx Agents if: ${{ always() }} run: npx nx-cloud stop-all-agents - - name: Publish + - name: Check for Changesets marked as major + id: major 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 + echo "found=false" >> $GITHUB_OUTPUT + regex="(major)" + shopt -s nullglob + for file in .changeset/*.md; do + if [[ $(cat $file) =~ $regex ]]; then + echo "found=true" >> $GITHUB_OUTPUT + fi + done + - name: Run Changesets (version or publish) + id: changesets + uses: changesets/action@v1.5.3 + with: + version: pnpm run changeset:version + publish: pnpm run changeset:publish + commit: 'ci: Version Packages' + title: 'ci: Version Packages' env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - TAG: ${{ inputs.tag }} + - name: Auto-merge Changesets PR + if: steps.changesets.outputs.hasChangesets == 'true' && steps.major.outputs.found == 'false' + run: | + gh pr merge --squash "$PR_NUMBER" + gh api --method POST /repos/$REPO/dispatches -f 'event_type=release' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v4.6.0 with: diff --git a/.nx/workflows/dynamic-changesets.yaml b/.nx/workflows/dynamic-changesets.yaml index d3536f3ba7..8458c19060 100644 --- a/.nx/workflows/dynamic-changesets.yaml +++ b/.nx/workflows/dynamic-changesets.yaml @@ -1,4 +1,4 @@ distribute-on: small-changeset: 3 linux-medium-js - medium-changeset: 6 linux-medium-js - large-changeset: 10 linux-medium-js + medium-changeset: 4 linux-medium-js + large-changeset: 5 linux-medium-js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cb7ff182cc..2d90db264c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 -(): - - - -