Skip to content

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

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

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

Conversation

@B4nan
Copy link
Copy Markdown
Member

@B4nan B4nan commented Apr 14, 2026

Summary

Part of the org-wide supply-chain hardening + pnpm migration. Migrates actor-scraper from npm workspaces to pnpm and adds a 1-day minimum release age guard at two layers:

  • pnpm layerminimumReleaseAge: 1440 in pnpm-workspace.yaml blocks installs of versions < 1 day old
  • Renovate layerminimumReleaseAge: "1 day" delays PR creation
  • Internal allowlist@apify/* and @crawlee/* excluded at both layers so internal releases ship immediately

Changes

  • package.json: drop workspaces; set packageManager to pnpm@10.24.0; add @isaacs/brace-expansion as root devDep (pnpm 10 misses this transitive for minimatch@10 which sitemap-scraper pulls in)
  • lerna.json: npmClient: "pnpm"
  • .npmrc: node-linker=hoisted + link-workspace-packages=true + prefer-workspace-packages=true
  • packages/actor-scraper/*/package.json: @apify/scraper-toolsworkspace:* so pnpm links the local copy instead of fetching the identical version from npm (consistent peer-dep resolution)
  • packages/scraper-tools/src/browser_tools.ts: relax Page.exposeFunction return to Promise<unknown> so it accepts both Puppeteer (Promise<void>) and newer Playwright (Promise<Disposable>) page types. Return value was already discarded at all call sites.
  • New .github/actions/pnpm-install composite action (cached pnpm store, keyed by year-month + lockfile hash — pattern from chore: move to pnpm from yarn apify-cli#1068)
  • CI workflows: install via composite; drop npm cache on setup-node
  • renovate.json: minimumReleaseAge "1 day", internalChecksFilter "strict", @apify/* + @crawlee/* whitelist

🤖 Generated with Claude Code

B4nan and others added 2 commits April 15, 2026 14:21
Migrates actor-scraper 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 pnpm@10.24.0; add @isaacs/brace-expansion
  as explicit root devDep (pnpm 10 doesn't pull it transitively
  for minimatch@10 which actor-scraper-sitemap depends on)
- lerna.json: npmClient: "pnpm"
- .npmrc: node-linker=hoisted + link-workspace-packages=true +
  prefer-workspace-packages=true (flat layout for debugging +
  prefer workspace packages over registry)
- packages/actor-scraper/*/package.json: use "workspace:*" protocol
  for @apify/scraper-tools so pnpm links the workspace copy instead
  of fetching the identical version from npm (required for consistent
  peer-dep resolution across workspace and registry types)
- packages/scraper-tools/src/browser_tools.ts: relax Page interface
  exposeFunction return type from Promise<void> to Promise<unknown>
  so it accepts both Puppeteer (Promise<void>) and newer Playwright
  (Promise<Disposable>) page types. Return value is unused.
- New .github/actions/pnpm-install composite action adopts the
  caching pattern from apify/apify-cli#1068 (pnpm store cache
  keyed by year-month + lockfile hash)
- CI workflows: delegate install to the composite; drop the
  separate npm cache config on setup-node
- renovate.json: minimumReleaseAge "1 day", internalChecksFilter
  "strict", @apify/* and @crawlee/* whitelist; drop npm constraint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@B4nan B4nan force-pushed the chore/migrate-to-pnpm branch from c01c1ec to 7828f01 Compare April 15, 2026 12:21
pnpm 10 blocks install scripts by default; these are needed to download
the browser binaries for CI tests.
@B4nan B4nan marked this pull request as ready for review April 15, 2026 13:41
B4nan and others added 7 commits April 15, 2026 15:42
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.
npx invokes npm which now refuses to run because of devEngines.
… with pnpm-workspace exclusions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 / cross-cutting work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants