From fcc6811762f403febcc4b2cedec7045b43dcda8b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 16 Jul 2026 01:51:32 +0000 Subject: [PATCH 1/4] chore: adopt Node 24 development baseline and Node >=22.13.0 engines Raise published package engines from node >=18 to >=22.13.0, pin pnpm 11.13.1 via Corepack, add .nvmrc/.node-version, and matrix CI across Node 22.13.x and 24. Configure pnpm 11 allowBuilds for required install scripts. Co-authored-by: Davy --- .changeset/node-engines-22-13.md | 6 + .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/workflows/ci.yml | 160 +++++++++++++++++++++++--- .github/workflows/release.yml | 21 +++- .node-version | 1 + .nvmrc | 1 + CONTRIBUTING.md | 5 +- README.md | 3 + package.json | 5 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- pnpm-workspace.yaml | 7 ++ 12 files changed, 187 insertions(+), 28 deletions(-) create mode 100644 .changeset/node-engines-22-13.md create mode 100644 .node-version create mode 100644 .nvmrc diff --git a/.changeset/node-engines-22-13.md b/.changeset/node-engines-22-13.md new file mode 100644 index 000000000..da2eee808 --- /dev/null +++ b/.changeset/node-engines-22-13.md @@ -0,0 +1,6 @@ +--- +"@open-slide/core": major +"@open-slide/cli": major +--- + +Require Node.js >=22.13.0 for published packages. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 48ad37a57..3dd3c4dca 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -59,7 +59,7 @@ body: attributes: label: Environment description: Node version, package manager, OS, browser (if it's a runtime/UI bug). - placeholder: "Node 20.11.1, pnpm 10.17.0, macOS 14.5, Chrome 126" + placeholder: "Node 24.18.0, pnpm 11.13.1, macOS 14.5, Chrome 126" validations: required: true - type: textarea diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a8c71c2b..d80d6d29c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: [main] pull_request: - branches: [main] concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} @@ -13,18 +12,44 @@ concurrency: jobs: lint: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [22.13.x, 24] steps: - name: Checkout uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 + with: + persist-credentials: false - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 22 - cache: pnpm + node-version: ${{ matrix.node-version }} + + - name: Enable Corepack + run: | + npm install -g corepack@latest + corepack enable + corepack prepare --activate + + - name: Get pnpm store directory + shell: bash + run: | + STORE_PATH="$(pnpm store path --silent)" + if [ -z "$STORE_PATH" ]; then + echo "pnpm store path was empty" >&2 + exit 1 + fi + echo "STORE_PATH=$STORE_PATH" >> "$GITHUB_ENV" + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install dependencies run: pnpm install --frozen-lockfile @@ -37,18 +62,44 @@ jobs: typecheck: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [22.13.x, 24] steps: - name: Checkout uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 + with: + persist-credentials: false - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 22 - cache: pnpm + node-version: ${{ matrix.node-version }} + + - name: Enable Corepack + run: | + npm install -g corepack@latest + corepack enable + corepack prepare --activate + + - name: Get pnpm store directory + shell: bash + run: | + STORE_PATH="$(pnpm store path --silent)" + if [ -z "$STORE_PATH" ]; then + echo "pnpm store path was empty" >&2 + exit 1 + fi + echo "STORE_PATH=$STORE_PATH" >> "$GITHUB_ENV" + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install dependencies run: pnpm install --frozen-lockfile @@ -58,18 +109,44 @@ jobs: test: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [22.13.x, 24] steps: - name: Checkout uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 + with: + persist-credentials: false - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 22 - cache: pnpm + node-version: ${{ matrix.node-version }} + + - name: Enable Corepack + run: | + npm install -g corepack@latest + corepack enable + corepack prepare --activate + + - name: Get pnpm store directory + shell: bash + run: | + STORE_PATH="$(pnpm store path --silent)" + if [ -z "$STORE_PATH" ]; then + echo "pnpm store path was empty" >&2 + exit 1 + fi + echo "STORE_PATH=$STORE_PATH" >> "$GITHUB_ENV" + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install dependencies run: pnpm install --frozen-lockfile @@ -77,6 +154,53 @@ jobs: - name: Run unit tests run: pnpm test + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [22.13.x, 24] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Enable Corepack + run: | + npm install -g corepack@latest + corepack enable + corepack prepare --activate + + - name: Get pnpm store directory + shell: bash + run: | + STORE_PATH="$(pnpm store path --silent)" + if [ -z "$STORE_PATH" ]; then + echo "pnpm store path was empty" >&2 + exit 1 + fi + echo "STORE_PATH=$STORE_PATH" >> "$GITHUB_ENV" + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run build + run: pnpm build + e2e: runs-on: ubuntu-latest timeout-minutes: 20 @@ -87,6 +211,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false - name: Setup pnpm uses: pnpm/action-setup@v4 @@ -94,7 +220,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 24 cache: pnpm - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3ea37a30..9360e8fc6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,15 +20,26 @@ jobs: with: fetch-depth: 0 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - - name: Setup Node uses: actions/setup-node@v4 with: - node-version: 22 + node-version-file: ".nvmrc" registry-url: "https://registry.npmjs.org" - cache: pnpm + + - name: Enable Corepack + run: corepack enable + + - name: Get pnpm store directory + shell: bash + run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV" + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Upgrade npm for OIDC trusted publishing run: npm install -g npm@11 diff --git a/.node-version b/.node-version new file mode 100644 index 000000000..a45fd52cc --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +24 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..a45fd52cc --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 426982900..e04bd6798 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,8 +26,8 @@ pnpm + Turbo monorepo. ## Prerequisites -- **Node.js 22+** (matches CI). -- **pnpm 10.17.0+** — `corepack enable` will pick up the version pinned in `package.json`. +- **Node.js 24** for local development and release (see `.nvmrc` / `.node-version`). Published packages support **Node.js `>=22.13.0`**; CI covers both 22.13+ and 24. +- **pnpm 11.13.1+** via Corepack — `corepack enable` activates the version pinned in `package.json` (`packageManager`). - A Unix-y shell. Windows works via WSL. ## Getting set up @@ -35,6 +35,7 @@ pnpm + Turbo monorepo. ```bash git clone https://github.com/1weiho/open-slide.git cd open-slide +corepack enable pnpm install ``` diff --git a/README.md b/README.md index 78ee2fefc..21099b934 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,10 @@ This repo is a pnpm + Turbo monorepo. ## Development +Requires **Node.js 24** (see `.nvmrc`) and **pnpm** via Corepack. Published packages support Node.js `>=22.13.0`. + ```bash +corepack enable pnpm install pnpm dev # runs the demo against the local @open-slide/core pnpm build # builds all packages diff --git a/package.json b/package.json index 1018839aa..d4d827dd5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,10 @@ "name": "open-slide-monorepo", "private": true, "version": "0.0.0", - "packageManager": "pnpm@10.17.0", + "packageManager": "pnpm@11.13.1", + "engines": { + "node": ">=22.13.0" + }, "scripts": { "dev": "turbo run dev", "dev:web": "turbo run dev --filter=web", diff --git a/packages/cli/package.json b/packages/cli/package.json index 9ca5db9e2..3bea30efd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -18,7 +18,7 @@ "prepack": "pnpm build" }, "engines": { - "node": ">=18" + "node": ">=22.13.0" }, "keywords": [ "slides", diff --git a/packages/core/package.json b/packages/core/package.json index 9588078bf..2f407b009 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -39,7 +39,7 @@ "prepack": "pnpm build" }, "engines": { - "node": ">=18" + "node": ">=22.13.0" }, "keywords": [ "slides", diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 84666608d..ad940b7f5 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,3 +2,10 @@ packages: - "apps/*" - "packages/*" - "packages/core/e2e/fixture" +allowBuilds: + core-js: true + esbuild: true + msw: true + protobufjs: true + rolldown: true + sharp: true From 38921645f17278b1303dfb9c62792ca0d9f40012 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 16 Jul 2026 02:35:51 +0000 Subject: [PATCH 2/4] ci: upgrade Corepack before pnpm on Node 22.13 and run CI for all PRs Node 22.13 ships an outdated Corepack that fails pnpm signature verification ("Cannot find matching keyid"), leaving STORE_PATH empty and breaking cache. Also run pull_request CI for stacked branches, not only PRs targeting main. Co-authored-by: Davy --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9360e8fc6..21c4dad72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,11 +27,20 @@ jobs: registry-url: "https://registry.npmjs.org" - name: Enable Corepack - run: corepack enable + run: | + npm install -g corepack@latest + corepack enable + corepack prepare --activate - name: Get pnpm store directory shell: bash - run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV" + run: | + STORE_PATH="$(pnpm store path --silent)" + if [ -z "$STORE_PATH" ]; then + echo "pnpm store path was empty" >&2 + exit 1 + fi + echo "STORE_PATH=$STORE_PATH" >> "$GITHUB_ENV" - name: Cache pnpm store uses: actions/cache@v4 From 816b3fa1b1497fba73c08cd352c5867b0eb90d33 Mon Sep 17 00:00:00 2001 From: David Weng Date: Wed, 15 Jul 2026 22:42:38 -0700 Subject: [PATCH 3/4] docs: use exact pinned pnpm version in CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e04bd6798..7866c54f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ pnpm + Turbo monorepo. ## Prerequisites - **Node.js 24** for local development and release (see `.nvmrc` / `.node-version`). Published packages support **Node.js `>=22.13.0`**; CI covers both 22.13+ and 24. -- **pnpm 11.13.1+** via Corepack — `corepack enable` activates the version pinned in `package.json` (`packageManager`). +- **pnpm 11.13.1** via Corepack — `corepack enable` activates the version pinned in `package.json` (`packageManager`). - A Unix-y shell. Windows works via WSL. ## Getting set up From e13af6f1ea1f44ee549faf690d8bb9752414aa11 Mon Sep 17 00:00:00 2001 From: Davy <95214375+thedavidweng@users.noreply.github.com> Date: Sat, 25 Jul 2026 23:35:32 -0700 Subject: [PATCH 4/4] ci: add top-level permissions block and pin corepack version per CodeRabbit --- .github/workflows/ci.yml | 3 +++ .github/workflows/release.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d80d6d29c..56c344d98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: branches: [main] pull_request: +permissions: + contents: read + concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21c4dad72..12c52edad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: - name: Enable Corepack run: | - npm install -g corepack@latest + npm install -g corepack@0.30.0 corepack enable corepack prepare --activate