diff --git a/.changeset/plugin-kit-node-engines.md b/.changeset/plugin-kit-node-engines.md new file mode 100644 index 0000000000..5c30bdc338 --- /dev/null +++ b/.changeset/plugin-kit-node-engines.md @@ -0,0 +1,5 @@ +--- +'@sanity/plugin-kit': patch +--- + +Narrow `engines.node` from `>=24` to `^24.11.0 || >=26.0.0`, the Node.js 24+ versions that `@sanity/pkg-utils` 13 supports diff --git a/AGENTS.md b/AGENTS.md index 5b427d6c68..b1eff31a23 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -690,7 +690,7 @@ Tests run against the dedicated bare-bones `dev/e2e-studio` (workspaces `/chromi ### Node.js version notes -`dev/test-studio` declares `engines.node: "24"`; the monorepo otherwise targets latest LTS. Node 24 is preferred when available, and **Node >= 22.18 is required for a full `pnpm build`**: the `@repo/generators` build runs `tsdown`, which loads its `.mts` config through Node's native TypeScript support. On older Node 22.x (e.g. the `v22.14.0` that may be the VM default) that build fails with `Failed to import module "unrun"`. **`pnpm format` and `pnpm lint` also require Node >= 22.18** (oxfmt and oxlint load the TypeScript `oxfmt.config.ts` / `oxlint.config.ts` through the same mechanism). A new enough runtime is usually available via `nvm` (e.g. `export PATH="$HOME/.nvm/versions/node/v22.22.2/bin:$PATH"`). `pnpm test` works on older Node 22 too. +`dev/test-studio` declares `engines.node: "24"`; the monorepo otherwise targets latest LTS. Node 24 is preferred when available, and **Node >= 22.18 is required for a full `pnpm build`**: the `@repo/generators` build runs `tsdown`, which loads its `.mts` config through Node's native TypeScript support. tsdown 0.23, `@sanity/tsdown-config` and `@sanity/pkg-utils` 13 support Node `^22.18.0 || ^24.11.0 || >=26.0.0`, so Node 25 is not supported for builds. On older Node 22.x (e.g. the `v22.14.0` that may be the VM default) that build fails with `Failed to import module "unrun"`. **`pnpm format` and `pnpm lint` also require Node >= 22.18** (oxfmt and oxlint load the TypeScript `oxfmt.config.ts` / `oxlint.config.ts` through the same mechanism). A new enough runtime is usually available via `nvm` (e.g. `export PATH="$HOME/.nvm/versions/node/v22.22.2/bin:$PATH"`). `pnpm test` works on older Node 22 too. ### Lint / build / test diff --git a/packages/@sanity/plugin-kit/README.md b/packages/@sanity/plugin-kit/README.md index c3d77ed3cc..db9fd7afb5 100644 --- a/packages/@sanity/plugin-kit/README.md +++ b/packages/@sanity/plugin-kit/README.md @@ -38,8 +38,10 @@ Check the [FAQ](#faq) fro more on these. > npm install --save-dev @sanity/plugin-kit -Running the plugin-kit CLI requires Node.js 24 or newer. Plugins scaffolded by plugin-kit are not -affected by this requirement: they declare the wider Node.js range shared with `@sanity/pkg-utils`. +Running the plugin-kit CLI requires Node.js `^24.11.0 || >=26.0.0`, the Node.js 24+ versions its +build peer `@sanity/pkg-utils` runs on. Plugins scaffolded by plugin-kit are not affected by this +requirement: their `engines.node` (`>=20.19 <22 || >=22.12`, as in the package template of +`@sanity/pkg-utils`) describes where the published plugin runs, not the Node.js that builds it. ### Install build tool diff --git a/packages/@sanity/plugin-kit/package.json b/packages/@sanity/plugin-kit/package.json index 489edbee36..f900827ddf 100644 --- a/packages/@sanity/plugin-kit/package.json +++ b/packages/@sanity/plugin-kit/package.json @@ -105,7 +105,7 @@ } }, "engines": { - "node": ">=24" + "node": "^24.11.0 || >=26.0.0" }, "binname": "plugin-kit" }