Skip to content

Commit 0bab2c6

Browse files
B4nanclaude
andcommitted
chore(website): migrate to pnpm and enable minimum release age
Migrate the website/ subdirectory from Yarn 4 to pnpm 10.24.0 as part of an org-wide supply-chain hardening effort. The Python root (uv) is unchanged. Enables a 24h minimum release age for third-party packages via pnpm-workspace.yaml (with @apify/* and @crawlee/* excluded), and mirrors the policy in renovate.json using internalChecksFilter=strict. Also renames the renamed-by-Docusaurus future.experimental_faster option to future.faster in the Docusaurus config, and replaces yarn/npx calls in workflows and poe tasks with their pnpm equivalents. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a1770eb commit 0bab2c6

13 files changed

Lines changed: 17536 additions & 18486 deletions

File tree

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

.github/workflows/_release_docs.yaml

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

.github/workflows/manual_release_stable.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,21 @@ jobs:
137137
- name: Install Python dependencies
138138
run: uv run poe install-dev
139139

140+
- name: Set up swap space
141+
uses: pierotofy/set-swap-space@v1.0
142+
with:
143+
swap-size-gb: 10
144+
145+
- uses: pnpm/action-setup@v4.1.0
146+
name: Install pnpm
147+
with:
148+
run_install: false
149+
140150
- name: Install website dependencies
141-
run: |
142-
cd website
143-
yarn install
151+
working-directory: website
152+
run: pnpm install --frozen-lockfile --prefer-offline --loglevel error
153+
env:
154+
HUSKY: "0"
144155

145156
- name: Snapshot the current version
146157
run: |
@@ -152,8 +163,8 @@ jobs:
152163
rm -rf "versioned_sidebars/version-${MAJOR_MINOR}-sidebars.json"
153164
jq 'map(select(. != env.MAJOR_MINOR))' versions.json > tmp.json && mv tmp.json versions.json
154165
bash build_api_reference.sh
155-
npx docusaurus docs:version "$MAJOR_MINOR"
156-
npx docusaurus api:version "$MAJOR_MINOR"
166+
pnpm exec docusaurus docs:version "$MAJOR_MINOR"
167+
pnpm exec docusaurus api:version "$MAJOR_MINOR"
157168
158169
- name: Commit and push the version snapshot
159170
uses: EndBug/add-and-commit@v10

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ docs/changelog.md
6767
# Website build artifacts, node dependencies
6868
website/build
6969
website/node_modules
70-
website/.yarn
7170
website/.docusaurus
7271
website/api-typedoc-generated.json
7372
website/apify-shared-docspec-dump.jsonl

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ shell = "uv run ruff format --check && uv run ruff check"
258258
shell = "uv run ruff check --fix && uv run ruff format"
259259

260260
[tool.poe.tasks.update-docs-theme]
261-
shell = "corepack enable && yarn up @apify/docs-theme"
261+
shell = "pnpm update @apify/docs-theme"
262262
cwd = "website"
263263

264264
[tool.poe.tasks.build-docs]
265-
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn build"
265+
shell = "./build_api_reference.sh && pnpm install && uv run pnpm build"
266266
cwd = "website"
267267

268268
[tool.poe.tasks.run-docs]
269-
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn start"
269+
shell = "./build_api_reference.sh && pnpm install && uv run pnpm start"
270270
cwd = "website"
271271

272272
[tool.poe.tasks.generate-models]

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_client", "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
@@ -31,7 +31,7 @@ const { absoluteUrl } = config;
3131
/** @type {Partial<import('@docusaurus/types').DocusaurusConfig>} */
3232
module.exports = {
3333
future: {
34-
experimental_faster: {
34+
faster: {
3535
swcJsLoader: true,
3636
swcJsMinimizer: true,
3737
swcHtmlMinimizer: 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-client-python",
2+
"name": "apify-client-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)