Clean up new release process (#85458)

This commit is contained in:
Jiwon Choi
2025-10-29 00:17:24 +01:00
committed by GitHub
parent d8cde2a57d
commit c8f3be7e89
33 changed files with 3 additions and 952 deletions
-8
View File
@@ -1,8 +0,0 @@
# Changesets
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
-11
View File
@@ -1,11 +0,0 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "vercel/next.js" }],
"commit": false,
"fixed": [["next", "@next/swc"]],
"linked": [],
"access": "public",
"baseBranch": "canary",
"updateInternalDependencies": "patch",
"ignore": []
}
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
Enable `ppr` when `cacheComponents` is enabled
-5
View File
@@ -1,5 +0,0 @@
---
'next': patch
---
Add `regions` to the function config manifest file
-5
View File
@@ -1,5 +0,0 @@
---
'next': patch
---
Resolved bug where hitting the parameterized path directly would cause a fallback shell generation instead of just rendering the route with the parameterized placeholders.
-5
View File
@@ -1,5 +0,0 @@
---
'next': patch
---
Fix the unexpected clearing of symbolic link directories
-5
View File
@@ -1,5 +0,0 @@
---
'next': patch
---
Fix dangling promise in unstable_cache
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
Always pass implicit/soft tags into the `CacheHandler.get` method
-5
View File
@@ -1,5 +0,0 @@
---
'next': patch
---
Fix to use https urls in meta data images when using --experimental-https flag
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
Do not cache fetches with 'no-store' in "use cache" during SSG
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
[TypeScript Plugin] Match method signature (`someFunc(): void`) type for client boundary warnings.
-5
View File
@@ -1,5 +0,0 @@
---
'next': patch
---
Fixed rewrite params of the interception routes not being parsed correctly in certain deployed environments
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
Use `onPostpone` to determine if segment prefetch is partial
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
[TypeScript Plugin] Moved the diagnostics' positions to the prop's type instead of the value for client-boundary warnings.
-5
View File
@@ -1,5 +0,0 @@
---
'@next/swc': patch
---
Added an experimental option for using the system CA store for fetching Google Fonts in Turbopack
-8
View File
@@ -1,8 +0,0 @@
---
'next': patch
---
[dev-overlay] Show error overlay on any thrown value
We used to only show the error overlay on thrown values with a stack property.
On other thrown values we kept the overlay collapsed.
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
[Segment Cache] Fix: Ensure server references can be prerendered
-5
View File
@@ -1,5 +0,0 @@
---
'next': patch
---
Sourcemap errors during prerender if `experimental.enablePrerenderSourceMaps` is enabled
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
Fix name tracking for closures in server actions transform
-5
View File
@@ -1,5 +0,0 @@
---
"next": patch
---
[cacheComponents] Avoid timeout errors with dynamic params in `"use cache"`
+1 -43
View File
@@ -19,11 +19,6 @@ env:
#
# See https://doc.rust-lang.org/rustc/platform-support/apple-darwin.html#os-version for more details
MACOSX_DEPLOYMENT_TARGET: 11.0
# This will become "true" if the latest commit (merged release PR) is either:
# - "Version Packages (#<number>)"
# - "Version Pacakges (canary/rc) (#<number>)"
# set from scripts/check-is-release.js
__NEW_RELEASE: 'false'
jobs:
deploy-target:
@@ -53,13 +48,7 @@ jobs:
# 'staging' for canary branch since that will eventually be published i.e. become the production build.
id: deploy-target
run: |
# TODO: Remove the new release check once the new release workflow is fully replaced.
RELEASE_CHECK=$(node ./scripts/check-is-release.js 2> /dev/null || :)
if [[ $RELEASE_CHECK == 'new-release' ]];
then
echo "__NEW_RELEASE=true" >> $GITHUB_ENV
echo "value=production" >> $GITHUB_OUTPUT
elif [[ $RELEASE_CHECK == v* ]];
if [[ $(node ./scripts/check-is-release.js 2> /dev/null || :) == v* ]];
then
echo "value=production" >> $GITHUB_OUTPUT
elif [ '${{ github.ref }}' == 'refs/heads/canary' ]
@@ -611,41 +600,10 @@ jobs:
- run: npm i -g [email protected] # need latest version for provenance (pinning to avoid bugs)
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: ./scripts/publish-native.js
# Legacy release process
- run: ./scripts/publish-release.js
if: ${{ env.__NEW_RELEASE == 'false' }}
env:
RELEASE_BOT_GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
# New release process
- name: Publish to NPM
id: changesets
# TODO: Change to IS_RELEASE condition when new release becomes stable.
if: ${{ env.__NEW_RELEASE == 'true' }}
uses: changesets/action@v1
with:
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
- name: Send a Slack notification of the publish status
# TODO: Change to IS_RELEASE condition when new release becomes stable.
if: ${{ env.__NEW_RELEASE == 'true' && (steps.changesets.outputs.published == 'true' || steps.changesets.outputs.published == 'false') }}
run: pnpm tsx scripts/release/slack.ts
env:
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
RELEASE_STATUS: ${{ steps.changesets.outputs.published }}
WORKFLOW_LINK: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
WORKFLOW_ACTOR: ${{ github.actor }}
- name: Upload npm log artifact
if: steps.changesets.outputs.published == 'true'
uses: actions/upload-artifact@v4
with:
name: npm-publish-logs
path: /home/runner/.npm/_logs/*
publish-turbopack-npm-packages:
# Matches the commit message written by turbopack/xtask/src/publish.rs:377
if: "${{(github.ref == 'refs/heads/canary') && startsWith(github.event.head_commit.message, 'chore: release turbopack npm packages')}}"
+1 -2
View File
@@ -39,8 +39,7 @@ jobs:
- name: check for release
id: is-release
run: |
RELEASE_CHECK=$(node ./scripts/check-is-release.js 2> /dev/null || :)
if [[ $RELEASE_CHECK == "new-release" || $RELEASE_CHECK == v* ]];
if [[ $(node ./scripts/check-is-release.js 2> /dev/null || :) == v* ]];
then
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
else
@@ -1,23 +0,0 @@
name: Force Merge Canary Release PR
on: pull_request
permissions:
# To bypass and merge PR
pull-requests: write
jobs:
force-merge-canary-release-pr:
runs-on: ubuntu-latest
# Validate the login, PR title, and the label to ensure the PR is
# from the release PR and prevent spoofing.
if: |
github.event.pull_request.user.login == 'vercel-release-bot' &&
github.event.pull_request.title == 'Version Packages (canary)' &&
contains(github.event.pull_request.labels.*.name, 'created-by: CI')
steps:
- name: Bypass required status checks and merge PR
run: gh pr merge --admin --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
-124
View File
@@ -1,124 +0,0 @@
name: Trigger Release (New)
on:
# Run every day at 23:15 UTC
# TODO: Disabled cron for now, but uncomment
# once replaced the old release workflow.
# schedule:
# - cron: '15 23 * * *'
# Run manually
workflow_dispatch:
inputs:
releaseType:
description: Release Type
required: true
type: choice
# Cron job will run canary release
default: canary
options:
- canary
- stable
- release-candidate
- beta
force:
description: Forced Release
default: false
type: boolean
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
NAPI_CLI_VERSION: 2.18.4
TURBO_VERSION: 2.5.5
NODE_LTS_VERSION: 20
permissions:
# To create PR
pull-requests: write
jobs:
start:
if: github.repository_owner == 'vercel'
runs-on: ubuntu-latest
env:
NEXT_TELEMETRY_DISABLED: 1
# we build a dev binary for use in CI so skip downloading
# canary next-swc binaries in the monorepo
NEXT_SKIP_NATIVE_POSTINSTALL: 1
environment: release-${{ github.event.inputs.releaseType }}
steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
# Since actions/checkout won't include the latest tag information,
# use the old clone workflow while still preserving branch specific
# checkout behavior to support backports.
# x-ref: https://github.com/vercel/next.js/pull/63167
- name: Clone Next.js repository
run: git clone https://github.com/vercel/next.js.git --depth=25 --single-branch --branch ${GITHUB_REF_NAME:-canary} .
- name: Check token
run: gh auth status
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
- name: Get commit of the latest tag
run: echo "LATEST_TAG_COMMIT=$(git rev-list -n 1 $(git describe --tags --abbrev=0))" >> $GITHUB_ENV
- name: Get latest commit
run: echo "LATEST_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Check if new commits since last tag
if: ${{ github.event.inputs.releaseType != 'stable' && github.event.inputs.force != true }}
run: |
if [ "$LATEST_TAG_COMMIT" = "$LATEST_COMMIT" ]; then
echo "No new commits. Exiting..."
exit 1
fi
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Setup corepack
run: |
npm i -g [email protected]
corepack enable
pnpm --version
- id: get-store-path
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
- uses: actions/cache@v4
timeout-minutes: 5
id: cache-pnpm-store
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm install
- run: pnpm run build
- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
RELEASE_TYPE: ${{ github.event.inputs.releaseType }}
# Add label to verify the PR is created from this workflow.
- name: Add label to PR
if: steps.changesets.outputs.pullRequestNumber
run: 'gh pr edit ${{ steps.changesets.outputs.pullRequestNumber }} --add-label "created-by: CI"'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-1
View File
@@ -17,7 +17,6 @@ packages/next/wasm/@next
packages/next/errors.json
.github/actions/next-stats-action/.work
.changeset/*.md
crates/**/tests/**/output*
crates/core/tests/loader/issue-32553/input.js
-4
View File
@@ -13,8 +13,6 @@
"lerna": "lerna",
"dev": "turbo run dev --parallel",
"pack-next": "tsx scripts/pack-next.ts",
"ci:version": "tsx ./scripts/release/version-packages.ts",
"ci:publish": "tsx ./scripts/release/publish-npm.ts",
"test-types": "tsc",
"test-unit": "jest test/unit/ packages/next/ packages/font",
"test-dev-inner": "cross-env NEXT_TEST_MODE=dev pnpm testheadless",
@@ -122,8 +120,6 @@
"@babel/plugin-syntax-explicit-resource-management": "7.25.7",
"@babel/plugin-transform-object-rest-spread": "7.25.9",
"@babel/preset-react": "7.26.3",
"@changesets/changelog-github": "0.5.1",
"@changesets/cli": "2.29.3",
"@edge-runtime/jest-environment": "4.0.0",
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.1",
-356
View File
@@ -69,12 +69,6 @@ importers:
'@babel/preset-react':
specifier: 7.26.3
version: 7.26.3(@babel/[email protected])
'@changesets/changelog-github':
specifier: 0.5.1
version: 0.5.1([email protected])
'@changesets/cli':
specifier: 2.29.3
version: 2.29.3
'@edge-runtime/jest-environment':
specifier: 4.0.0
version: 4.0.0
@@ -2818,67 +2812,6 @@ packages:
'@capsizecss/[email protected]':
resolution: {integrity: sha512-hIn8MAHxLvwyUh6ZvLQHDt2GPShBz6+gxBs1JTD9GleBkht1AZvtCFo0adr7bQvYYuQzUJeKi69zqlAwgKMHNA==}
'@changesets/[email protected]':
resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==}
'@changesets/[email protected]':
resolution: {integrity: sha512-vS5J92Rm7ZUcrvtu6WvggGWIdohv8s1/3ypRYQX8FsPO+KPDx6JaNC3YwSfh2umY/faGGfNnq42A7PRT0aZPFw==}
'@changesets/[email protected]':
resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==}
'@changesets/[email protected]':
resolution: {integrity: sha512-BVuHtF+hrhUScSoHnJwTELB4/INQxVFc+P/Qdt20BLiBFIHFJDDUaGsZw+8fQeJTRP5hJZrzpt3oZWh0G19rAQ==}
'@changesets/[email protected]':
resolution: {integrity: sha512-TNhKr6Loc7I0CSD9LpAyVNSxWBHElXVmmvQYIZQvaMan5jddmL7geo3+08Wi7ImgHFVNB0Nhju/LzXqlrkoOxg==}
hasBin: true
'@changesets/[email protected]':
resolution: {integrity: sha512-bd+3Ap2TKXxljCggI0mKPfzCQKeV/TU4yO2h2C6vAihIo8tzseAn2e7klSuiyYYXvgu53zMN1OeYMIQkaQoWnA==}
'@changesets/[email protected]':
resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==}
'@changesets/[email protected]':
resolution: {integrity: sha512-gphr+v0mv2I3Oxt19VdWRRUxq3sseyUpX9DaHpTUmLj92Y10AGy+XOtV+kbM6L/fDcpx7/ISDFK6T8A/P3lOdQ==}
'@changesets/[email protected]':
resolution: {integrity: sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==}
'@changesets/[email protected]':
resolution: {integrity: sha512-4DZpsewsc/1m5TArVg5h1c0U94am+cJBnu3izAM3yYIZr8+zZwa3AXYdEyCNURzjx0wWr80u/TWoxshbwdZXOA==}
'@changesets/[email protected]':
resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==}
'@changesets/[email protected]':
resolution: {integrity: sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==}
'@changesets/[email protected]':
resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==}
'@changesets/[email protected]':
resolution: {integrity: sha512-iwksMs5Bf/wUItfcg+OXrEpravm5rEd9Bf4oyIPL4kVTmJQ7PNDSd6MDYkpSJR1pn7tz/k8Zf2DhTCqX08Ou+Q==}
'@changesets/[email protected]':
resolution: {integrity: sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==}
'@changesets/[email protected]':
resolution: {integrity: sha512-UPzNGhsSjHD3Veb0xO/MwvasGe8eMyNrR/sT9gR8Q3DhOQZirgKhhXv/8hVsI0QpPjR004Z9iFxoJU6in3uGMg==}
'@changesets/[email protected]':
resolution: {integrity: sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==}
'@changesets/[email protected]':
resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==}
'@changesets/[email protected]':
resolution: {integrity: sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==}
'@changesets/[email protected]':
resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==}
'@csstools/[email protected]':
resolution: {integrity: sha512-5D5ND/mZWcQoSfYnSPsXtuiFxhzmhxt6pcjrFLJyldj+p0ZN2vvRpYNX+lahFTtMhAYOa2WmkdGINr0yP0CvGA==}
engines: {node: ^12 || ^14 || >=16}
@@ -4269,12 +4202,6 @@ packages:
peerDependencies:
react: 19.3.0-canary-b4455a6e-20251027
'@manypkg/[email protected]':
resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==}
'@manypkg/[email protected]':
resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==}
'@mapbox/[email protected]':
resolution: {integrity: sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==}
hasBin: true
@@ -7256,10 +7183,6 @@ packages:
resolution: {integrity: sha512-aVNobHnJqLiUelTaHat9DZ1qM2w0C0Eym4LPI/3JxOnSokGVdsl1T1kN7TFvsEAD8G47A6VKQ0TVHqbBnYMJlQ==}
engines: {node: '>=12.0.0'}
[email protected]:
resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==}
engines: {node: '>=4'}
[email protected]:
resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==}
@@ -8552,9 +8475,6 @@ packages:
resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==}
engines: {node: '>= 0.4'}
[email protected]:
resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==}
[email protected]:
resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==}
@@ -8983,10 +8903,6 @@ packages:
resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==}
engines: {node: '>=12'}
[email protected]:
resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==}
engines: {node: '>=10'}
[email protected]:
resolution: {integrity: sha512-Olebo5gyh44OAXTd2BKdcbN5VaZOIKFzoeo9JUFwxDlGt6Sd8fUo6SKaLcafy8aP2UrsKmWDpsscsFEghMjeZA==}
@@ -9682,9 +9598,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
[email protected]:
resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==}
[email protected]:
resolution: {integrity: sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==}
engines: {node: '>=0.12'}
@@ -9987,10 +9900,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==}
[email protected]:
resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
engines: {node: '>=6 <7 || >=8'}
[email protected]:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
engines: {node: '>=6 <7 || >=8'}
@@ -10702,10 +10611,6 @@ packages:
resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
engines: {node: '>= 6'}
[email protected]:
resolution: {integrity: sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==}
hasBin: true
[email protected]:
resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==}
engines: {node: '>=8.12.0'}
@@ -11280,10 +11185,6 @@ packages:
resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==}
engines: {node: '>= 0.4'}
[email protected]:
resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==}
engines: {node: '>=4'}
[email protected]:
resolution: {integrity: sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==}
engines: {node: '>=4'}
@@ -12170,9 +12071,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==}
[email protected]:
resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==}
[email protected]:
resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==}
deprecated: This package is deprecated. Use https://socket.dev/npm/package/eta instead.
@@ -13493,9 +13391,6 @@ packages:
resolution: {integrity: sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==}
deprecated: This package is no longer supported.
[email protected]:
resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==}
[email protected]:
resolution: {integrity: sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==}
@@ -13517,10 +13412,6 @@ packages:
resolution: {integrity: sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==}
engines: {node: '>=4'}
@@ -13561,10 +13452,6 @@ packages:
resolution: {integrity: sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==}
engines: {node: '>=8'}
@@ -13632,9 +13519,6 @@ packages:
resolution: {integrity: sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==}
[email protected]:
resolution: {integrity: sha512-xCl++Hb3aBC7LaWMimbO4xUqZVsEbKDVc6KKDIIyAeBYrmMwY1yJC2nES/lsGd8sdQLUosgBxQyuVNncZ2Ru0w==}
engines: {node: '>=10'}
@@ -14642,11 +14526,6 @@ packages:
engines: {node: '>=10.13.0'}
hasBin: true
[email protected]:
resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
engines: {node: '>=10.13.0'}
hasBin: true
[email protected]:
resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}
engines: {node: '>=14'}
@@ -14866,9 +14745,6 @@ packages:
resolution: {integrity: sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==}
engines: {node: '>=0.6'}
[email protected]:
resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==}
[email protected]:
resolution: {integrity: sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==}
engines: {node: '>=0.4.x'}
@@ -15170,10 +15046,6 @@ packages:
resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==}
engines: {node: '>=8'}
[email protected]:
resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==}
engines: {node: '>=6'}
[email protected]:
resolution: {integrity: sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==}
engines: {node: '>=0.8'}
@@ -16107,9 +15979,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-28+AJr82moMVWolQvlAIv3JcYDkjkFTEmfDc503wxrF5l2rQ3dFz6DpbXp3kD4zmgGGldfM4xM4v1sFj/ZaIOA==}
[email protected]:
resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==}
[email protected]:
resolution: {integrity: sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==}
@@ -19082,163 +18951,6 @@ snapshots:
'@capsizecss/[email protected]': {}
'@changesets/[email protected]':
dependencies:
'@changesets/config': 3.1.1
'@changesets/get-version-range-type': 0.4.0
'@changesets/git': 3.0.4
'@changesets/should-skip-package': 0.1.2
'@changesets/types': 6.1.0
'@manypkg/get-packages': 1.1.3
detect-indent: 6.0.0
fs-extra: 7.0.1
lodash.startcase: 4.4.0
outdent: 0.5.0
prettier: 2.8.8
resolve-from: 5.0.0
semver: 7.6.3
'@changesets/[email protected]':
dependencies:
'@changesets/errors': 0.2.0
'@changesets/get-dependents-graph': 2.1.3
'@changesets/should-skip-package': 0.1.2
'@changesets/types': 6.1.0
'@manypkg/get-packages': 1.1.3
semver: 7.6.3
'@changesets/[email protected]':
dependencies:
'@changesets/types': 6.1.0
'@changesets/[email protected]([email protected])':
dependencies:
'@changesets/get-github-info': 0.6.0([email protected])
'@changesets/types': 6.1.0
dotenv: 8.6.0
transitivePeerDependencies:
- encoding
'@changesets/[email protected]':
dependencies:
'@changesets/apply-release-plan': 7.0.12
'@changesets/assemble-release-plan': 6.0.7
'@changesets/changelog-git': 0.2.1
'@changesets/config': 3.1.1
'@changesets/errors': 0.2.0
'@changesets/get-dependents-graph': 2.1.3
'@changesets/get-release-plan': 4.0.11
'@changesets/git': 3.0.4
'@changesets/logger': 0.1.1
'@changesets/pre': 2.0.2
'@changesets/read': 0.6.5
'@changesets/should-skip-package': 0.1.2
'@changesets/types': 6.1.0
'@changesets/write': 0.4.0
'@manypkg/get-packages': 1.1.3
ansi-colors: 4.1.3
ci-info: 3.8.0
enquirer: 2.4.1
external-editor: 3.1.0
fs-extra: 7.0.1
mri: 1.2.0
p-limit: 2.3.0
package-manager-detector: 0.2.11
picocolors: 1.1.1
resolve-from: 5.0.0
semver: 7.6.3
spawndamnit: 3.0.1
term-size: 2.2.1
'@changesets/[email protected]':
dependencies:
'@changesets/errors': 0.2.0
'@changesets/get-dependents-graph': 2.1.3
'@changesets/logger': 0.1.1
'@changesets/types': 6.1.0
'@manypkg/get-packages': 1.1.3
fs-extra: 7.0.1
micromatch: 4.0.8
'@changesets/[email protected]':
dependencies:
extendable-error: 0.1.7
'@changesets/[email protected]':
dependencies:
'@changesets/types': 6.1.0
'@manypkg/get-packages': 1.1.3
picocolors: 1.1.1
semver: 7.6.3
'@changesets/[email protected]([email protected])':
dependencies:
dataloader: 1.4.0
node-fetch: 2.6.7([email protected])
transitivePeerDependencies:
- encoding
'@changesets/[email protected]':
dependencies:
'@changesets/assemble-release-plan': 6.0.7
'@changesets/config': 3.1.1
'@changesets/pre': 2.0.2
'@changesets/read': 0.6.5
'@changesets/types': 6.1.0
'@manypkg/get-packages': 1.1.3
'@changesets/[email protected]': {}
'@changesets/[email protected]':
dependencies:
'@changesets/errors': 0.2.0
'@manypkg/get-packages': 1.1.3
is-subdir: 1.2.0
micromatch: 4.0.8
spawndamnit: 3.0.1
'@changesets/[email protected]':
dependencies:
picocolors: 1.1.1
'@changesets/[email protected]':
dependencies:
'@changesets/types': 6.1.0
js-yaml: 3.14.1
'@changesets/[email protected]':
dependencies:
'@changesets/errors': 0.2.0
'@changesets/types': 6.1.0
'@manypkg/get-packages': 1.1.3
fs-extra: 7.0.1
'@changesets/[email protected]':
dependencies:
'@changesets/git': 3.0.4
'@changesets/logger': 0.1.1
'@changesets/parse': 0.4.1
'@changesets/types': 6.1.0
fs-extra: 7.0.1
p-filter: 2.1.0
picocolors: 1.1.1
'@changesets/[email protected]':
dependencies:
'@changesets/types': 6.1.0
'@manypkg/get-packages': 1.1.3
'@changesets/[email protected]': {}
'@changesets/[email protected]': {}
'@changesets/[email protected]':
dependencies:
'@changesets/types': 6.1.0
fs-extra: 7.0.1
human-id: 4.1.1
prettier: 2.8.8
'@csstools/[email protected]([email protected])':
dependencies:
'@csstools/postcss-progressive-custom-properties': 1.3.0([email protected])
@@ -20939,22 +20651,6 @@ snapshots:
dependencies:
react: 19.3.0-canary-f6a48828-20251019
'@manypkg/[email protected]':
dependencies:
'@babel/runtime': 7.27.0
'@types/node': 20.17.6(patch_hash=rvl3vkomen3tospgr67bzubfyu)
find-up: 4.1.0
fs-extra: 8.1.0
'@manypkg/[email protected]':
dependencies:
'@babel/runtime': 7.27.0
'@changesets/types': 4.1.0
'@manypkg/find-root': 1.1.0
fs-extra: 8.1.0
globby: 11.0.1
read-yaml-file: 1.1.0
'@mapbox/[email protected]([email protected])':
dependencies:
detect-libc: 1.0.3
@@ -24395,10 +24091,6 @@ snapshots:
dependencies:
open: 8.4.0
[email protected]:
dependencies:
is-windows: 1.0.2
[email protected]: {}
[email protected]: {}
@@ -25995,8 +25687,6 @@ snapshots:
es-errors: 1.3.0
is-data-view: 1.0.2
[email protected]: {}
[email protected]: {}
[email protected]: {}
@@ -26390,8 +26080,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]:
@@ -27578,8 +27266,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
chardet: 0.4.2
@@ -27943,12 +27629,6 @@ snapshots:
jsonfile: 4.0.0
universalify: 0.1.2
[email protected]:
dependencies:
graceful-fs: 4.2.11
jsonfile: 4.0.0
universalify: 0.1.2
[email protected]:
dependencies:
graceful-fs: 4.2.11
@@ -28909,8 +28589,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
[email protected]: {}
[email protected]: {}
[email protected]: {}
@@ -29431,10 +29109,6 @@ snapshots:
call-bound: 1.0.4
has-tostringtag: 1.0.2
[email protected]:
dependencies:
better-path-resolve: 1.0.0
[email protected]:
dependencies:
html-comment-regex: 1.1.2
@@ -30675,8 +30349,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
lodash._reinterpolate: 3.0.0
@@ -32691,8 +32363,6 @@ snapshots:
os-homedir: 1.0.2
os-tmpdir: 1.0.2
[email protected]: {}
[email protected]: {}
[email protected]: {}
@@ -32709,10 +32379,6 @@ snapshots:
[email protected]: {}
[email protected]:
dependencies:
p-map: 2.1.0
[email protected]: {}
[email protected]: {}
@@ -32747,8 +32413,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
aggregate-error: 3.1.0
@@ -32816,10 +32480,6 @@ snapshots:
registry-url: 5.1.0
semver: 6.3.1
[email protected]:
dependencies:
quansync: 0.2.10
[email protected]:
dependencies:
'@npmcli/git': 2.0.4
@@ -33887,8 +33547,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]:
@@ -34116,8 +33774,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
@@ -34456,13 +34112,6 @@ snapshots:
parse-json: 5.2.0
type-fest: 0.6.0
[email protected]:
dependencies:
graceful-fs: 4.2.11
js-yaml: 3.14.1
pify: 4.0.1
strip-bom: 3.0.0
[email protected]:
dependencies:
mute-stream: 0.0.8
@@ -35765,11 +35414,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
[email protected]:
dependencies:
cross-spawn: 7.0.6
signal-exit: 4.1.0
[email protected]:
dependencies:
spdx-expression-parse: 3.0.1
-7
View File
@@ -13,17 +13,10 @@ const checkIsRelease = async () => {
const versionString = commitMsg.split(' ').pop().trim()
const publishMsgRegex = /^v\d{1,}\.\d{1,}\.\d{1,}(-\w{1,}\.\d{1,})?$/
const newPublishMsgRegex = /^Version Packages( \((canary|rc)\))?( \(#\d+\))?$/
// When the "Version Packages" PR is merged, it may contain "\n"
// in the message when co-authored, so split and get the first one.
const newPublishPrMessage = commitMsg.split('\n')[0]
if (publishMsgRegex.test(versionString)) {
console.log(versionString)
process.exit(0)
} else if (newPublishMsgRegex.test(newPublishPrMessage)) {
console.log('new-release')
process.exit(0)
} else {
console.log('not publish commit', { commitId, commitMsg, versionString })
process.exit(1)
+1 -2
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
RELEASE_CHECK=$(node ./scripts/check-is-release.js 2> /dev/null || :)
if [[ $RELEASE_CHECK == "new-release" || $RELEASE_CHECK == v* ]];
if [[ $(node ./scripts/check-is-release.js 2> /dev/null || :) == v* ]];
then
echo "Publish occurred, running release stats..."
else
-111
View File
@@ -1,111 +0,0 @@
import execa from 'execa'
import semver from 'semver'
import { existsSync } from 'fs'
import { join } from 'path'
import { readdir, readFile } from 'fs/promises'
async function fetchTagsFromRegistry(packageName: string) {
const res = await fetch(
`https://registry.npmjs.org/-/package/${packageName}/dist-tags`
)
const tags = await res.json()
return tags
}
async function getTag({
name,
version,
latest,
}: {
name: string
version: string
latest: string
}): Promise<string> {
const preConfigPath = join(process.cwd(), '.changeset', 'pre.json')
if (existsSync(preConfigPath)) {
const { tag, mode } = JSON.parse(await readFile(preConfigPath, 'utf-8'))
if (mode === 'pre') {
if (!version.includes('-')) {
throw new Error(
`The changeset is in pre mode, but the version of "${name}@${version}" is not prerelease. It is likely a bug from versioning the packages.`
)
}
return tag
}
}
if (version.includes('-')) {
throw new Error(
`The changeset is not in pre mode, but the version of "${name}@${version}" is prerelease. It is likely a bug from versioning the packages.`
)
}
// If the current version is less than the latest,
// it means this is a backport release. Since NPM
// sets the 'latest' tag by default during publishing,
// when users install `next@latest`, they might get the
// backported version instead of the actual "latest"
// version. Hence, we explicitly set the tag as
// 'stable' for backports.
if (semver.lt(version, latest)) {
return 'stable'
}
return 'latest'
}
async function publishNpm() {
if (!process.env.NPM_TOKEN) {
throw new Error('NPM_TOKEN is not set')
}
const packagesDir = join(process.cwd(), 'packages')
const packageDirs = await readdir(packagesDir, {
withFileTypes: true,
})
for (const packageDir of packageDirs) {
if (!packageDir.isDirectory()) {
continue
}
const pkgJson = JSON.parse(
await readFile(
join(process.cwd(), 'packages', packageDir.name, 'package.json'),
'utf-8'
)
)
if (pkgJson.private) {
continue
}
const tags = await fetchTagsFromRegistry(pkgJson.name)
// If the current version is already published in the
// registry, skip the process.
if (semver.eq(pkgJson.version, tags.latest)) {
console.log(
`Skipping ${pkgJson.name}@${pkgJson.version} because it is already published.`
)
continue
}
const tag = await getTag({
name: pkgJson.name,
version: pkgJson.version,
latest: tags.latest,
})
const packagePath = join(packagesDir, packageDir.name)
const args = ['publish', packagePath, '--tag', tag]
console.log(
`Running command: "pnpm ${args.join(' ')}" for ${pkgJson.name}@${pkgJson.version}`
)
await execa('pnpm', args, { stdio: 'inherit' })
}
}
publishNpm()
-40
View File
@@ -1,40 +0,0 @@
import { WebClient } from '@slack/web-api'
async function slack() {
if (!process.env.SLACK_TOKEN) {
throw new Error('SLACK_TOKEN not set')
}
const workflowLink = process.env.WORKFLOW_LINK
if (!workflowLink) {
throw new Error('WORKFLOW_LINK not set')
}
const channel = process.env.SLACK_CHANNEL_ID ?? 'C0668R2391V' // #next-releases
// TODO: Configure SLACK_ envs for dry run testing to not ping the oncall.
// TODO: It'll become `@oncall-nextjs`
const ping = process.env.SLACK_PING ?? '@nextjs-oncall'
const message =
(process.env.SLACK_MESSAGE ?? process.env.RELEASE_STATUS === 'true')
? `Successfully published a new release!\n<https://github.com/vercel/next.js/releases|Releases Link>`
: `Failed to publish a new release triggered by "${process.env.WORKFLOW_ACTOR}". ${ping}\n<${workflowLink}|Workflow Link>`
const slackClient = new WebClient(process.env.SLACK_TOKEN)
const res = await slackClient.chat.postMessage({
channel,
text: message,
username: 'Next.js Bot',
icon_emoji: ':nextjs:',
})
if (!res.ok) {
throw new Error(
`Failed to send message "${message}" to Slack channel #next-releases: ${res.error}`
)
}
console.log('Successfully sent message to Slack!')
}
slack()
-126
View File
@@ -1,126 +0,0 @@
import execa from 'execa'
import { existsSync } from 'fs'
import { writeFile, readFile, unlink } from 'fs/promises'
import { join } from 'path'
// NOTE: This type may change over time.
type ChangesetStatusJson = {
changesets: {
releases: {
name: string
type: string
summary: string
id: string
}[]
}[]
releases: {
name: string
type: string
oldVersion: string
changesets: string[]
newVersion: string
}[]
}
async function versionPackages() {
const preConfigPath = join(process.cwd(), '.changeset', 'pre.json')
// Exit previous pre mode to prepare for the next release.
if (existsSync(preConfigPath)) {
if (require(preConfigPath).mode !== 'exit') {
// Since current repository is in pre mode, need
// to exit before versioning the packages.
await execa('pnpm', ['changeset', 'pre', 'exit'], {
stdio: 'inherit',
})
}
}
// For prereleases, we need to set the "mode" on `pre.json`, which
// can be done by running `changeset pre enter <mode>`.
const releaseType = process.env.RELEASE_TYPE
switch (releaseType) {
case 'canary': {
// Enter pre mode as "canary" tag.
await execa('pnpm', ['changeset', 'pre', 'enter', 'canary'], {
stdio: 'inherit',
})
console.log(
'▲ Preparing to bump the canary version, checking if there are any changesets.'
)
// Create an empty changeset for `next` to bump the canary version
// even if there are no changesets for `next`.
await execa('pnpm', [
'changeset',
'status',
'--output',
'./changeset-status.json',
])
let hasNextChangeset = false
if (existsSync('./changeset-status.json')) {
const changesetStatus: ChangesetStatusJson = JSON.parse(
await readFile('./changeset-status.json', 'utf8')
)
console.log('▲ Changeset Status:')
console.log(changesetStatus)
hasNextChangeset =
changesetStatus.releases.find(
(release) => release.name === 'next'
) !== undefined
await unlink('./changeset-status.json')
}
if (!hasNextChangeset) {
console.log(
'▲ No changesets found for `next`, creating an empty changeset.'
)
// TODO: Since this is temporary until we hard-require a changeset, we will
// need to remove this in the future to prevent publishing empty releases.
await writeFile(
join(process.cwd(), '.changeset', `next-canary-${Date.now()}.md`),
`---\n'next': patch\n---`
)
}
break
}
case 'release-candidate': {
// Enter pre mode as "rc" tag.
await execa('pnpm', ['changeset', 'pre', 'enter', 'rc'], {
stdio: 'inherit',
})
break
}
case 'beta': {
// Enter pre mode as "beta" tag.
await execa('pnpm', ['changeset', 'pre', 'enter', 'beta'], {
stdio: 'inherit',
})
break
}
case 'stable': {
// No additional steps needed for 'stable' releases since we've already
// exited any pre-release mode. Only need to run `changeset version` after.
break
}
default: {
throw new Error(`Invalid release type: ${releaseType}`)
}
}
await execa('pnpm', ['changeset', 'version'], {
stdio: 'inherit',
})
// TODO: Update the pnpm-lock.yaml since the packages' depend on
// each other. Remove this once they use `workspace:` protocol.
await execa('pnpm', ['install', '--no-frozen-lockfile'], {
stdio: 'inherit',
})
}
versionPackages()
-1
View File
@@ -10,7 +10,6 @@ const CHANGE_ITEM_GROUPS = {
'apps/docs',
'errors',
'examples',
'.changeset',
'UPGRADING.md',
'contributing.md',
'contributing',