Skip to content

Commit ba71a86

Browse files
authored
docs: Migrate from npm to yarn and relax web dependencies (#584)
- Migrate from `npm` to `yarn` for consistency. - Same setup as in Crawlee. - All 3 Python documentation projects (`crawlee-python`, `apify-sdk-python`, `apify-client-python`) now use an identical yarn setup. - Relax website dependency constraints to reduce the number of unnecessary Renovate PRs. - Switch GitHub Actions to major-version tags for the same reason (only typos, for actionlint it isn't possible, unfortunately).
1 parent a78478e commit ba71a86

7 files changed

Lines changed: 18549 additions & 26842 deletions

File tree

.github/workflows/_check_code.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Checkout repository
2525
uses: actions/checkout@v6
2626
- name: Check spelling with typos
27-
uses: crate-ci/typos@v1.42.1
27+
uses: crate-ci/typos@v1
2828

2929
lint_check:
3030
name: Lint check

.github/workflows/_release_docs.yaml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,6 @@ jobs:
3838
uses: actions/setup-node@v6
3939
with:
4040
node-version: ${{ env.NODE_VERSION }}
41-
cache: npm
42-
cache-dependency-path: website/package-lock.json
43-
44-
- name: Install Node dependencies
45-
run: |
46-
npm install
47-
npm update @apify/docs-theme
48-
working-directory: ./website
49-
50-
# We do this as early as possible to prevent conflicts if someone else would push something in the meantime
51-
- name: Commit the updated package.json and lockfile
52-
run: |
53-
git config user.name 'GitHub Actions'
54-
git config user.email 'github-actions[bot]@users.noreply.github.com'
55-
git add website/package.json
56-
git add website/package-lock.json
57-
git diff-index --quiet HEAD || git commit -m 'chore: Automatic docs theme update [skip ci]' || true
58-
git push
5941

6042
- name: Set up Python
6143
uses: actions/setup-python@v6
@@ -70,6 +52,18 @@ jobs:
7052
- name: Install Python dependencies
7153
run: uv run poe install-dev
7254

55+
- name: Update docs theme
56+
run: uv run poe update-docs-theme
57+
58+
- name: Commit the updated package.json and lockfile
59+
run: |
60+
git config user.name 'GitHub Actions'
61+
git config user.email 'github-actions[bot]@users.noreply.github.com'
62+
git add website/package.json
63+
git add website/yarn.lock
64+
git diff-index --quiet HEAD || git commit -m 'chore: Automatic docs theme update [skip ci]' || true
65+
git push
66+
7367
- name: Build docs
7468
run: uv run poe build-docs
7569
env:

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,14 @@ shell = "uv run ruff format --check && uv run ruff check"
204204
[tool.poe.tasks.format]
205205
shell = "uv run ruff check --fix && uv run ruff format"
206206

207+
[tool.poe.tasks.update-docs-theme]
208+
shell = "corepack enable && yarn up @apify/docs-theme"
209+
cwd = "website"
210+
207211
[tool.poe.tasks.build-docs]
208-
shell = "./build_api_reference.sh && npm ci && npm run build"
212+
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn build"
209213
cwd = "website"
210214

211215
[tool.poe.tasks.run-docs]
212-
shell = "./build_api_reference.sh && npm ci && npm run start"
216+
shell = "./build_api_reference.sh && corepack enable && yarn && uv run yarn start"
213217
cwd = "website"

website/.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodeLinker: node-modules
2+
enableGlobalCache: true

0 commit comments

Comments
 (0)