Repository navigation
Add the node module: Node, npm/pnpm/Yarn, a frozen install and its cache - #54
Open
ndbroadbent wants to merge 2 commits into
Open
ndbroadbent wants to merge 2 commits into
ndbroadbent wants to merge 2 commits into
Conversation
ndbroadbent
force-pushed
the
modules/node
branch
from
December 4, 2026 03:58
1026690 to
2806066
Compare
`modules: [node]` installs the Node the project pins and its package manager, runs a frozen install and caches the package manager's downloads, on GitHub Actions and CircleCI. - Node's version: .nvmrc or .node-version in `path`, else at the root, else package.json's engines.node, else `version:` (or `preinstalled`). On CircleCI the job's image must be a node/cimg/node image matching the pinned version. - Package manager: package.json's packageManager, else the one lockfile present. pnpm and Yarn go through pnpm/action-setup or Corepack. - Install: npm ci, pnpm install --frozen-lockfile, yarn install --immutable (Berry) or --frozen-lockfile (Classic). - Cache: setup-node's cache keyed on the lockfile on GitHub; restore_cache/save_cache keyed on the lockfile's checksum on CircleCI. - Inputs: package.json files, lockfiles, pnpm-workspace.yaml, .npmrc, Yarn config and patches, and the version file. Tests: unit tests for detection, expansion and every mistake; a golden fixture for both providers; mockci scenarios that a skipped job installs nothing and that each contributed input and the parameters rerun it.
…h; always install the pinned Corepack; set pnpm 11's store dir
ndbroadbent
force-pushed
the
modules/node
branch
from
December 4, 2026 04:05
2806066 to
9fa607a
Compare
This branch has not been deployed
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.
The
nodemodule (modules design, #10). It's based on main, not onnarrow_inputs(#26).What it does
modules: [node](or- node: { path: web }) adds:.nvmrcor.node-versioninpath, then at the root, thenengines.nodein the package'spackage.json, thenversion:.version: preinstalleduses the image's or runner's Node. On GitHub this isactions/setup-node, pinned to a commit. On CircleCI, Node comes from the job's image, which must be anodeorcimg/nodeimage matching the pinned version; a mismatch, or a range, is an error with a fix.packageManagerfrompackage.json, else the one lockfile present (two lockfiles is an error that names both). pnpm usespnpm/action-setupon GitHub; Yarn, and pnpm on CircleCI, go through Corepack. Corepack is installed first when the Node doesn't bundle it (Node 25+).npm ci,pnpm install --frozen-lockfile,yarn install --immutable(Berry) or--frozen-lockfile(Classic), inpath.cache-dependency-path. On CircleCI it'srestore_cache/save_cachekeyednode-v1-{{ arch }}-<pm>-{{ checksum "<lockfile>" }}, with a fixed pnpm store.path: everypackage.json, the lockfiles,pnpm-workspace.yaml,.npmrc, Yarn's config, releases and patches,patches/, and the version file it found.Mistakes fail when the config loads, each with a fix: no
package.json, nothing pinning Node, two version files, a version file plusversion:, pnpm or Yarn without apackageManagerversion, a missing lockfile, Bun (not supported yet).src/modules/steps.rsholds step helpers that modules share. Modules get aContext(root and image) so they can check the image.Tests
src/modules/node/tests.rs): pnpm, npm and Yarn on both providers, Yarn Classic vs Berry, the CircleCI image check, engines.node (a range on GitHub, a number on CircleCI, a version file winning), every mistake, and the inputs in a sub-path.integration_tests/module_node/) for both providers.tests/module_node.rs):.npmrc,pnpm-workspace.yaml, a workspace package'spackage.json,patches/, the root.nvmrc, a package-level.node-version,engines.node, or the module's parameters.task cipasses with no warnings.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.