Repository navigation
chore: require Node >= 22 and pin @types/node to the lowest supported major - #976
Merged
Merged
Conversation
… major Node 18 and 20 are end-of-life. Raise engines.node to >=22.0.0 and keep @types/node on ^22 so TypeScript does not accept Node APIs that are missing in the oldest supported version. Renovate is limited to <23 for @types/node, and CI now also runs on Node 22. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHTz72KwNga2DxvYdbcNUR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHTz72KwNga2DxvYdbcNUR
The library has no Node API usage and also runs in browsers and via JSR, so compile it with "types": [] to make any accidental Node API use a build error. Remove the unused decorator options. Replace rimraf with fs.rmSync in the build script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHTz72KwNga2DxvYdbcNUR
5 tasks done
Use the shared Node 22 base from tsconfig/bases and drop the options it already sets (strict, module, esModuleInterop, skipLibCheck). types, target and lib stay overridden: the library is also used in browsers and must not see Node types. The resolved config and the emitted declarations are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHTz72KwNga2DxvYdbcNUR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Node 18 and 20 are end-of-life. This raises the minimum supported Node version to 22 and keeps
@types/nodeon the same major, so TypeScript rejects Node APIs that don't exist in the oldest version we support.engines.node:^18.18.0 || >=20.0.0→>=22.0.0@types/node:^25.9.9→^22.20.5(lockfile regenerated withnpm install).github/renovate.json: new ruleallowedVersions: "<23"for@types/node, so Renovate only proposes minor/patch updates inside 22nodejs.yml: add22to the test matrix alongsidelts/*andlatest, so CI covers the minimum versionpublish.yml: build and publish on Node 26tsconfig.json:@tsconfig/node22and drops the options the base already sets (strict,module,esModuleInterop,skipLibCheck)types,targetandlibstay overridden. With"types": [], using a Node API insrcby mistake is a build error, because the library also runs in browsers and via JSR. Target/lib are handled in chore: lint for browser compatibility and modernise string handling #977.experimentalDecorators/emitDecoratorMetadataoptions are removedpinefile.ts: replacerimrafwithfs.rmSync, and drop therimrafdev dependencyDropping Node 18/20 is a breaking change, so the next release should be a major. The version in
package.jsonis unchanged here.Supersedes #975: its workflow bump is included here, and the new Renovate rule blocks its
@types/node26 bump.Test plan
npm run lintnpm run build, withdist/byte-identical before and after the@tsconfig/node22changenpm testagainstsrc,dist/cjsanddist/esm(33/33 each) on Node 22.22Bufferreference insrc/now failstsc🤖 Generated with Claude Code
https://claude.ai/code/session_01DHTz72KwNga2DxvYdbcNUR