Skip to content

Commit 6060d71

Browse files
B4nanclaude
andcommitted
chore(website): migrate to pnpm and enable minimum release age
Migrates the website/ subdirectory from Yarn 4 to pnpm 10 as part of an org-wide supply-chain hardening migration. The Python root (uv) is unchanged. Changes: - website/package.json: replace packageManager with pnpm@10.24.0, add name/private, rewrite scripts from yarn to pnpm - website/pnpm-workspace.yaml: add minimumReleaseAge=1440 minutes (1 day) with exclusions for @apify/* and @crawlee/* - website/.npmrc: hoisted linker to match yarn's node-modules layout - website/.yarnrc.yml, website/yarn.lock: removed - website/docusaurus.config.js: rename future.experimental_faster to future.faster (Docusaurus 3.10+ rename) - .github/actions/pnpm-install/action.yml: add composite action for installing website deps with a working-directory input - .github/workflows/_release_docs.yaml: commit pnpm-lock.yaml instead of yarn.lock on automatic docs-theme updates - .github/workflows/manual_release_stable.yaml: drop corepack+yarn, use the pnpm-install composite action, swap npx for pnpm exec - pyproject.toml: update poe tasks (update-docs-theme, build-docs, run-docs) to invoke pnpm instead of yarn/corepack - renovate.json: add internalChecksFilter=strict and a packageRule with minimumReleaseAge=0 days for @apify/* and @crawlee/* - .gitignore: replace website/.yarn with website/.pnpm-store Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9474a6b commit 6060d71

File tree

13 files changed

+17532
-18487
lines changed

13 files changed

+17532
-18487
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "pnpm install"
2+
description: "Run pnpm install with cache enabled"
3+
inputs:
4+
working-directory:
5+
description: "Directory to run pnpm install in"
6+
required: false
7+
default: "."
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Set up swap space
12+
if: runner.os == 'Linux'
13+
uses: pierotofy/set-swap-space@v1.0
14+
with:
15+
swap-size-gb: 10
16+
17+
- uses: pnpm/action-setup@v4.1.0
18+
name: Install pnpm
19+
with:
20+
run_install: false
21+
22+
- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
23+
id: pnpm-config
24+
shell: bash
25+
run: |
26+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
27+
28+
- name: Cache rotation keys
29+
id: cache-rotation
30+
shell: bash
31+
run: |
32+
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
33+
34+
- uses: actions/cache@v4
35+
name: Setup pnpm cache
36+
with:
37+
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
38+
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
39+
restore-keys: |
40+
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
41+
42+
- name: Install dependencies
43+
shell: bash
44+
working-directory: ${{ inputs.working-directory }}
45+
run: |
46+
pnpm install --frozen-lockfile --prefer-offline --loglevel error
47+
env:
48+
HUSKY: "0"

.github/workflows/_release_docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
git config user.name 'GitHub Actions'
6464
git config user.email 'github-actions[bot]@users.noreply.github.com'
6565
git add website/package.json
66-
git add website/yarn.lock
66+
git add website/pnpm-lock.yaml
6767
git diff-index --quiet HEAD || git commit -m 'chore: Automatic docs theme update [skip ci]' || true
6868
git push
6969

.github/workflows/manual_release_stable.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,9 @@ jobs:
140140
run: uv run poe install-dev
141141

142142
- name: Install website dependencies
143-
run: |
144-
cd website
145-
corepack enable
146-
yarn install
143+
uses: ./.github/actions/pnpm-install
144+
with:
145+
working-directory: website
147146

148147
- name: Snapshot the current version
149148
run: |
@@ -157,8 +156,8 @@ jobs:
157156
jq 'map(select(. != env.MAJOR_MINOR))' versions.json > tmp.json && mv tmp.json versions.json
158157
# Build API reference and create version snapshots
159158
bash build_api_reference.sh
160-
npx docusaurus docs:version "$MAJOR_MINOR"
161-
npx docusaurus api:version "$MAJOR_MINOR"
159+
pnpm exec docusaurus docs:version "$MAJOR_MINOR"
160+
pnpm exec docusaurus api:version "$MAJOR_MINOR"
162161
163162
- name: Commit and push versioned docs
164163
id: commit_versioned_docs

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ docs/changelog.md
6767
# Website build artifacts, node dependencies
6868
website/build
6969
website/node_modules
70-
website/.yarn
70+
website/.pnpm-store
7171
website/.docusaurus
7272
website/api-typedoc-generated.json
7373
website/apify-shared-docspec-dump.jsonl

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ shell = "uv run ruff format --check && uv run ruff check"
250250
shell = "uv run ruff check --fix && uv run ruff format"
251251

252252
[tool.poe.tasks.update-docs-theme]
253-
shell = "corepack enable && yarn up @apify/docs-theme"
253+
shell = "pnpm update @apify/docs-theme"
254254
cwd = "website"
255255

256256
[tool.poe.tasks.build-docs]
257-
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn build"
257+
shell = "./build_api_reference.sh && pnpm install && uv run pnpm build"
258258
cwd = "website"
259259

260260
[tool.poe.tasks.run-docs]
261-
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn start"
261+
shell = "./build_api_reference.sh && pnpm install && uv run pnpm start"
262262
cwd = "website"

renovate.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919
"groupSlug": "dev-dependencies",
2020
"automerge": true,
2121
"automergeType": "branch"
22+
},
23+
{
24+
"matchPackageNames": ["@apify/*", "@crawlee/*"],
25+
"minimumReleaseAge": "0 days"
2226
}
2327
],
2428
"minimumReleaseAge": "1 day",
29+
"internalChecksFilter": "strict",
2530
"schedule": ["before 7am every weekday"],
2631
"ignoreDeps": ["apify", "docusaurus-plugin-typedoc-api"]
2732
}

website/.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node-linker=hoisted
2+
link-workspace-packages=true
3+
prefer-workspace-packages=true
4+
public-hoist-pattern[]=*

website/.yarnrc.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = {
4444
scripts: ['/js/custom.js', ...(config.scripts ?? [])],
4545
githubHost: 'github.com',
4646
future: {
47-
experimental_faster: {
47+
faster: {
4848
// ssgWorkerThreads: true,
4949
swcJsLoader: true,
5050
swcJsMinimizer: true,

website/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
2-
"name": "apify-sdk-python",
2+
"name": "apify-sdk-python-website",
3+
"private": true,
34
"scripts": {
45
"clean": "rimraf .docusaurus build",
5-
"build": "yarn clean && docusaurus build",
6-
"start": "yarn clean && docusaurus start",
7-
"deploy": "yarn clean && docusaurus deploy",
6+
"build": "pnpm clean && docusaurus build",
7+
"start": "pnpm clean && docusaurus start",
8+
"deploy": "pnpm clean && docusaurus deploy",
89
"docusaurus": "docusaurus",
910
"publish-gh-pages": "docusaurus-publish",
1011
"rename-version": "docusaurus rename-version",
1112
"swizzle": "docusaurus swizzle",
1213
"version": "docusaurus version",
1314
"write-translations": "docusaurus write-translations",
1415
"prettify": "prettier --write --config ./tools/docs-prettier.config.js ../docs/*.md ../docs/*.mdx",
15-
"lint": "yarn lint:code",
16-
"lint:fix": "yarn lint:code:fix",
16+
"lint": "pnpm lint:code",
17+
"lint:fix": "pnpm lint:code:fix",
1718
"lint:code": "eslint .",
1819
"lint:code:fix": "eslint . --fix"
1920
},
@@ -47,5 +48,5 @@
4748
"rimraf": "^6.0.0",
4849
"typescript": "^6.0.0"
4950
},
50-
"packageManager": "yarn@4.13.0"
51+
"packageManager": "pnpm@10.24.0"
5152
}

0 commit comments

Comments
 (0)