Skip to content

chore: replace dependencies with Node 22 built-ins#4681

Merged
escapedcat merged 5 commits into
masterfrom
chore/node22-dep-cleanup
Apr 30, 2026
Merged

chore: replace dependencies with Node 22 built-ins#4681
escapedcat merged 5 commits into
masterfrom
chore/node22-dep-cleanup

Conversation

@escapedcat

@escapedcat escapedcat commented Apr 3, 2026

Copy link
Copy Markdown
Member

Follow-up to #4679 — now that the minimum Node is v22, several
runtime dependencies can be replaced with built-in equivalents.

Replacements

  • globnode:fs.globSync / node:fs/promises.glob (stable in Node 22)
    • @commitlint/config-patternplate
    • @commitlint/config-workspace-scopes
    • @commitlint/ensure (test)
    • @commitlint/rules (test)
  • fast-globnode:fs.globSync
    • @commitlint/config-pnpm-scopes
    • @commitlint/config-lerna-scopes
  • import-meta-resolvenode:module.createRequire().resolve()
    • @commitlint/resolve-extends
  • minimistnode:util.parseArgs()
    • @commitlint/read
  • fs-extranode:fs/promises
    • @commitlint/cli (test)
    • @packages/test (test utility)

Removed from yarn.lock

Direct: glob, fast-glob, import-meta-resolve, minimist, fs-extra
(direct usage). Transitive cleanup: @types/glob, @types/minimatch,
@isaacs/balanced-match, @isaacs/brace-expansion, jackspeak,
lru-cache@^11, minimatch@^10, path-scurry.

Note: fs-extra and a few lodash.* entries remain in yarn.lock as
transitive deps of commitizen and lerna (devDep release tooling) —
those are out of scope for this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up dependencies now that the repo targets Node.js 22+, replacing several third-party utilities with Node built-ins and updating lockfiles accordingly.

Changes:

  • Replaced glob / fast-glob usage with Node’s fs.glob* APIs in configs and tests.
  • Removed fs-extra from test tooling and updated filesystem helpers to use node:fs / node:fs/promises.
  • Removed minimist and switched git arg parsing to node:util.parseArgs; removed import-meta-resolve and updated module resolution logic.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Removes transitive entries made unnecessary by dropping glob, fast-glob, fs-extra, minimist, import-meta-resolve.
@packages/test/src/npm.ts Replaces fs-extra helpers with node:fs/promises equivalents for manifest detection, JSON reading, and directory creation.
@packages/test/src/index.test.ts Switches from fs-extra to node:fs for sync existence checks.
@packages/test/src/fix.ts Replaces fs-extra.copy with fs.cp (recursive).
@packages/test/package.json Removes fs-extra and @types/fs-extra deps.
@commitlint/rules/src/index.test.ts Replaces glob with node:fs globSync and manual filtering logic.
@commitlint/rules/package.json Drops glob devDependency.
@commitlint/resolve-extends/src/index.ts Removes import-meta-resolve and switches to createRequire(...).resolve(...) for resolution.
@commitlint/resolve-extends/package.json Drops import-meta-resolve dependency.
@commitlint/read/src/read.ts Replaces minimist with node:util.parseArgs for gitLogArgs.
@commitlint/read/package.json Removes minimist and @types/minimist.
@commitlint/ensure/src/index.test.ts Replaces glob with node:fs globSync and manual filtering logic.
@commitlint/ensure/package.json Drops glob devDependency.
@commitlint/config-workspace-scopes/package.json Removes glob dependency and related types.
@commitlint/config-workspace-scopes/index.js Replaces glob usage with node:fs globSync.
@commitlint/config-pnpm-scopes/package.json Drops fast-glob dependency.
@commitlint/config-pnpm-scopes/index.ts Replaces fast-glob with node:fs/promises glob iteration.
@commitlint/config-patternplate/package.json Drops glob dependency.
@commitlint/config-patternplate/index.js Replaces glob package usage with node:fs/promises glob iteration.
@commitlint/config-lerna-scopes/package.json Drops fast-glob dependency.
@commitlint/config-lerna-scopes/index.js Replaces fast-glob with node:fs/promises glob iteration.
@commitlint/cli/src/cli.test.ts Replaces fs-extra with node:fs/promises.
@commitlint/cli/package.json Removes fs-extra from devDependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@escapedcat escapedcat force-pushed the chore/node-v22 branch 4 times, most recently from 866e94c to b24c7cd Compare April 30, 2026 08:18
Base automatically changed from chore/node-v22 to master April 30, 2026 08:30
escapedcat and others added 5 commits April 30, 2026 16:36
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@escapedcat escapedcat force-pushed the chore/node22-dep-cleanup branch from 9c07126 to 2799909 Compare April 30, 2026 08:57
@escapedcat escapedcat changed the title chore: node22 dep cleanup chore: replace dependencies with Node 22 built-ins Apr 30, 2026
@escapedcat escapedcat marked this pull request as ready for review April 30, 2026 08:59
@qodo-code-review

Copy link
Copy Markdown
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread @packages/test/src/npm.ts
@escapedcat escapedcat merged commit ac01464 into master Apr 30, 2026
19 checks passed
@escapedcat escapedcat deleted the chore/node22-dep-cleanup branch April 30, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants