diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbb5818..186a420 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 with: node-version-file: .node-version + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile - name: Format, lint, typecheck, coverage, compile, pack, scan and audit @@ -33,7 +34,7 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 with: - node-version-file: .node-version + node-version: '24.21.0' - run: corepack enable - run: pnpm install --frozen-lockfile - name: Unit, compatibility and workflow security tests diff --git a/.github/workflows/create-package-release.yml b/.github/workflows/create-package-release.yml index b11023c..ea9df23 100644 --- a/.github/workflows/create-package-release.yml +++ b/.github/workflows/create-package-release.yml @@ -46,6 +46,7 @@ jobs: registry-url: https://npm.pkg.github.com package-manager-cache: false scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile - run: node scripts/create-package-release.mjs diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index e5b1c6c..84af169 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -39,6 +39,7 @@ jobs: registry-url: https://npm.pkg.github.com package-manager-cache: false scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile # PUBLISH-COMMERCEKIT-PREVIEW / PUBLISH-COMMERCEKIT-STABLE validated by release-plan. diff --git a/.github/workflows/reserve-package-names.yml b/.github/workflows/reserve-package-names.yml index 03da275..86e9244 100644 --- a/.github/workflows/reserve-package-names.yml +++ b/.github/workflows/reserve-package-names.yml @@ -27,6 +27,7 @@ jobs: registry-url: https://npm.pkg.github.com package-manager-cache: false scope: '@commercekit-tools' + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile - id: reservation diff --git a/.node-version b/.node-version index df6ae33..a2e8115 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -24.21.0 +26.13.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d1bbe1..c17f5bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Use Node 24.21.0 and pnpm 12.6.0; enable Corepack, then `pnpm install --frozen-lockfile`. +Use Node 26.13.1 and pnpm 12.6.0 for development. Install Corepack with `npm install --global corepack@0.36.0`, enable it, then run `pnpm install --frozen-lockfile`. ```sh pnpm format @@ -23,3 +23,5 @@ Keep all CodeQL sub-actions pinned to the same commit. The dedicated Dependabot Changes to public exports require compatibility/type tests and selected-package changelog notes. Preserve schema v1 semantics and additive compatibility. If changing the canonical schema JSON, regenerate the embedded schema module and verify parity; document a deliberate compatibility decision before any expansion. Update synthetic fixtures and baseline provenance when consumers advance. Never copy a full Action into a harness. Use synthetic values only: no real secrets, subscriptions, customer names or live SAP calls. Keep generated dist, coverage, tarballs, local auth and IDE files out of commits. Inspect staged files and run `git diff --check` before each commit. Publication is a separate manual owner workflow; no automatic publishing or consumer migration belongs in foundation changes. + +Development and package builds use Node 26. The published libraries retain their Node 24 minimum; existing cross-platform tests install and execute the packed libraries on Node 24. Do not introduce Node 26-only runtime APIs in shared packages. diff --git a/README.md b/README.md index 42bc4d9..77be0eb 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,10 @@ Provider rendering and delivery, Action inputs/outputs and summary writes, lifec Installation requires GitHub Packages access, including for public packages. Configure the scope registry and credentials using [the release configuration and authentication guide](docs/github-packages.md). Verify any future version's publication before adopting it; a source manifest alone is not evidence. -Develop with Node **24.21.0** and pnpm **12.6.0**: +Develop with Node **26.13.1** and pnpm **12.6.0**: ```sh +npm install --global corepack@0.36.0 corepack enable pnpm install --frozen-lockfile pnpm quality diff --git a/compatibility/tests/workflows.test.ts b/compatibility/tests/workflows.test.ts index 58e7834..e3d51be 100644 --- a/compatibility/tests/workflows.test.ts +++ b/compatibility/tests/workflows.test.ts @@ -17,6 +17,37 @@ it('CI is read-only and never publishes', () => { expect(Object.keys(ci.on)).toEqual(['pull_request', 'push', 'workflow_dispatch']); expect(JSON.stringify(ci)).not.toMatch(/packages.*write|npm publish/); }); +it('builds on Node 26 and retains installed-package execution on Node 24', () => { + const pin = readFileSync('.node-version', 'utf8').trim(); + expect(pin).toMatch(/^26\.\d+\.\d+$/); + const ci = workflow('ci'); + for (const [name, nodeVersion] of [ + ['quality', { 'node-version-file': '.node-version' }], + ['cross-platform', { 'node-version': '24.21.0' }], + ] as const) { + const steps = ci.jobs[name].steps; + expect( + steps.find((step: { uses?: string }) => step.uses?.startsWith('actions/setup-node@')).with, + ).toEqual(nodeVersion); + const commands = steps.map((step: { run?: string }) => step.run).filter(Boolean); + if (name === 'quality') { + expect(commands).toContain('npm install --global corepack@0.36.0'); + expect(commands.indexOf('npm install --global corepack@0.36.0')).toBeLessThan( + commands.indexOf('corepack enable'), + ); + } else { + expect(commands).not.toContain('npm install --global corepack@0.36.0'); + } + expect(commands).toContain('pnpm install --frozen-lockfile'); + } + expect( + ci.jobs['cross-platform'].steps.some((step: { run?: string }) => step.run === 'pnpm pack:check'), + ).toBe(true); + for (const name of ['notification-contract', 'ccv2-client']) { + const manifest = JSON.parse(readFileSync(`packages/${name}/package.json`, 'utf8')); + expect(manifest.engines.node).toBe('>=24.21.0'); + } +}); it('keeps CodeQL steps on one version and groups their Dependabot updates', () => { const codeqlActions = workflow('codeql') .jobs.analyze.steps.map((step: { uses?: string }) => step.uses) diff --git a/docs/github-packages.md b/docs/github-packages.md index 9935b26..46785a2 100644 --- a/docs/github-packages.md +++ b/docs/github-packages.md @@ -51,6 +51,7 @@ permissions: packages: read steps: # Existing pinned checkout/setup-node steps configure the registry above. + - run: npm install --global corepack@0.36.0 - run: corepack enable - run: pnpm install --frozen-lockfile env: diff --git a/package.json b/package.json index fe7de5c..0ed75d2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "type": "module", "packageManager": "pnpm@12.6.0", "engines": { - "node": ">=24.21.0" + "node": ">=24.21.0 <25 || >=26.13.1 <27" }, "scripts": { "format": "prettier --write .",