Skip to content

chore: migrate from yarn to npm#8249

Merged
alexander-akait merged 5 commits into
mainfrom
claude/migrate-yarn-to-npm-aJauB
May 19, 2026
Merged

chore: migrate from yarn to npm#8249
alexander-akait merged 5 commits into
mainfrom
claude/migrate-yarn-to-npm-aJauB

Conversation

@alexander-akait
Copy link
Copy Markdown
Member

  • Replace yarn.lock with package-lock.json
  • Convert resolutions to npm overrides in package.json
  • Drop yarn-deduplicate devDependency and remove it from the prepare script
  • Flip .npmrc to package-lock=true so npm maintains the lockfile
  • Untrack package-lock.json/yarn-error.log in .gitignore
  • Switch CI workflows (testing, deploy) and the webpack-persistent-cache action to npm
  • Update CONTRIBUTING.md to instruct contributors to use npm
  • Update the module-federation example (lerna npmClient, README) to use npm

User-facing webpack documentation in src/content/** still mentions yarn
because webpack itself supports yarn / Yarn PnP for end users.

- Replace yarn.lock with package-lock.json
- Convert `resolutions` to npm `overrides` in package.json
- Drop yarn-deduplicate devDependency and remove it from the `prepare` script
- Flip .npmrc to package-lock=true so npm maintains the lockfile
- Untrack package-lock.json/yarn-error.log in .gitignore
- Switch CI workflows (testing, deploy) and the webpack-persistent-cache action to npm
- Update CONTRIBUTING.md to instruct contributors to use npm
- Update the module-federation example (lerna npmClient, README) to use npm

User-facing webpack documentation in src/content/** still mentions yarn
because webpack itself supports yarn / Yarn PnP for end users.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment May 19, 2026 7:18pm

Request Review

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 19, 2026

CLA Not Signed

Comment thread .npmrc
@@ -1 +1 @@
package-lock=false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think true is the default, so this can be removed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sometimes AI is stupid 😄

Yarn happened to hoist workbox-*@7.4.x to the top of node_modules because
`workbox-window` and `workbox-webpack-plugin` are direct deps; npm's
alphabetical hoist resolution instead picks the older 4.3.1 versions that
arrive via hyperlink → assetgraph → workbox-build@4.3.1. The 4.x API has
no `CacheableResponsePlugin` / `ExpirationPlugin` (they were named
`Plugin`), so src/sw.js fails the import/named lint rule.

- Declare the workbox-* packages src/sw.js consumes as direct
  dependencies at ^7.4.0 so npm hoists v7 alongside workbox-window.
- Drop the now-unnecessary eslint-disable for import/no-extraneous-dependencies.
- Pin eslint-plugin-react-hooks to 7.0.1 via overrides. The yarn.lock on
  main pinned 7.0.1; regenerating the lockfile with the existing
  `^7.0.1` range bumped it to 7.1.1, which introduces the new
  `react-hooks/set-state-in-effect` rule and surfaces unrelated lint
  failures.
…ches

The yarn → npm switch makes the full transitive tree visible to
dependency-review for the first time, surfacing a batch of pre-existing
advisories. The four direct deps that pull them in (hyperlink,
static-site-generator-webpack-plugin, webpack-pwa-manifest, sitemap-static)
are already at their latest published versions, so the only available
levers are npm overrides on the transitive packages with patched
versions.

Pinned via overrides:

- @tootallnate/once ^3.0.1  (was 1.x — GHSA-vpq2-c234-7xj6)
- file-type        ^21.3.1  (was 16.x — GHSA-5v7r-6r5c-r473)
- form-data         ^4.0.4  (was 2.x — GHSA-fjxv-7rqg-78g4)
- minimist          ^1.2.8  (replaces the older sitemap-static-only 1.2.5
                             pin — GHSA-xvch-5gv4-984h)
- nth-check         ^2.0.1  (was 1.x — GHSA-rp65-9cf3-cjxr)
- phin              ^3.7.1  (was 2.x — GHSA-x565-32qp-m3vf)
- qs               ^6.13.0  (was 6.5.x — GHSA-6rw7-vpxm-498p)
- tough-cookie      ^4.1.3  (was 2.5.x — GHSA-72xf-g2v4-qvf3)

Drops `npm audit` from 23 advisories to 8. The remaining 8 all come from
deprecated packages with no upstream patch — `html-minifier`,
`lodash.pick`, `request` — reachable only via `hyperlink` and
`static-site-generator-webpack-plugin`, which would need to be replaced
to address them.
The file-type 21.x patched version is ESM-only and triggers
ERR_PACKAGE_PATH_NOT_EXPORTED when the old CJS @jimp/core does
`require('file-type')`, breaking the webpack-pwa-manifest plugin used in
webpack.ssg.mjs and failing the E2E build step. @jimp/core is the only
consumer of file-type in the tree and pins it to ^16.5.4, so no
overrideable patched version exists.

The GHSA-5v7r-6r5c-r473 advisory remains; closing it would require
upgrading webpack-pwa-manifest to a version using a maintained image
processor.
@alexander-akait alexander-akait merged commit 170dcd7 into main May 19, 2026
8 of 9 checks passed
@alexander-akait alexander-akait deleted the claude/migrate-yarn-to-npm-aJauB branch May 19, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants