Skip to content

Commit cbadbf4

Browse files
B4nanclaude
andauthored
chore: migrate to pnpm and enable minimum release age (#273)
* chore: migrate to pnpm and enable minimum release age 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> * chore: refresh pnpm-lock.yaml after rebase * ci: approve build scripts for puppeteer/playwright/swc/esbuild/camoufox pnpm 10 blocks install scripts by default; these are needed to download the browser binaries for CI tests. * ci: use shared apify/workflows/pnpm-install action Replaces the local .github/actions/pnpm-install composite copy with the shared one from apify/workflows@main. Identical behavior, less duplication. * chore: whitelist internal apify-client/apify/crawlee/got-scraping from release-age gate * chore: move pnpm config from .npmrc to pnpm-workspace.yaml Silences npm warnings about unknown options like node-linker; pnpm reads the same keys from pnpm-workspace.yaml in camelCase form. * chore: enforce pnpm via devEngines, switch husky hook to pnpm exec npx invokes npm which now refuses to run because of devEngines. * chore: normalize .gitignore — add yarn.lock and .yarn, drop .pnpm-store * chore: remove stale .prettierignore entry and sync renovate allowlist with pnpm-workspace exclusions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: replace devEngines with only-allow preinstall 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). --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4e0a8bd commit cbadbf4

20 files changed

Lines changed: 11887 additions & 19552 deletions

File tree

.github/workflows/on-pull-request.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@ jobs:
2222
uses: actions/setup-node@v6
2323
with:
2424
node-version: 24
25-
cache: 'npm'
26-
cache-dependency-path: 'package-lock.json'
2725

28-
- name: Install Dependencies
29-
run: |
30-
npm ci
26+
- name: Install pnpm and dependencies
27+
uses: apify/workflows/pnpm-install@main
3128

3229
- name: Build
33-
run: npm run ci:build
30+
run: pnpm ci:build
3431

3532
- name: Tests
36-
run: npm test
33+
run: pnpm test
3734

3835
lint:
3936
name: Lint
@@ -46,14 +43,12 @@ jobs:
4643
uses: actions/setup-node@v6
4744
with:
4845
node-version: 24
49-
cache: 'npm'
50-
cache-dependency-path: 'package-lock.json'
5146

52-
- name: Install Dependencies
53-
run: npm ci
47+
- name: Install pnpm and dependencies
48+
uses: apify/workflows/pnpm-install@main
5449

5550
- name: ESLint
56-
run: npm run lint
51+
run: pnpm lint
5752

5853
- name: Prettier
59-
run: npm run format:check
54+
run: pnpm format:check

.github/workflows/test-e2e.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
- cron: '0 2 * * *'
1111

1212
jobs:
13-
# NPM install is done in a separate job and cached to speed up the following jobs.
1413
build_and_test:
1514
name: Build & Test
1615
runs-on: ubuntu-22.04
@@ -28,8 +27,6 @@ jobs:
2827
uses: actions/setup-node@v6
2928
with:
3029
node-version: 24
31-
cache: 'npm'
32-
cache-dependency-path: 'package-lock.json'
3330

3431
- name: Turbo cache
3532
id: turbo-cache
@@ -40,13 +37,13 @@ jobs:
4037
restore-keys: |
4138
turbo-${{ github.job }}-${{ github.ref_name }}-
4239
43-
- name: Install Dependencies
44-
run: npm ci
40+
- name: Install pnpm and dependencies
41+
uses: apify/workflows/pnpm-install@main
4542

4643
- name: Build
47-
run: npm run ci:build
44+
run: pnpm ci:build
4845

4946
- name: Test
50-
run: npm run test:e2e
47+
run: pnpm test:e2e
5148
env:
5249
APIFY_TOKEN: ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pids
1717
.idea
1818
.vscode
1919
yarn.lock
20+
.yarn
2021
tmp
2122
jsconfig.json
2223
types

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx lint-staged
1+
pnpm exec lint-staged

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
.husky/pre-commit
22
.prettierignore
3+
4+
# pnpm
5+
pnpm-lock.yaml
6+
pnpm-workspace.yaml

lerna.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
}
1313
},
1414
"useNx": false,
15+
"npmClient": "pnpm",
1516
"ignoreChanges": ["**/test/**", "**/*.md"]
1617
}

0 commit comments

Comments
 (0)