Skip to content

Commit 5fa32e3

Browse files
committed
Merge branch 'main' into ozaki/execa
2 parents 6c4a1d7 + a6ef389 commit 5fa32e3

File tree

1,179 files changed

+91566
-16010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,179 files changed

+91566
-16010
lines changed

.cspell.json

+2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
],
2222
"ignorePaths": [
2323
"CHANGELOG.md",
24+
"patches",
2425
"packages/docusaurus-theme-translations/locales",
2526
"package.json",
2627
"yarn.lock",
2728
"project-words.txt",
2829
"__snapshots__",
30+
"admin/scripts",
2931
"website/src/data/users.tsx",
3032
"website/src/data/tweets.tsx",
3133
"website/docusaurus.config.localized.json",

.devcontainer/devcontainer.json

+24-20
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
11
{
2-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
3-
"settings": {
4-
"[typescript]": {
5-
"editor.defaultFormatter": "esbenp.prettier-vscode",
6-
"editor.formatOnSave": true
7-
},
8-
"[json]": {
9-
"editor.defaultFormatter": "esbenp.prettier-vscode",
10-
"editor.formatOnSave": true
11-
},
12-
"[jsonc]": {
13-
"editor.defaultFormatter": "esbenp.prettier-vscode",
14-
"editor.formatOnSave": true
2+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
3+
"customizations": {
4+
"vscode": {
5+
"settings": {
6+
"[typescript]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"editor.formatOnSave": true
9+
},
10+
"[json]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"editor.formatOnSave": true
13+
},
14+
"[jsonc]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode",
16+
"editor.formatOnSave": true
17+
}
18+
},
19+
"extensions": [
20+
"dbaeumer.vscode-eslint",
21+
"orta.vscode-jest",
22+
"esbenp.prettier-vscode",
23+
"streetsidesoftware.code-spell-checker"
24+
]
1525
}
1626
},
17-
"extensions": [
18-
"dbaeumer.vscode-eslint",
19-
"orta.vscode-jest",
20-
"esbenp.prettier-vscode",
21-
"streetsidesoftware.code-spell-checker"
22-
],
2327
"forwardPorts": [3000],
2428
"containerUser": "vscode",
2529
"postCreateCommand": "yarn install",
2630
"waitFor": "postCreateCommand", // otherwise automated jest tests fail
2731
"features": {
2832
"node": {
29-
"version": "18"
33+
"version": "22"
3034
},
3135
"github-cli": "latest"
3236
}

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ packages/create-docusaurus/lib/*
2121
packages/create-docusaurus/templates/facebook
2222

2323
website/_dogfooding/_swizzle_theme_tests
24+
website/_dogfooding/_asset-tests/badSyntax.js

.eslintrc.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,14 @@ module.exports = {
380380
// We don't provide any escape hatches for this rule. Rest siblings and
381381
// function placeholder params are always ignored, and any other unused
382382
// locals must be justified with a disable comment.
383-
'@typescript-eslint/no-unused-vars': [ERROR, {ignoreRestSiblings: true}],
383+
'@typescript-eslint/no-unused-vars': [
384+
ERROR,
385+
{
386+
ignoreRestSiblings: true,
387+
argsIgnorePattern: '^_',
388+
varsIgnorePattern: '^_',
389+
},
390+
],
384391
'@typescript-eslint/prefer-optional-chain': ERROR,
385392
'@docusaurus/no-html-links': ERROR,
386393
'@docusaurus/prefer-docusaurus-heading': ERROR,
@@ -396,6 +403,7 @@ module.exports = {
396403
'@',
397404
'WebContainers',
398405
'Twitter',
406+
'X',
399407
'GitHub',
400408
'Dev.to',
401409
'1.x',

.github/workflows/argos.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ jobs:
3030
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3131

3232
- name: Use Node.js
33-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
33+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
3434
with:
35-
node-version: 20
35+
node-version: lts/*
3636

3737
- name: Install dependencies
38-
run: yarn install --frozen-lockfile
38+
run: yarn || yarn || yarn
3939

4040
- name: Install Playwright browsers
4141
run: npx playwright install --with-deps chromium
4242

4343
- name: Build website fast
44-
run: yarn build:website:fast --dev
44+
run: yarn argos:build
4545

4646
- name: Take Argos screenshots
4747
run: yarn argos:screenshot

.github/workflows/build-blog-only.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2626
- name: Set up Node
27-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
27+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
2828
with:
29-
node-version: 20
29+
node-version: lts/*
3030
cache: yarn
3131
- name: Installation
32-
run: yarn
32+
run: yarn || yarn || yarn
3333
- name: Build blog-only
3434
run: yarn workspace website build:blogOnly

.github/workflows/build-hash-router.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
- name: Checkout
2828
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2929
- name: Set up Node
30-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
30+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
3131
with:
32-
node-version: '18'
32+
node-version: lts/*
3333
cache: yarn
3434
- name: Installation
35-
run: yarn
35+
run: yarn || yarn || yarn
3636

3737
- name: Build Hash Router
3838
run: yarn build:website:fast

.github/workflows/build-perf.yml

+27-8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- main
1212
- docusaurus-v**
1313
paths:
14+
- .github/workflows/build-perf.yml
1415
- package.json
1516
- yarn.lock
1617
- packages/**
@@ -25,6 +26,7 @@ permissions:
2526
contents: read
2627

2728
jobs:
29+
# Posts a PR comment with build size differences from PR vs main branches
2830
build-size:
2931
permissions:
3032
checks: write # for preactjs/compressed-size-action to create and update the checks
@@ -34,47 +36,64 @@ jobs:
3436
name: Build Size Report
3537
timeout-minutes: 30
3638
runs-on: ubuntu-latest
39+
strategy:
40+
matrix:
41+
DOCUSAURUS_INFRA: ['SLOWER', 'FASTER']
3742
steps:
3843
- name: Checkout
3944
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4045
- name: Set up Node
41-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
46+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
4247
with:
43-
node-version: 20
48+
node-version: lts/*
4449
cache: yarn
4550
- name: Track build size changes
46-
uses: preactjs/compressed-size-action@f780fd104362cfce9e118f9198df2ee37d12946c # v2
51+
uses: preactjs/compressed-size-action@946a292cd35bd1088e0d7eb92b69d1a8d5b5d76a # v2
4752
with:
4853
repo-token: ${{ secrets.GITHUB_TOKEN }}
4954
build-script: build:website:fast
5055
clean-script: clear:website # see https://github.com/facebook/docusaurus/pull/6838
51-
pattern: '{website/build/assets/js/main*js,website/build/assets/css/styles*css,website/.docusaurus/globalData.json,website/.docusaurus/registry.js,website/.docusaurus/routes.js,website/.docusaurus/routesChunkNames.json,website/.docusaurus/site-metadata.json,website/.docusaurus/codeTranslations.json,website/.docusaurus/i18n.json,website/.docusaurus/docusaurus.config.mjs,website/build/index.html,website/build/docs.html,website/build/docs/**/*.html,website/build/blog.html,website/build/blog/**/*.html}'
56+
pattern: '{website/build/assets/js/main*js,website/build/assets/js/runtime~main*js,website/build/assets/css/styles*css,website/.docusaurus/globalData.json,website/.docusaurus/registry.js,website/.docusaurus/routes.js,website/.docusaurus/routesChunkNames.json,website/.docusaurus/site-metadata.json,website/.docusaurus/codeTranslations.json,website/.docusaurus/i18n.json,website/.docusaurus/docusaurus.config.mjs,website/build/index.html,website/build/docs.html,website/build/docs/**/*.html,website/build/blog.html,website/build/blog/**/*.html}'
5257
# HTML files: exclude versioned docs pages, tags pages, html redirect files
5358
exclude: '{website/build/docs/?.?.?/**/*.html,website/build/docs/next/**/*.html,website/build/blog/tags/**/*.html,**/*.html.html}'
5459
strip-hash: '\.([^;]\w{7})\.'
5560
minimum-change-threshold: 30
5661
compression: none
62+
comment-key: DOCUSAURUS_INFRA_${{ matrix.DOCUSAURUS_INFRA }}
63+
env:
64+
DOCUSAURUS_SLOWER: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 'true' || 'false' }}
65+
66+
# Ensures build times stay under reasonable thresholds
5767
build-time:
5868
name: Build Time Perf
5969
timeout-minutes: 30
6070
runs-on: ubuntu-latest
71+
strategy:
72+
matrix:
73+
DOCUSAURUS_INFRA: ['SLOWER', 'FASTER']
6174
steps:
6275
- name: Checkout
6376
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6477
- name: Set up Node
65-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
78+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
6679
with:
80+
node-version: lts/*
6781
cache: yarn
6882
- name: Installation
69-
run: yarn
83+
run: yarn || yarn || yarn
7084

7185
# Ensure build with a cold cache does not increase too much
7286
- name: Build (cold cache)
7387
run: yarn build:website:fast
74-
timeout-minutes: 8
88+
timeout-minutes: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 3 || 1 }}
89+
env:
90+
DOCUSAURUS_SLOWER: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 'true' || 'false' }}
7591

7692
# Ensure build with a warm cache does not increase too much
7793
- name: Build (warm cache)
7894
run: yarn build:website:fast
79-
timeout-minutes: 2
95+
timeout-minutes: 1
96+
env:
97+
DOCUSAURUS_SLOWER: ${{ matrix.DOCUSAURUS_INFRA == 'SLOWER' && 'true' || 'false' }}
98+
8099
# TODO post a GitHub comment with build with perf warnings?

.github/workflows/canary-release.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
name: Canary Release
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
78
- docusaurus-v**
89
paths:
10+
- .github/workflows/canary-release.yml
11+
- package.json
912
- packages/**
1013

1114
permissions:
@@ -21,9 +24,9 @@ jobs:
2124
with:
2225
fetch-depth: 0 # Needed to get the commit number with "git rev-list --count HEAD"
2326
- name: Set up Node
24-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
27+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
2528
with:
26-
node-version: 20
29+
node-version: lts/*
2730
cache: yarn
2831
- name: Prepare git
2932
run: |
@@ -38,7 +41,7 @@ jobs:
3841
env:
3942
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
4043
- name: Installation
41-
run: yarn
44+
run: yarn || yarn || yarn
4245
- name: Publish Canary release
4346
run: |
4447
yarn canary

.github/workflows/codeql-analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3737

3838
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@2d790406f505036ef40ecba973cc774a50395aac # 3.25.13
39+
uses: github/codeql-action/init@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # 3.26.5
4040
with:
4141
languages: ${{ matrix.language }}
4242

4343
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@2d790406f505036ef40ecba973cc774a50395aac # 3.25.13
44+
uses: github/codeql-action/analyze@2c779ab0d087cd7fe7b826087247c2c81f27bfa6 # 3.26.5

.github/workflows/continuous-releases.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ jobs:
2020
- name: Checkout
2121
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2222

23+
- name: Set up Node
24+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
25+
with:
26+
node-version: lts/*
27+
cache: yarn
28+
2329
- name: Installation
24-
run: yarn
30+
run: yarn || yarn || yarn
2531

2632
- name: Build packages
2733
run: yarn build:packages
@@ -32,4 +38,4 @@ jobs:
3238
yarn create-docusaurus template/docusaurus-classic-ts classic --typescript -p npm
3339
3440
- name: Release
35-
run: npx pkg-pr-new publish './packages/*' --template './template/*' --compact --comment=off
41+
run: npx pkg-pr-new@0.0.20 publish './packages/*' --template './template/*' --compact --comment=off

.github/workflows/dependency-review.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1717
- name: Dependency Review
18-
uses: actions/dependency-review-action@5a2ce3f5b92ee19cbb1541a4984c76d921601d7c # 4.3.4
18+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # 4.5.0

.github/workflows/lighthouse-report.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2525

2626
- name: Use Node.js
27-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
27+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
2828
with:
29-
node-version: 20
29+
node-version: lts/*
3030

3131
- name: Install dependencies
32-
run: yarn install --frozen-lockfile
32+
run: yarn || yarn || yarn
3333

3434
- name: Build website fast
3535
run: yarn build:website:fast
@@ -64,7 +64,7 @@ jobs:
6464
6565
- name: Add Lighthouse stats as comment
6666
id: comment_to_pr
67-
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # 2.9.0
67+
uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 # 2.9.1
6868
with:
6969
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7070
number: ${{ github.event.pull_request.number }}

.github/workflows/lint-autofix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
ref: ${{ github.head_ref }}
2626

2727
- name: Installation
28-
run: yarn
28+
run: yarn || yarn || yarn
2929

3030
- name: AutoFix Format
3131
run: yarn format

.github/workflows/lint.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,18 @@ jobs:
2222
- name: Checkout
2323
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2424
- name: Set up Node
25-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
25+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
2626
with:
27-
node-version: 20
27+
node-version: lts/*
2828
cache: yarn
2929
- name: Installation
30-
run: yarn
31-
# run: yarn install --immutable # Fails if yarn.lock is modified (unfortunately only works for Yarn 2, and --frozen-lockfile is not the same!)
30+
run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile
3231
- name: Check immutable yarn.lock
3332
run: git diff --exit-code
3433

3534
- name: Check for suspicious yarn.lock
3635
# for allowed aliases, see https://github.com/yargs/cliui/pull/139/files#r1670711112
37-
run: yarn lockfile-lint --path yarn.lock --type yarn --allowed-hosts yarn --validate-https --validate-package-names --validate-integrity --empty-hostname=false --allowed-package-name-aliases react-loadable string-width-cjs strip-ansi-cjs wrap-ansi-cjs
36+
run: yarn lockfile-lint --path yarn.lock --type yarn --allowed-hosts yarn --validate-https --validate-package-names --validate-integrity --empty-hostname=false --allowed-package-name-aliases react-loadable react-helmet-async string-width-cjs strip-ansi-cjs wrap-ansi-cjs
3837

3938
- name: Lint
4039
run: |

.github/workflows/showcase-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2626
- name: Set up Node
27-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
27+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
2828
with:
29-
node-version: 20
29+
node-version: lts/*
3030
cache: yarn
3131
- name: Installation
32-
run: yarn
32+
run: yarn || yarn || yarn
3333
- name: Test
3434
run: yarn test website/src/data/__tests__/user.test.ts

0 commit comments

Comments
 (0)