You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: migrate to pnpm and enable minimum release age (#616)
## 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 layer** — `minimumReleaseAge: 1440` in `pnpm-workspace.yaml`
blocks `pnpm install` on versions < 1 day old
- **Renovate layer** — `minimumReleaseAge: "1 day"` delays PR creation
until the version has aged
- **Internal allowlist** — `@apify/*` and `@crawlee/*` (plus `apify`,
`apify-client`, `crawlee`, `got-scraping`) are excluded at both layers
so internal releases ship immediately
## Changes
- `package.json`: drop `"workspaces"` (moved to `pnpm-workspace.yaml`);
set `packageManager` to `pnpm@10.24.0`; add `rimraf` as explicit devDep
(was previously relying on npm transitive hoisting — pnpm's hoisted
linker does not link undeclared transitive bins); replace `devEngines`
with `npx only-allow pnpm` preinstall hook
- `lerna.json`: `npmClient: "pnpm"` so `lerna run ...` invokes pnpm
- `pnpm-workspace.yaml`: pnpm config moved here from `.npmrc`;
`node-linker=hoisted` keeps a flat `node_modules` for the same debugging
ergonomics as npm
- `packages/*/package.json` scripts: `npm run X` → `pnpm X`
- CI workflows: use the shared `apify/workflows/pnpm-install` composite
(with pnpm-store caching). Node test matrix dropped to **[20, 22, 24]**
— Node 16 is dropped because pnpm 10 needs ≥18, and Node 18 is dropped
because the test runner was bumped to **vitest 4**, which declares
`engines.node: ^20 || ^22 || >=24`. `engines.node` in the published
packages is unchanged (no major bumps)
- `release` workflow: `pull: '--rebase --autostash'` on the bot push
step to avoid non-fast-forward rejection if another commit lands while
CI is running
- `renovate.json`: `minimumReleaseAge: "1 day"`, `internalChecksFilter:
"strict"`, internal allowlist; drop old npm constraint
- `CONTRIBUTING.md` + `CLAUDE.md`: updated command examples
Pilot for the remaining ~13 repos in the same migration.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,20 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Overview
6
6
7
-
Internal Apify monorepo of shared TypeScript utilities and constants published as `@apify/*` packages on npm. Managed with Lerna (independent versioning) and npm workspaces.
7
+
Internal Apify monorepo of shared TypeScript utilities and constants published as `@apify/*` packages on npm. Managed with Lerna (independent versioning) and pnpm workspaces.
8
8
9
9
## Commands
10
10
11
11
```bash
12
-
npm install # Install all dependencies
13
-
npm run build # Build all packages (lerna run build)
14
-
npmtest# Run all tests (vitest)
15
-
npm run test-cov # Run tests with coverage
16
-
npx vitest run test/consts.test.ts # Run a single test file
17
-
npx vitest run test/consts.test.ts -t "pattern"# Run specific test by name
18
-
npm run lint # Lint all source and test files
19
-
npm run lint:fix # Lint with auto-fix
20
-
npm run clean # Clean all dist/ folders
12
+
pnpm install # Install all dependencies
13
+
pnpm build# Build all packages (lerna run build)
14
+
pnpmtest# Run all tests (vitest)
15
+
pnpm test-cov# Run tests with coverage
16
+
pnpm exec vitest run test/consts.test.ts # Run a single test file
17
+
pnpm exec vitest run test/consts.test.ts -t "pattern"# Run specific test by name
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,20 @@ When contributing to this repository, please first discuss the change you wish t
4
4
5
5
## Submitting a pull request
6
6
7
-
- Fork the project and install NPM dependencies. **NPM 7 is needed to have support for workspaces.**
7
+
- Fork the project and install dependencies with [pnpm](https://pnpm.io/) (we use pnpm workspaces).
8
8
9
9
```sh
10
-
npm install
10
+
pnpm install
11
11
```
12
12
13
13
- Run tests before you start working, to be sure they all pass, and your setup is working correctly:
14
14
15
15
```sh
16
-
npmtest
16
+
pnpmtest
17
17
```
18
18
19
19
- Be sure to **include appropriate test cases**.
20
-
- Follow defined coding standard, use `npm run lint`command to check it.
20
+
- Follow defined coding standard, use `pnpm lint`command to check it.
21
21
- Commit your changes using a descriptive commit message that follows defined
22
22
[commit message conventions](#commit-message-guidelines). Adherence to these conventions is necessary because release notes are automatically generated from these messages.
23
23
- Push the code to your forked repository and create a pull request on GitHub.
@@ -52,7 +52,7 @@ empty line to separate subject and body).
52
52
53
53
## Adding new package
54
54
55
-
This repository is managed via `lerna` and NPM workspaces. When adding new package, be sure to include all
55
+
This repository is managed via `lerna` and pnpm workspaces. When adding new package, be sure to include all
56
56
the appropriate config files (`package.json`, `tsconfig.json` and `tsconfig.build.json`). It should be mostly
57
57
ok to just copy&paste one of the existing packages, wipe its contents and change the package name. Be sure
58
58
to clean up the dependencies as well. Keep all the scripts defined in the `package.json`, especially the `build` one.
0 commit comments