Skip to content

chore: migrate impit-node to pnpm and enable minimum release age#436

Open
B4nan wants to merge 13 commits intomasterfrom
chore/migrate-to-pnpm
Open

chore: migrate impit-node to pnpm and enable minimum release age#436
B4nan wants to merge 13 commits intomasterfrom
chore/migrate-to-pnpm

Conversation

@B4nan
Copy link
Copy Markdown
Member

@B4nan B4nan commented Apr 14, 2026

Summary

Migrate the impit-node/ Node/TypeScript subpackage from Yarn 4 to pnpm 10.24.0 as part of the org-wide supply-chain hardening rollout (aligning with apify/got-scraping#175 and apify/actor-scraper#273). The Rust workspace (impit/) and impit-python/ are untouched.

A 24 h minimumReleaseAge is enforced via pnpm-workspace.yaml and Renovate, with @apify/* and @crawlee/* excluded so first-party packages flow through immediately.

Changes

  • impit-node/package.json: packageManager -> [email protected]; scripts rewritten so npm run build:debug becomes pnpm build:debug. engines.node was already >= 20 so no change needed.
  • impit-node/pnpm-workspace.yaml (new): minimumReleaseAge: 1440 with @apify/*, @crawlee/* in the exclude list.
  • impit-node/.npmrc (new): node-linker=hoisted, link-workspace-packages=true, prefer-workspace-packages=true, public-hoist-pattern[]=* - needed so napi-rs, typedoc, and friends can resolve transitive deps without the Yarn PnP / flat layout they implicitly rely on.
  • Deleted: impit-node/yarn.lock, impit-node/.yarnrc.yml. There was no .yarn/patches/ directory to preserve.
  • Added: impit-node/pnpm-lock.yaml (generated by pnpm install).
  • .github/actions/pnpm-install/action.yml (new): composite action copied verbatim from apify/got-scraping for consistency. The impit workflows don't end up using it (see below) but it's in place for future reuse.
  • .github/workflows/node-test.yaml: removed cache: yarn, corepack enable, yarn global add pnpm lerna; replaced yarn --cwd impit-node X with pnpm X (build job already sets defaults.run.working-directory: impit-node); inlined the pnpm setup (pnpm/[email protected] + pnpm install --frozen-lockfile) rather than using the composite because each job interleaves Rust toolchain setup, dtolnay/rust-toolchain, cargo caching, and Docker-based musl builds - approach (a) from the migration guide is cleaner here. Node test matrix is now [18, 20, 22, 24] (was [20, 22]). Docker-based musl/aarch64 test shells install pnpm via npm install -g [email protected] before invoking it.
  • .github/workflows/node-release.yaml: same pnpm substitution; yarn version -> npm version --no-git-tag-version + pnpm copy-version; npm publish --provenance -> pnpm publish --no-git-checks --provenance; yarn install --no-immutable lockfile refresh -> pnpm install --lockfile-only; npx semver -> pnpm dlx semver.
  • .github/workflows/docs.yaml: replaced the Yarn setup in the TypeDoc job with pnpm; cd impit-node && yarn docs -> cd impit-node && pnpm docs. Rust and Python docs jobs untouched.
  • renovate.json: added minimumReleaseAge: "1 day" and internalChecksFilter: "strict"; added a package rule bypassing the delay for @apify/* and @crawlee/*; dropped the constraints.npm block which no longer reflects reality under pnpm.

Rust + Node layout notes

  • impit-node/ is one crate in a multi-crate Cargo workspace. cargo metadata and the napi build both run from impit-node/ and reach out to the parent Cargo.toml, so nothing about the pnpm change affects the Rust side.
  • The build job in node-test.yaml uses defaults.run.working-directory: impit-node and the inline pnpm setup honours that. The docker-based musl matrix entries still cd impit-node explicitly because they run from the mounted workspace root (/build).

Verification

  • pnpm install and pnpm install --frozen-lockfile in impit-node/ both succeed with pnpm 10.24.0.
  • pnpm exec napi --version resolves (3.6.1), confirming the napi CLI is reachable through the hoisted layout.
  • pnpm build / pnpm build:debug / pnpm test require the Rust toolchain, which is not available in this environment; they are exercised by CI which already installs dtolnay/rust-toolchain@stable.
  • No lint script exists in impit-node/package.json, so nothing to run there.

🤖 Generated with Claude Code

@github-actions github-actions bot added this to the 138th sprint - Tooling team milestone Apr 14, 2026
@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Apr 14, 2026
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label Apr 14, 2026
@B4nan B4nan marked this pull request as ready for review April 15, 2026 14:02
B4nan and others added 8 commits April 16, 2026 10:13
Migrate the impit-node Node/TypeScript subpackage from Yarn 4 to pnpm
10.24.0 as part of org-wide supply-chain hardening. The Rust workspace
root and impit-python are unaffected.

Changes:
- impit-node/package.json: set packageManager to [email protected]; rewrite
  scripts (npm run -> pnpm) so they work outside Yarn.
- impit-node/pnpm-workspace.yaml: 24h minimumReleaseAge with @apify/* and
  @crawlee/* excluded.
- impit-node/.npmrc: hoisted node-linker + public-hoist-pattern to keep
  napi-rs / TypeDoc happy with a flat-ish layout.
- Delete impit-node/yarn.lock and impit-node/.yarnrc.yml; add
  impit-node/pnpm-lock.yaml. (No .yarn/patches existed.)
- .github/actions/pnpm-install/action.yml: shared composite action
  (copied from apify/got-scraping) for potential reuse.
- .github/workflows/node-test.yaml, node-release.yaml, docs.yaml:
  drop corepack enable / cache: yarn; replace yarn with pnpm across the
  build matrix, release pipeline and typedoc job. Node test matrix is
  now [18, 20, 22, 24]. npm publish becomes pnpm publish --no-git-checks.
  The build jobs keep defaults.run.working-directory: impit-node and use
  inline pnpm setup (Rust + Node in sequence makes approach (a) cleaner
  than the composite action).
- renovate.json: add minimumReleaseAge "1 day" and internalChecksFilter
  "strict"; add @apify/*, @crawlee/* bypass rule; drop the npm
  constraints block that is no longer meaningful.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Repo root has no package.json, so pnpm/action-setup can't infer the
version from packageManager. Pin to 10.24.0 explicitly (matches
impit-node/package.json).
Replaces the local .github/actions/pnpm-install composite copy
with the shared one from apify/workflows@main. Identical behavior,
less duplication.
Silences npm warnings about unknown options like node-linker; pnpm
reads the same keys from pnpm-workspace.yaml in camelCase form.
Block accidental npm/yarn install — npm 10.5+ and pnpm 10.x both
honor devEngines.packageManager and refuse to run when it doesn't
match.
@B4nan B4nan force-pushed the chore/migrate-to-pnpm branch from 3494ed8 to f7916eb Compare April 16, 2026 08:14
Comment thread .github/workflows/docs.yaml
Replace all pnpm/action-setup + manual install with the shared
composite action. Docker builds keep npm install -g pnpm (can't
use GH actions inside containers). Depends on apify/workflows#269
for the working-directory input.
Copy link
Copy Markdown
Member

@barjin barjin left a comment

Choose a reason for hiding this comment

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

One nit, otherwise ✔️ . Thanks!

Comment thread .github/workflows/node-release.yaml Outdated
B4nan and others added 3 commits April 16, 2026 15:52
Switch deprecated ::set-output syntax to $GITHUB_OUTPUT and use pnpm
instead of npm for version command consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
devEngines.packageManager breaks pnpm commands that delegate to npm
(pnpm version, pnpm pkg set, etc). Use the battle-tested only-allow
approach instead (same as Vite, Vue, Astro).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants