Skip to content

chore: migrate to pnpm and enable minimum release age#616

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

chore: migrate to pnpm and enable minimum release age#616
B4nan wants to merge 15 commits intomasterfrom
chore/migrate-to-pnpm

Conversation

@B4nan
Copy link
Copy Markdown
Member

@B4nan B4nan commented Apr 14, 2026

Summary

Pilot of the org-wide supply-chain hardening + pnpm migration plan (first of ~14 repos). This PR migrates apify-shared-js from npm workspaces to pnpm workspaces and adds a 1-day minimum release age guard at two layers so newly-published package versions cannot be installed for 24h after they hit the registry.

  • pnpm layerminimumReleaseAge: 1440 in pnpm-workspace.yaml blocks pnpm install on versions < 1 day old
  • Renovate layerminimumReleaseAge: "1 day" delays PR creation until the version has aged
  • Internal allowlist@apify/* and @crawlee/* are excluded at both layers so internal releases ship immediately

Changes

  • package.json: drop "workspaces" (moved to pnpm-workspace.yaml); set packageManager to [email protected]; add rimraf as explicit devDep (was previously relying on npm transitive hoisting — pnpm's hoisted linker does not link undeclared transitive bins)
  • lerna.json: npmClient: "pnpm" so lerna run ... invokes pnpm
  • .npmrc: node-linker=hoisted — keeps flat node_modules for the same debugging ergonomics as npm
  • packages/*/package.json scripts: npm run Xpnpm X
  • CI workflows: new .github/actions/pnpm-install composite with pnpm-store caching (keyed by year-month + lockfile hash); workflows delegate install to uses: ./.github/actions/pnpm-install. Node matrix: drop 16 (pnpm 10 needs Node ≥ 18), add 24 to cover current LTS
  • renovate.json: minimumReleaseAge: "1 day", internalChecksFilter: "strict", whitelist packageRule for @apify/* and @crawlee/*; drop old npm constraint
  • CONTRIBUTING.md + CLAUDE.md: updated command examples

Opened as draft — pilot for the remaining ~13 repos in the same migration.

🤖 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 force-pushed the chore/migrate-to-pnpm branch from a71dcdd to ea34945 Compare April 14, 2026 12:45
@B4nan B4nan force-pushed the chore/migrate-to-pnpm branch from ea34945 to a74838e Compare April 15, 2026 12:20
@B4nan B4nan marked this pull request as ready for review April 15, 2026 13:41
B4nan and others added 9 commits April 15, 2026 17:55
Migrates from npm workspaces to pnpm workspaces and adds a 1-day
minimum release age supply-chain guard at the package-manager layer
(pnpm-workspace.yaml) and at the Renovate layer. Internal
`@apify/*` and `@crawlee/*` packages are whitelisted at both layers
for immediate updates.

Notable changes:
- package.json: drop "workspaces" (moved to pnpm-workspace.yaml);
  set packageManager to [email protected]; add rimraf as explicit devDep
  (was previously relying on npm transitive hoisting)
- lerna.json: npmClient: "pnpm"
- .npmrc: node-linker=hoisted (flat node_modules layout)
- packages/*/package.json scripts: "npm run X" -> "pnpm X"
- CI workflows: add pnpm/action-setup, use pnpm install --frozen-lockfile
  and pnpm/pnpm exec in place of npm/npx; drop Node 16 from matrix
  (pnpm 10 requires Node 18+)
- renovate.json: minimumReleaseAge "1 day", internalChecksFilter
  "strict", @apify/* and @crawlee/* whitelist; drop npm constraint
- Docs: CONTRIBUTING.md and CLAUDE.md updated for pnpm commands

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Adopts the caching pattern from apify/apify-cli#1068: a reusable
composite action at .github/actions/pnpm-install that handles pnpm
setup, pnpm store caching (keyed by year-month + lockfile hash),
and the install. Workflows now delegate their install step to
`uses: ./.github/actions/pnpm-install` instead of inlining each
piece. setup-node remains in workflows (without the cache: pnpm
parameter, since caching is handled inside the composite).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replaces the local .github/actions/pnpm-install composite copy
with the shared one from apify/workflows@main. Identical behavior,
less duplication.
@B4nan B4nan force-pushed the chore/migrate-to-pnpm branch from cd33001 to d1ec78b Compare April 15, 2026 15:55
B4nan and others added 6 commits April 15, 2026 18:16
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.
…-workspace exclusions

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.

2 participants