Skip to content

Commit 8eb94ed

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 6c3b84d commit 8eb94ed

12 files changed

Lines changed: 17521 additions & 18481 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/manual_release_docs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ jobs:
5858
- name: Commit the updated package.json and lockfile
5959
uses: EndBug/add-and-commit@v10
6060
with:
61-
add: website/package.json website/yarn.lock
61+
add: website/package.json website/pnpm-lock.yaml
6262
message: "chore: Automatic docs theme update [skip ci]"
6363
default_author: github_actions
64+
pull: '--rebase --autostash'
6465
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
6566
new_branch: ${{ github.event.repository.default_branch }}
6667

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ website/versioned_docs/*/pyproject.toml
6969
# Website build artifacts, node dependencies
7070
website/build
7171
website/node_modules
72-
website/.yarn
7372
website/.docusaurus
7473
website/api-typedoc-generated.json
7574
website/apify-shared-docspec-dump.jsonl

pyproject.toml

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

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

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

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

274274
[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)