Migrate from yarn to npm and fix undici advisories - #47
Merged
Conversation
Replace `yarn.lock` with `package-lock.json` and update the workflows and README to use npm. Dependency caching is now handled by `actions/setup-node` through `cache: npm`. npm's stricter peer dependency resolution surfaced two pre-existing issues that yarn silently ignored: - `eslint-config-uphold@^6.5.2` now resolves to 6.13.0, which requires `eslint@~9.39.2`. The previous lockfile pinned 6.5.2 together with `eslint@9.28.0`, a pair that was consistent when it was written but has drifted since. - That same version moved `eslint-plugin-mocha` from a dependency to an optional peer dependency, yet still imports it unconditionally, so it now has to be installed explicitly or linting fails to load.
There was a problem hiding this comment.
Pull request overview
This PR migrates the repository’s tooling/CI from Yarn to npm and updates tooling dependencies to address undici security advisories pulled in via release-it.
Changes:
- Replace Yarn-based installs/commands with
npm ci/npm run …and enable npm caching in GitHub Actions. - Add/adjust dev tooling dependencies (notably
release-it@21,eslint@9.39.2, andeslint-plugin-mocha) to resolve npm’s peer dependency requirements and fixundiciadvisories. - Update README usage snippets to reflect npm commands and remove the Yarn lockfile in favor of
package-lock.json.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Removed Yarn lockfile as part of migration to npm. |
| package-lock.json | New npm lockfile; confirms release-it@21 pulls undici@7.29.0. |
| package.json | Updates devDependencies and raises Node engine requirement for the project. |
| README.md | Updates install/test commands to npm equivalents. |
| .github/workflows/tests.yaml | Switches CI installs and script invocations from Yarn to npm; drops Node 20 from matrix. |
| .github/workflows/release.yaml | Switches release workflow installs and script invocations from Yarn to npm; enables npm cache. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Fixes two high severity `undici` advisories pulled in transitively by `release-it@19`, which depends on `undici@6.23.0`. Version 21 is the first release to depend on `undici@7.29.0`, where they are resolved. `release-it@21` requires Node `^22.21.0 || >=24.0.0`, so support for Node 20 is dropped and `engines` is set to `>=22.21.0` to match the actual requirement. This is a breaking change for consumers and warrants a major version bump on the next release.
ricardobcl
force-pushed
the
support/migrate-to-npm
branch
from
August 11, 2026 18:28
c1d3006 to
1470cdb
Compare
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.
Description
Migrates the project from yarn to npm and fixes the two high severity
undiciadvisories reported bynpm audit.The work is split into two commits:
Migrate from yarn to npm— replacesyarn.lockwithpackage-lock.json, switches both workflows tonpm ci/npm run <script>, and updates the README. Dependency caching is now handled byactions/setup-nodethroughcache: npm.npm's stricter peer dependency resolution surfaced two pre-existing issues that yarn silently ignored, both of which had to be fixed for
npm installto resolve at all:eslint~9.28.0→~9.39.2.eslint-config-uphold@^6.5.2now resolves to 6.13.0, which requireseslint@~9.39.2. The old lockfile pinned config 6.5.2 witheslint@9.28.0, a pair that was consistent when written but has drifted since.eslint-plugin-mocha@^11.3.0. That same config version moved it from a dependency to an optional peer dependency, so npm no longer installs it, yet the config still imports it unconditionally — linting failed withERR_MODULE_NOT_FOUNDuntil it was added explicitly. The other optional peers (jest, vitest, typescript-eslint) are loaded lazily and degrade gracefully, so they are not needed.Update release-it@21.0.2—release-it@19depends onundici@6.23.0, which carries the advisories. Version 21 is the first release to depend onundici@7.29.0, where they are resolved (v20 ships 7.28.0, which is still flagged).release-it@21requires Node^22.21.0 || >=24.0.0, so Node 20 is dropped fromenginesand from the test matrix.Related issues
N/A
Impacted areas
Build tooling and CI only. No changes to
srcortypes, so the published package contents are unchanged.Steps to reproduce or test
Development
Verified from a clean checkout of the branch:
Also confirmed
.release-it.jsstill parses underrelease-it@21—npx release-it --release-versionloads the config and proceeds to the expected "working dir must be clean" check.QA
N/A — no runtime behaviour changes.
Checklist
Breaking Changeif it applies.package.json.Deploy notes
Dropping Node 20 from
enginesis a breaking change for consumers, so the next release should be a major bump (3.0.0) rather than a patch. The release workflow takes the bump type as a manual input, so this needs to be selected explicitly.