Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
}
],
"ignorePaths": [
"**/dist/**",
"**/lib/**",
"**/build/**",
"**/.docusaurus/**",
"**/__fixtures__/**",
"CHANGELOG.md",
"CHANGELOG-v*.md",
"patches",
"packages/docusaurus-theme-translations/locales",
"packages/docusaurus-plugin-ideal-image/src/theme/IdealImageLegacy",
"package.json",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"yarn.lock",
"project-words.txt",
"__snapshots__",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"forwardPorts": [3000],
"containerUser": "vscode",
"postCreateCommand": "yarn install",
"postCreateCommand": "pnpm install",
"waitFor": "postCreateCommand", // otherwise automated jest tests fail
"features": {
"node": {
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/argos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,23 @@ jobs:
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile

- name: Install Playwright browsers
run: yarn playwright install --with-deps chromium
run: pnpm playwright install --with-deps chromium

- name: Build website fast
run: yarn argos:build
run: pnpm argos:build

- name: Take Argos screenshots
run: yarn argos:screenshot
run: pnpm argos:screenshot
8 changes: 5 additions & 3 deletions .github/workflows/build-blog-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm
- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile
- name: Build blog-only
run: yarn workspace website build:blogOnly
run: pnpm --filter website build:blogOnly
env:
DOCUSAURUS_PERF_LOGGER: 'true'
8 changes: 5 additions & 3 deletions .github/workflows/build-hash-router.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm
- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile

- name: Build Hash Router
run: yarn build:website:fast
run: pnpm build:website:fast
env:
DOCUSAURUS_PERF_LOGGER: 'true'
DOCUSAURUS_ROUTER: 'hash'
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/build-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
paths:
- .github/workflows/build-perf.yml
- package.json
- yarn.lock
- pnpm-lock.yaml
- packages/**
- website/**
- '!website/docs/**'
Expand Down Expand Up @@ -42,11 +42,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm
- name: Track build size changes
uses: preactjs/compressed-size-action@66325aad6443cb7cf89c4bfcd414aea2367cda94 # v2.9.1
with:
Expand Down Expand Up @@ -75,25 +77,27 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm
- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile

# Ensure build with a cold cache does not increase too much
- name: Build (cold cache)
run: yarn build:website:fast
run: pnpm build:website:fast
timeout-minutes: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 3 || 2 }}
env:
DOCUSAURUS_SLOWER: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 'true' || 'false' }}
DOCUSAURUS_PERF_LOGGER: 'true'

# Ensure build with a warm cache does not increase too much
- name: Build (warm cache)
run: yarn build:website:fast
run: pnpm build:website:fast
# Temporary: upper value for Rspack until incremental cache works better
timeout-minutes: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 1 || 2 }}
env:
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/continuous-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,28 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
# 鈿狅笍 Do not use any cache on purpose
# It increases the chance of a compromised release being publish
# See https://github.com/actions/setup-node/issues/1445#issuecomment-4040130833
# cache: pnpm

- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile

- name: Build packages
run: yarn build:packages
run: pnpm build:packages

- name: Initialize fresh templates
run: |
yarn create-docusaurus template/docusaurus-classic-js classic --javascript -p npm
yarn create-docusaurus template/docusaurus-classic-ts classic --typescript -p npm
node ./packages/create-docusaurus/bin/index.js template/docusaurus-classic-js classic --javascript -p npm
node ./packages/create-docusaurus/bin/index.js template/docusaurus-classic-ts classic --typescript -p npm

- name: Release
run: yarn pkg-pr-new publish './packages/*' --template './template/*' --compact --comment=off
run: pnpm pkg-pr-new publish './packages/*' --template './template/*' --compact --comment=off
9 changes: 6 additions & 3 deletions .github/workflows/lighthouse-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm

- name: Install dependencies
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile

- name: Build website fast
run: yarn build:website:fast
run: pnpm build:website:fast

- name: Audit URLs using Lighthouse
id: lighthouse_audit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lighthouserc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ci": {
"collect": {
"startServerCommand": "yarn serve:website",
"startServerCommand": "pnpm serve:website",
"startServerReadyPattern": "Serving",
"startServerReadyTimeout": 10000,

Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/lint-autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,32 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

- name: Set up Node LTS
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm

- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile

- name: AutoFix Formatting
run: yarn format
run: pnpm format

- name: AutoFix JS
run: yarn lint:js:fix
run: pnpm lint:js:fix

- name: AutoFix Style
run: yarn lint:style:fix
run: pnpm lint:style:fix

- name: AutoFix Spelling
run: yarn lint:spelling:fix
run: pnpm lint:spelling:fix

- name: AutoFix Dependency versions
run: yarn lint:syncpack:fix
run: pnpm lint:syncpack:fix

- name: Print Diff
run: git diff
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
cache: yarn
cache: pnpm
- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
- name: Check immutable yarn.lock
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile
- name: Check immutable pnpm-lock.yaml
run: git diff --exit-code

- name: Lint
run: |
echo "::add-matcher::.github/workflows/cspell-problem-matcher.json"
yarn lint:ci
pnpm lint:ci

- name: Check Formatting
run: yarn format:diff
run: pnpm format:diff
19 changes: 7 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,49 +45,44 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Needed to get the commit number with "git rev-list --count HEAD"
- name: Install pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: lts/*
# 鈿狅笍 Do not use any cache on purpose
# It increases the chance of a compromised release being publish
# See https://github.com/actions/setup-node/issues/1445#issuecomment-4040130833
# cache: yarn
# cache: pnpm
- name: Prepare git
run: |
git config --global user.name "Docusaurus"
git config --global user.email "github@docusaurus.io"
- name: Installation
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
# TODO Docusaurus v4: remove after we upgrade the Node version
- name: Upgrade Lerna
run: |
yarn add -D -W lerna@9.0.3 --ignore-scripts
git restore .
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile

- name: Publish Canary release
if: |
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.npm_tag == 'canary')
run: |
yarn canary:bumpVersion
yarn canary:publish
pnpm canary:bumpVersion
pnpm canary:publish

- name: Publish NPM release
if: |
github.event_name == 'workflow_dispatch' && github.event.inputs.npm_tag != 'canary'
run: |
yarn lerna publish \
pnpm lerna publish \
--force-publish \
--exact "${{ github.event.inputs.npm_version }}" \
--dist-tag "${{ github.event.inputs.npm_tag }}" \
--loglevel verbose \
--yes \
--no-verify-access \
--no-push
git push origin v"${{ github.event.inputs.npm_version }}"

# TODO Docusaurus v4: upgrade Lerna, remove useless --no-verify-access everywhere
# TODO should we push the package version local updates to Git?
# "main" is currently protected, even GitHub Actions can't push to it
# However it remains useful to push the git tag
Loading
Loading