Skip to content

Commit 4d7b67d

Browse files
B4nanclaude
andauthored
chore(website): migrate to pnpm and enable minimum release age (#724)
## Summary Migrates 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 npm packages via `pnpm-workspace.yaml` (with `@apify/*` and `@crawlee/*` excluded so first-party releases stay fast), and mirrors the policy in `renovate.json` via `internalChecksFilter=strict` plus a `packageRule` that sets `minimumReleaseAge: 0 days` for the same scopes. ## Changes - `website/package.json`: renamed to `apify-client-python-website`, marked `private: true`, set `packageManager` to `pnpm@10.24.0`, rewrote all script references from `yarn` to `pnpm`. - `website/pnpm-workspace.yaml` (new): sets `minimumReleaseAge: 1440` (minutes) with `@apify/*` and `@crawlee/*` excluded. - `website/.npmrc` (new): enables hoisted node linker and workspace package linking. - `website/pnpm-lock.yaml` (new): generated from `pnpm install`. - Removed Yarn artifacts: `website/yarn.lock`, `website/.yarnrc.yml`, `website/.yarn/` (only contained `install-state.gz`; no `.yarn/patches/` directory was present). - `website/docusaurus.config.js`: renamed `future.experimental_faster` to `future.faster` (required by Docusaurus 3.10). - `.github/actions/pnpm-install/action.yml` (new): composite action copied verbatim from `apify-client-js` for use by future CI workflows. - `.github/workflows/_release_docs.yaml`: `git add website/yarn.lock` -> `git add website/pnpm-lock.yaml`. - `.github/workflows/manual_release_stable.yaml`: replaced inline `yarn install` + `npx docusaurus` in the `version_docs` job with `pnpm/action-setup`, `pnpm install --frozen-lockfile`, and `pnpm exec docusaurus`. (Steps are inlined rather than calling `./.github/actions/pnpm-install` because GitHub Actions does not support `working-directory` on `uses:` steps and the composite expects to run from the repo containing the lockfile.) - `pyproject.toml`: `poe` tasks `update-docs-theme`, `build-docs`, and `run-docs` now use `pnpm` instead of `yarn` / `corepack enable && yarn`. - `renovate.json`: added `internalChecksFilter: "strict"` and a package rule granting `@apify/*` / `@crawlee/*` a `0 days` minimum release age. - `.gitignore`: dropped the now-obsolete `website/.yarn` entry. Verified locally: `pnpm install`, `pnpm install --frozen-lockfile`, and Docusaurus config validation all pass. A full `pnpm build` is gated by the repo's Python docs pipeline (`pydoc-markdown`) which is invoked by `uv run poe build-docs` in CI and was not re-run locally; the Docusaurus config loads past the `future.faster` rename cleanly. Rolls out the same pattern just applied to `apify-sdk-python`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ff9817c commit 4d7b67d

11 files changed

Lines changed: 17504 additions & 18485 deletions

.github/workflows/manual_release_docs.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,21 @@ jobs:
5252
- name: Install Python dependencies
5353
run: uv run poe install-dev
5454

55+
- name: Install pnpm and website dependencies
56+
uses: apify/workflows/pnpm-install@main
57+
with:
58+
working-directory: website
59+
5560
- name: Update docs theme
5661
run: uv run poe update-docs-theme
5762

5863
- name: Commit the updated package.json and lockfile
5964
uses: EndBug/add-and-commit@v10
6065
with:
61-
add: website/package.json website/yarn.lock
66+
add: website/package.json website/pnpm-lock.yaml
6267
message: "chore: Automatic docs theme update [skip ci]"
6368
default_author: github_actions
69+
pull: '--rebase --autostash'
6470
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
6571
new_branch: ${{ github.event.repository.default_branch }}
6672

.github/workflows/manual_version_docs.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ jobs:
6161
- name: Install Python dependencies
6262
run: uv run poe install-dev
6363

64+
- name: Install pnpm and website dependencies
65+
uses: apify/workflows/pnpm-install@main
66+
with:
67+
working-directory: website
68+
6469
- name: Snapshot the current version
6570
id: snapshot
6671
run: |
6772
cd website
68-
corepack enable
69-
yarn install
7073
7174
# Extract version from pyproject.toml.
7275
FULL_VERSION="$(uv version --short)"
@@ -98,8 +101,8 @@ jobs:
98101
99102
# Build API reference and create Docusaurus version snapshots.
100103
bash build_api_reference.sh
101-
uv run npx docusaurus docs:version "$MAJOR_MINOR_VERSION"
102-
uv run npx docusaurus api:version "$MAJOR_MINOR_VERSION"
104+
uv run pnpm exec docusaurus docs:version "$MAJOR_MINOR_VERSION"
105+
uv run pnpm exec docusaurus api:version "$MAJOR_MINOR_VERSION"
103106
104107
- name: Commit and push versioned docs
105108
id: commit_versioned_docs
@@ -108,6 +111,7 @@ jobs:
108111
add: website/versioned_docs website/versioned_sidebars website/versions.json
109112
message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
110113
default_author: github_actions
114+
pull: '--rebase --autostash'
111115
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
112116
new_branch: ${{ github.event.repository.default_branch }}
113117

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ website/versioned_docs/*/pyproject.toml
6969
# Website build artifacts, node dependencies
7070
website/build
7171
website/node_modules
72+
website/yarn.lock
7273
website/.yarn
7374
website/.docusaurus
7475
website/api-typedoc-generated.json

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ keep_model_order = true
238238
# Minimal defense against supply-chain atatcks.
239239
exclude-newer = "24 hours"
240240

241+
[tool.uv.exclude-newer-package]
242+
# Allow internal Apify packages to install immediately.
243+
apify-client = false
244+
apify-shared = false
245+
apify_fingerprint_datapoints = false
246+
crawlee = false
247+
241248
# Run tasks with: uv run poe <task>
242249
[tool.poe.tasks]
243250
clean = "rm -rf .coverage .pytest_cache .ruff_cache .ty_cache build dist htmlcov"
@@ -263,15 +270,15 @@ shell = "uv run ruff format --check && uv run ruff check"
263270
shell = "uv run ruff check --fix && uv run ruff format"
264271

265272
[tool.poe.tasks.update-docs-theme]
266-
shell = "corepack enable && yarn up @apify/docs-theme"
273+
shell = "pnpm update @apify/docs-theme"
267274
cwd = "website"
268275

269276
[tool.poe.tasks.build-docs]
270-
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn build"
277+
shell = "./build_api_reference.sh && pnpm install && uv run pnpm build"
271278
cwd = "website"
272279

273280
[tool.poe.tasks.run-docs]
274-
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn start"
281+
shell = "./build_api_reference.sh && pnpm install && uv run pnpm start"
275282
cwd = "website"
276283

277284
[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/*", "apify", "apify-client", "apify-shared", "apify-fingerprint-datapoints", "crawlee", "got-scraping"],
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/.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
@@ -32,7 +32,7 @@ const { absoluteUrl } = config;
3232
/** @type {Partial<import('@docusaurus/types').DocusaurusConfig>} */
3333
module.exports = {
3434
future: {
35-
experimental_faster: {
35+
faster: {
3636
swcJsLoader: true,
3737
swcJsMinimizer: true,
3838
swcHtmlMinimizer: true,

website/package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
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 .",
18-
"lint:code:fix": "eslint . --fix"
19+
"lint:code:fix": "eslint . --fix",
20+
"preinstall": "npx only-allow pnpm"
1921
},
2022
"dependencies": {
2123
"@apify/docs-theme": "^1.0.243",
@@ -47,5 +49,5 @@
4749
"rimraf": "^6.0.0",
4850
"typescript": "^6.0.0"
4951
},
50-
"packageManager": "yarn@4.13.0"
52+
"packageManager": "pnpm@10.24.0"
5153
}

0 commit comments

Comments
 (0)