Skip to content

Switch from Yarn to npm - #10503

Merged
glen-84 merged 1 commit into
mainfrom
gai/switch-from-yarn-to-npm
Oct 7, 2026
Merged

glen-84 merged 1 commit into
mainfrom
gai/switch-from-yarn-to-npm

Conversation

@glen-84

@glen-84 glen-84 commented Oct 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Every npm root (website/, the Nitro CLI wrapper, and the spec-version test fixture) installs with the npm bundled with Node.js, under one policy in its .npmrc: a 7-day release-age gate, install-strategy=linked, strict-allow-scripts=true, allow-git=none, and allow-remote=none. A devEngines floor of npm >=11.18.0 makes an older npm fail instead of installing without the policy.
  • Yarn, its vendored release, both yarn.lock files, and Corepack are removed from the repository, CI, the release workflow, and the devcontainer. The new lockfiles keep every direct dependency at its yarn.lock version.
  • The website copies the local @chillicream/mocha-visualizer dependency (install-links=true) so its peers resolve from the website, the visualizer's elkjs peer range includes the 0.12 line the website runs, and the website declares unist-util-visit, unified, and vfile, which the linked layout no longer exposes. CI's website job also runs for visualizer-only changes.
  • Install scripts run only for esbuild and unrs-resolver, pinned to their versions, and fsevents is denied. Until npm/cli#10059 ships in npm 11, npm install-scripts approve writes entries npm cannot match under the linked strategy (npm/cli#9939), so AGENTS.md says to add approvals by hand.

After pulling

  • Delete website/.yarn/ and src/Nitro/CommandLine/src/npm/chillicream-nitro/.yarn/, which are no longer ignored.
  • Rebuild the devcontainer without cache, so it picks up a Node.js 24 release that bundles npm 11.18 or newer.

Test plan

  • Website: npm ci, npm run format:check, npm run lint, and npm run build pass (537 static pages, as with Yarn), and npm run test:visual reports the same results as a Yarn run of main.
  • Nitro wrapper: npm ci, npm run build, and npm pack --dry-run produce the same file list and a byte-identical dist/cli.js as the Yarn build.
  • Spec-version tests pass, with the fixture's npm ci running in node:24-alpine (npm 11.19.0) under the new .npmrc.
  • Policy: a git dependency fails with EALLOWGIT, a tarball URL with EALLOWREMOTE, a missing or wrongly pinned script approval with ESTRICTALLOWSCRIPTS, and npm 11.17.0 with EBADDEVENGINES. npm ci --os=darwin and npm ci --os=win32 succeed.
  • The devcontainer image builds with Node.js 24.21.0 and npm 11.19.0, and actionlint reports no new findings in the changed workflows.

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.

Copilot review overview

🔵 Needs a closer look

The broad migration spans dependency policies, workflows, release automation, and development setup, warranting final human review.

Review effort: Lite
Findings: None

What changed in this PR

Migrates the repository’s JavaScript tooling from Yarn to npm across applications, tests, CI, releases, and development environments.

Changes:

  • Replaces Yarn/Corepack configuration, commands, and metadata with npm.
  • Adds npm lockfiles, version requirements, and installation security policies.
  • Updates website dependencies, visualizer compatibility, workflows, and developer documentation.
File Summary
website/​tests/​visual/​storybook.spec.ts Updates the visual-test command reference.
website/​start-optimized.sh Replaces Yarn commands with npm scripts.
website/​src/​helpers/​gitMetadata.ts Updates release command documentation.
website/​README.md Updates website setup instructions.
website/​playwright.config.ts Uses npm-compatible command execution.
website/​package.json Updates npm scripts, dependencies, and policies.
website/​AGENTS.md Updates website workflow guidance.
website/​.yarnrc.yml Removes Yarn configuration.
website/​.prettierignore Removes Yarn exclusions and updates lockfile ignores.
website/​.npmrc Configures npm installation restrictions.
website/​.gitignore Removes Yarn-specific ignores.
src/​Nitro/​CommandLine/​src/​npm/​chillicream-nitro/​yarn.lock Removes the Yarn lockfile.
src/​Nitro/​CommandLine/​src/​npm/​chillicream-nitro/​package.json Adds npm version enforcement.
src/​Nitro/​CommandLine/​src/​npm/​chillicream-nitro/​package-lock.json Adds the npm dependency lockfile.
src/​Nitro/​CommandLine/​src/​npm/​chillicream-nitro/​.yarnrc.yml Removes Yarn configuration.
src/​Nitro/​CommandLine/​src/​npm/​chillicream-nitro/​.npmrc Configures npm installation restrictions.
src/​Nitro/​CommandLine/​src/​npm/​chillicream-nitro/​.gitignore Removes Yarn-specific ignores.
src/​Nitro/​CommandLine/​src/​npm/​chillicream-nitro/​.gitattributes Removes Yarn attributes.
src/​Mocha/​src/​mocha-visualizer/​package.json Expands elkjs peer compatibility.
src/​HotChocolate/​Core/​test/​Types.SpecVersion.Tests/​node/​package.json Adds npm version enforcement.
src/​HotChocolate/​Core/​test/​Types.SpecVersion.Tests/​node/​.npmrc Configures npm installation restrictions.
init.sh Switches repository initialization to npm.
init.ps1 Switches repository initialization to npm.
CONTRIBUTING.md Updates contributor instructions.
AGENTS.md Updates repository workflow guidance.
.github/​workflows/​release.yml Migrates release packaging to npm.
.github/​workflows/​publish-website.yml Migrates website publishing to npm.
.github/​workflows/​ci.yml Migrates CI installation and scripts to npm.
.devcontainer/​dockerfile Removes Corepack/Yarn setup.
.devcontainer/​devcontainer.json Updates the development environment for npm.
Files not reviewed (1)
  • src/Nitro/CommandLine/src/npm/chillicream-nitro/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

✅ Nitro CLI E2E snapshots: no flow recordings changed vs main.

@glen-84
glen-84 merged commit af6c48c into main Oct 7, 2026
161 checks passed
@glen-84
glen-84 deleted the gai/switch-from-yarn-to-npm branch October 7, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants