From a1ca456416922857bbe3eda9c2fca6b0a52e7393 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Wed, 29 Apr 2026 15:33:46 +0800 Subject: [PATCH 1/9] chore: migrate from Prettier to oxfmt for code formatting --- .github/workflows/lint-autofix.yml | 2 +- .github/workflows/lint.yml | 2 +- .lintstagedrc.json | 14 +++++++-- .oxfmtrc.json | 46 ++++++++++++++++++++++++++++++ .prettierignore | 36 ----------------------- .prettierrc | 9 ------ .vscode/extensions.json | 2 +- package.json | 7 ++--- project-words.txt | 2 ++ 9 files changed, 65 insertions(+), 55 deletions(-) create mode 100644 .oxfmtrc.json delete mode 100644 .prettierignore delete mode 100644 .prettierrc diff --git a/.github/workflows/lint-autofix.yml b/.github/workflows/lint-autofix.yml index 7b6253681d38..527b32ab6d79 100644 --- a/.github/workflows/lint-autofix.yml +++ b/.github/workflows/lint-autofix.yml @@ -33,7 +33,7 @@ jobs: - name: Installation run: yarn install --frozen-lockfile || yarn install --frozen-lockfile || yarn install --frozen-lockfile - - name: AutoFix Format + - name: AutoFix Formatting run: yarn format - name: AutoFix JS diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0c96849f5480..0dfb0be50caa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,5 +36,5 @@ jobs: echo "::add-matcher::.github/workflows/cspell-problem-matcher.json" yarn lint:ci - - name: Prettier Code + - name: Check Formatting run: yarn format:diff diff --git a/.lintstagedrc.json b/.lintstagedrc.json index f526fd4b5bc0..6ac67b360acc 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,5 +1,13 @@ { - "*.{js,jsx,ts,tsx,mjs}": ["eslint --fix"], - "*.css": ["stylelint --allow-empty-input --fix"], - "*": ["prettier --ignore-unknown --write"] + "*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}": [ + "eslint --fix", + "oxfmt --no-error-on-unmatched-pattern" + ], + "*.{css,scss,less}": [ + "stylelint --allow-empty-input --fix", + "oxfmt --no-error-on-unmatched-pattern" + ], + "*.{json,jsonc,json5,md,mdx,html,yml,yaml,toml}": [ + "oxfmt --no-error-on-unmatched-pattern" + ] } diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 000000000000..4d48c5b15bdd --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,46 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "arrowParens": "always", + "bracketSameLine": true, + "bracketSpacing": false, + "ignorePatterns": [ + "dist", + "node_modules", + ".yarn", + "**/build/**", + "coverage", + ".docusaurus", + ".idea", + ".svg", + "*.svg", + "jest/vendor", + "argos/test-results", + "packages/lqip-loader/lib/", + "packages/docusaurus/lib/", + "packages/docusaurus-*/lib/*", + "packages/create-docusaurus/lib/*", + "packages/create-docusaurus/templates/*/docusaurus.config.js", + "packages/eslint-plugin/lib/", + "packages/stylelint-copyright/lib/", + "__fixtures__", + "website/i18n", + "website/versions.json", + "website/docusaurus.config.js", + "website/versioned_docs/", + "website/versioned_sidebars/*.json", + "examples/", + "website/static/katex/katex.min.css", + "website/changelog", + "website/_dogfooding/_swizzle_theme_tests", + "website/_dogfooding/_asset-tests/badSyntax.js", + "website/_dogfooding/_asset-tests/badSyntax.css", + "*.xml", + "*.xsl" + ], + "insertFinalNewline": true, + "printWidth": 80, + "proseWrap": "never", + "singleQuote": true, + "sortPackageJson": false, + "trailingComma": "all" +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index c611d3a49e72..000000000000 --- a/.prettierignore +++ /dev/null @@ -1,36 +0,0 @@ -dist -node_modules -.yarn -**/build/** -coverage -.docusaurus -.idea - -.svg -*.svg - -jest/vendor - -argos/test-results - -packages/lqip-loader/lib/ -packages/docusaurus/lib/ -packages/docusaurus-*/lib/* -packages/create-docusaurus/lib/* -packages/create-docusaurus/templates/*/docusaurus.config.js -packages/eslint-plugin/lib/ -packages/stylelint-copyright/lib/ -__fixtures__ - -website/i18n -website/versions.json -website/docusaurus.config.js -website/versioned_sidebars/*.json - -examples/ -website/static/katex/katex.min.css - -website/changelog -website/_dogfooding/_swizzle_theme_tests -website/_dogfooding/_asset-tests/badSyntax.js -website/_dogfooding/_asset-tests/badSyntax.css diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index d17d2ebb79c0..000000000000 --- a/.prettierrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "arrowParens": "always", - "bracketSpacing": false, - "bracketSameLine": true, - "printWidth": 80, - "proseWrap": "never", - "singleQuote": true, - "trailingComma": "all" -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3a5fabe0c6af..d37cec73007c 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,7 +2,7 @@ // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. "recommendations": [ "streetsidesoftware.code-spell-checker", - "esbenp.prettier-vscode", + "oxc.oxc-vscode", "dbaeumer.vscode-eslint", "stylelint.vscode-stylelint", "EditorConfig.EditorConfig", diff --git a/package.json b/package.json index b768086ee895..51c9113521d3 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,8 @@ "changelog": "lerna-changelog", "postinstall": "patch-package && yarn lock:update && yarn build:packages", "prepare": "husky install", - "format": "prettier --write .", - "format:diff": "prettier --list-different .", + "format": "oxfmt .", + "format:diff": "oxfmt --list-different .", "lint": "yarn lint:js && yarn lint:style && yarn lint:spelling && yarn lint:syncpack", "lint:ci": "yarn lint:js --quiet && yarn lint:style && yarn lint:spelling && yarn lint:syncpack", "lint:js": "eslint --cache --report-unused-disable-directives \"**/*.{js,jsx,ts,tsx,mjs}\"", @@ -79,7 +79,6 @@ "devDependencies": { "@ai-sdk/react": "^2.0.30", "@crowdin/cli": "^3.13.0", - "@prettier/plugin-xml": "^2.2.0", "@swc/core": "^1.7.39", "@swc/jest": "^0.2.39", "@testing-library/dom": "^10.4.1", @@ -122,7 +121,7 @@ "patch-package": "^8.0.0", "pkg-pr-new": "^0.0.66", "postinstall-postinstall": "^2.1.0", - "prettier": "^2.8.8", + "oxfmt": "^0.41.0", "react": "^19.2.0", "react-dom": "^19.2.0", "rimraf": "^3.0.2", diff --git a/project-words.txt b/project-words.txt index ace33eb4eff6..61485e8f99cc 100644 --- a/project-words.txt +++ b/project-words.txt @@ -209,6 +209,8 @@ orta osascript Outerbounds outerbounds +Oxfmt +oxfmt overrideable ozaki ozakione From 6b0606fea6dc98009ef5b2037ec509900847b79c Mon Sep 17 00:00:00 2001 From: Yangshun Date: Wed, 29 Apr 2026 15:37:30 +0800 Subject: [PATCH 2/9] chore: bump oxfmt to ^0.47.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 51c9113521d3..75499b219ec7 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "patch-package": "^8.0.0", "pkg-pr-new": "^0.0.66", "postinstall-postinstall": "^2.1.0", - "oxfmt": "^0.41.0", + "oxfmt": "^0.47.0", "react": "^19.2.0", "react-dom": "^19.2.0", "rimraf": "^3.0.2", From 58a2c111a56cd83be19f3e1ddb1886da12868052 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Wed, 29 Apr 2026 16:42:38 +0800 Subject: [PATCH 3/9] chore: update package build scripts to use oxfmt Replace prettier invocation in per-package build scripts and refresh yarn.lock after switching from prettier to oxfmt. --- packages/docusaurus-plugin-debug/package.json | 2 +- .../package.json | 2 +- packages/docusaurus-plugin-pwa/package.json | 2 +- .../docusaurus-theme-classic/package.json | 2 +- .../package.json | 2 +- .../docusaurus-theme-mermaid/package.json | 2 +- .../package.json | 2 +- yarn.lock | 159 ++++++++++++++---- 8 files changed, 134 insertions(+), 39 deletions(-) diff --git a/packages/docusaurus-plugin-debug/package.json b/packages/docusaurus-plugin-debug/package.json index 9eeea27ef365..d9cdb8484705 100644 --- a/packages/docusaurus-plugin-debug/package.json +++ b/packages/docusaurus-plugin-debug/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "src/plugin-debug.d.ts", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-plugin-ideal-image/package.json b/packages/docusaurus-plugin-ideal-image/package.json index 64ae71550965..b3290f84fe2d 100644 --- a/packages/docusaurus-plugin-ideal-image/package.json +++ b/packages/docusaurus-plugin-ideal-image/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "src/plugin-ideal-image.d.ts", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-plugin-pwa/package.json b/packages/docusaurus-plugin-pwa/package.json index 2384c7846434..2ddc893a275c 100644 --- a/packages/docusaurus-plugin-pwa/package.json +++ b/packages/docusaurus-plugin-pwa/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "src/plugin-pwa.d.ts", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-classic/package.json b/packages/docusaurus-theme-classic/package.json index 9304ec9c5d8b..93ba4053e45b 100644 --- a/packages/docusaurus-theme-classic/package.json +++ b/packages/docusaurus-theme-classic/package.json @@ -14,7 +14,7 @@ }, "license": "MIT", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-live-codeblock/package.json b/packages/docusaurus-theme-live-codeblock/package.json index 0a383730ffdc..fb277f4f5210 100644 --- a/packages/docusaurus-theme-live-codeblock/package.json +++ b/packages/docusaurus-theme-live-codeblock/package.json @@ -23,7 +23,7 @@ "access": "public" }, "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-mermaid/package.json b/packages/docusaurus-theme-mermaid/package.json index 167554073aab..ad9b74d708e0 100644 --- a/packages/docusaurus-theme-mermaid/package.json +++ b/packages/docusaurus-theme-mermaid/package.json @@ -27,7 +27,7 @@ }, "license": "MIT", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-search-algolia/package.json b/packages/docusaurus-theme-search-algolia/package.json index 7574c9f0e7cd..c5d008859485 100644 --- a/packages/docusaurus-theme-search-algolia/package.json +++ b/packages/docusaurus-theme-search-algolia/package.json @@ -27,7 +27,7 @@ }, "license": "MIT", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/yarn.lock b/yarn.lock index c4b0aada060d..ec5d7fa13d90 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3426,6 +3426,101 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== +"@oxfmt/binding-android-arm-eabi@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.47.0.tgz#5516a2c695e6d45829b2c98a01d9528b0b6e61a0" + integrity sha512-KrMQRdMi/upr81qT4ijK6X6BNp6jqpMY7FwILQnwIy9QLc3qpnhUx5rsCLGzn4ewsCQ0CNAspN2ogmP1GXLyLw== + +"@oxfmt/binding-android-arm64@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.47.0.tgz#85ea358f46a73f2485343fe12c5223fdb50c069d" + integrity sha512-r4ixS/PeUpAFKgrpDoZ5pSkthjZzVzKd95525Aazj+aOv9H4ulK5zYHGb7wFY5n5kZxHK8TbOJUZgoEb1ohddQ== + +"@oxfmt/binding-darwin-arm64@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.47.0.tgz#90c757ac8d87b4ede92965aec61eac94e47ff6dd" + integrity sha512-CLWxiKpMl+195cm09CuaWEhJK0CirRkoMa07aR9+9AFPat2LfIKtwx1JqxZM0MTvcMe6+adlJNdVL6jdInvq3g== + +"@oxfmt/binding-darwin-x64@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.47.0.tgz#1ebcf47ed790e31441e73ecaeee441f6ab0fe0fb" + integrity sha512-Xq5fjTYDC50faUeLSm0rZdBqoTgleXEdD7NpJdARtQIczkCJn3xNjMUSQQkUmh4CtxkKTNL68lytcOK3e/osgg== + +"@oxfmt/binding-freebsd-x64@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.47.0.tgz#99eaea7abd9ba897b697eabcffc1c475e78cb6b7" + integrity sha512-QOU9ZIJ52p5askcEC0QJvvr8trHAWoonul8bgISo6gYUL3s50zkqafBYcNAr9LJZQbsZtPfIWHk9+5+nUp1qJQ== + +"@oxfmt/binding-linux-arm-gnueabihf@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.47.0.tgz#9166b54e49e3311f1337ed085ddea7884def2762" + integrity sha512-oJxDM1aBhPvz9gmElBv8UpxyiqhwfjcbrSxT5F0xtuUzY6dQI27/AQPIt3eu3Z5Yvn0kQl5R7MA3Z+MbnRvCBw== + +"@oxfmt/binding-linux-arm-musleabihf@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.47.0.tgz#665bd22db9a926533e1c22354a6f516a1151ecac" + integrity sha512-g8Lh50VS4ibGz2q6v7r9UZY4D0dM16SdrFYOMzhqIoCwGcai8VMIRUAcqn1/jlCsOOzUXJ741+kCeJt0cofakQ== + +"@oxfmt/binding-linux-arm64-gnu@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.47.0.tgz#b6f1a0c40557397ec4ad79727bae16636c76c411" + integrity sha512-YrNT1vQ0asaXoRbrvYENPqmBfOQ9Xr8enPNOULeYfg44VjCcrUowFy5QZr+WawE0zyP8cH9e9Gxxg0fDEFzhcg== + +"@oxfmt/binding-linux-arm64-musl@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.47.0.tgz#9617da44d91b4bb0a679ec1504eb0aa0c919fbb1" + integrity sha512-IxtQC/sbBi4ubbY+MdwdanRWrG9InQJVZqyMsBa5IUaQcnSg86gQme574HxXMC1p4bo4YhV99zQ+wNnGCvEgzw== + +"@oxfmt/binding-linux-ppc64-gnu@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.47.0.tgz#6e672e383178bd0a90b5685d9e513d60a66ba818" + integrity sha512-EWXEhOMbWO0q6eJSbu0QLkU8cKi0ljlYLngeDs2Ocu/pm1rrLwyQiYzlFbdnMRURI4w9ndr1sI9rSbhlJ5o23Q== + +"@oxfmt/binding-linux-riscv64-gnu@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.47.0.tgz#68563084137eb3ca353af0d55739fdbf49a667a0" + integrity sha512-tZrjS11TUiDuEpRaqdk8K9F9xETRyKXfuZKmdeW+Gj7coBnm7+8sBEfyt033EAFEQSlkniAXvBLh+Qja2ioGBQ== + +"@oxfmt/binding-linux-riscv64-musl@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.47.0.tgz#6a2f0d5f159d86e16691753a49c7e78027e8e568" + integrity sha512-KBFy+2CFKUCZzYwX2ZOPQKck1vjQbz+hextuc19G4r0WRJwadfAeuQMQRQvB+Ivc8brlbOVg7et8K7E467440g== + +"@oxfmt/binding-linux-s390x-gnu@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.47.0.tgz#888c1e9db152c68e51ebe3c4b21a8c2fc5331f07" + integrity sha512-REUPFKVGSiK99B+9eaPhluEVglzaoj/SMykNC5SUiV2RSsBfV5lWN7Y0iCIc251Wz3GaeAGZsJ/zj3gjarxdFg== + +"@oxfmt/binding-linux-x64-gnu@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.47.0.tgz#8a279adaa8a404acc661b5ba915cc72ac6e15626" + integrity sha512-KVftVSVEDeIfRW3TIeLe3aNI/iY4m1fu5mDwHcisKMZSCMKLkrhFsjowC7o9RoqNPxbbglm2+/6KAKBIts2t0Q== + +"@oxfmt/binding-linux-x64-musl@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.47.0.tgz#e8ecc62fd533255298f316f64ed1d25553ea147d" + integrity sha512-DTsmGEaA2860Aq5VUyDO8/MT9NFxwVL93RnRYmpMwK6DsSkThmvEpqoUDDljziEpAedMRG19SCogrNbINSbLUQ== + +"@oxfmt/binding-openharmony-arm64@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.47.0.tgz#96ee2865d75c0fc8a65416ad8866218ba47c394d" + integrity sha512-8r5BDro7fLOBoq1JXHLVSs55OlrxQhEso4HVo0TcY7OXJUPYfjPoOaYL5us+yIwqyP9rQwN+rxuiNFSmaxSuOQ== + +"@oxfmt/binding-win32-arm64-msvc@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.47.0.tgz#ca4025455656510653c8491809efa83cb5c0cb70" + integrity sha512-qtz/gzm8IjSPUlseZ0ofW8zyHLoZsuP5HTfcGGkWkUblB89JT8GNYH3ICqjbDsqsGqXum0/ZndXTFplSdXFIcg== + +"@oxfmt/binding-win32-ia32-msvc@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.47.0.tgz#66a3379214661b6a738da74ea5fd09ce4d55390c" + integrity sha512-5vIcdcIDE7nCx+MXN6sm8kbC4zajDB31E86rez4i45iHNH/2NjdKlJ720xcHTr3eeiMcttCGPHPhE1TjtBDGZw== + +"@oxfmt/binding-win32-x64-msvc@0.47.0": + version "0.47.0" + resolved "https://registry.yarnpkg.com/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.47.0.tgz#ad962adfc251270125f98b107a985d1365ce6b07" + integrity sha512-Sr59Y5ms54ONBjxFeWhVlGyQcHXxcl9DxC23f6yXlRkcos7LXBLoO+KDfxexjHIOZh7cWqrWduzvUjJ+pHp8cQ== + "@parcel/watcher@2.0.4": version "2.0.4" resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.0.4.tgz#f300fef4cc38008ff4b8c29d92588eced3ce014b" @@ -3615,14 +3710,6 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.28.tgz#d45e01c4a56f143ee69c54dd6b12eade9e270a73" integrity sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw== -"@prettier/plugin-xml@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@prettier/plugin-xml/-/plugin-xml-2.2.0.tgz#2bc2ae667aa817369fdb939aa7d36ea88105483d" - integrity sha512-UWRmygBsyj4bVXvDiqSccwT1kmsorcwQwaIy30yVh8T+Gspx4OlC0shX1y+ZuwXZvgnafmpRYKks0bAu9urJew== - dependencies: - "@xml-tools/parser" "^1.0.11" - prettier ">=2.4.0" - "@rollup/plugin-babel@^5.2.0": version "5.3.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" @@ -5559,13 +5646,6 @@ "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" -"@xml-tools/parser@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@xml-tools/parser/-/parser-1.0.11.tgz#a118a14099ea5c3c537e4781fad2fc195b57f8ff" - integrity sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA== - dependencies: - chevrotain "7.1.1" - "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -6769,13 +6849,6 @@ chevrotain-allstar@~0.3.0: dependencies: lodash-es "^4.17.21" -chevrotain@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-7.1.1.tgz#5122814eafd1585a9601f9180a7be9c42d5699c6" - integrity sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw== - dependencies: - regexp-to-ast "0.5.0" - chevrotain@~11.0.3: version "11.0.3" resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-11.0.3.tgz#88ffc1fb4b5739c715807eaeedbbf200e202fc1b" @@ -14498,6 +14571,33 @@ os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== +oxfmt@^0.47.0: + version "0.47.0" + resolved "https://registry.yarnpkg.com/oxfmt/-/oxfmt-0.47.0.tgz#34faf46a5f7c22138ac9d566ac28be7c52e8ca98" + integrity sha512-OFbkbzxKCpooQEnRmpTDnuwTX8KHXzZTQ4Df/hz85fpS67Pl+lxPEFvUtin56HIIS0B1k4X8oIzTXRZPufA2CA== + dependencies: + tinypool "2.1.0" + optionalDependencies: + "@oxfmt/binding-android-arm-eabi" "0.47.0" + "@oxfmt/binding-android-arm64" "0.47.0" + "@oxfmt/binding-darwin-arm64" "0.47.0" + "@oxfmt/binding-darwin-x64" "0.47.0" + "@oxfmt/binding-freebsd-x64" "0.47.0" + "@oxfmt/binding-linux-arm-gnueabihf" "0.47.0" + "@oxfmt/binding-linux-arm-musleabihf" "0.47.0" + "@oxfmt/binding-linux-arm64-gnu" "0.47.0" + "@oxfmt/binding-linux-arm64-musl" "0.47.0" + "@oxfmt/binding-linux-ppc64-gnu" "0.47.0" + "@oxfmt/binding-linux-riscv64-gnu" "0.47.0" + "@oxfmt/binding-linux-riscv64-musl" "0.47.0" + "@oxfmt/binding-linux-s390x-gnu" "0.47.0" + "@oxfmt/binding-linux-x64-gnu" "0.47.0" + "@oxfmt/binding-linux-x64-musl" "0.47.0" + "@oxfmt/binding-openharmony-arm64" "0.47.0" + "@oxfmt/binding-win32-arm64-msvc" "0.47.0" + "@oxfmt/binding-win32-ia32-msvc" "0.47.0" + "@oxfmt/binding-win32-x64-msvc" "0.47.0" + p-cancelable@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" @@ -15662,11 +15762,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@>=2.4.0, prettier@^2.8.8: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== - pretty-ansi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pretty-ansi/-/pretty-ansi-3.0.0.tgz#b388a08b49ded78b9390848bc101ee534cb69492" @@ -16311,11 +16406,6 @@ regexp-ast-analysis@^0.6.0: "@eslint-community/regexpp" "^4.5.0" refa "^0.11.0" -regexp-to-ast@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz#56c73856bee5e1fef7f73a00f1473452ab712a24" - integrity sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw== - regexp.prototype.flags@^1.5.2: version "1.5.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz#b3ae40b1d2499b8350ab2c3fe6ef3845d3a96f42" @@ -18220,6 +18310,11 @@ tinyglobby@^0.2.12, tinyglobby@^0.2.9: fdir "^6.5.0" picomatch "^4.0.3" +tinypool@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-2.1.0.tgz#303a671d6ef68d03c9512cdc9a47c86b8a85f20c" + integrity sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw== + tinypool@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-1.0.2.tgz#706193cc532f4c100f66aa00b01c42173d9051b2" From 7d8404559cc31c5112f2cf91b3764086209213e9 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Wed, 29 Apr 2026 16:43:04 +0800 Subject: [PATCH 4/9] chore: format codebase with oxfmt --- AGENTS.md | 1 - CHANGELOG-v2.md | 3 -- __tests__/validate-tsconfig.test.ts | 5 +- admin/new.docusaurus.io/netlify.toml | 36 +++++++------- packages/create-docusaurus/src/index.ts | 4 +- packages/docusaurus-mdx-loader/src/utils.ts | 2 +- .../assets/atom.css | 8 ++- .../assets/rss.css | 8 ++- .../src/feed.ts | 4 +- .../src/sidebars/generator.ts | 2 +- .../src/versions/files.ts | 2 +- .../src/plugin-ideal-image.d.ts | 6 ++- .../src/nprogress.css | 3 +- .../docusaurus-theme-classic/src/options.ts | 4 +- .../theme/DocSidebarItem/Category/index.tsx | 4 +- .../src/theme/SearchBar/index.tsx | 3 +- .../docusaurus-theme-translations/update.mjs | 4 +- packages/docusaurus-types/src/plugin.d.ts | 8 +-- packages/docusaurus-types/src/swizzle.d.ts | 19 +++---- .../src/__tests__/pathUtils.test.ts | 6 +-- .../docusaurus-utils/src/lastUpdateUtils.ts | 4 +- .../src/markdownHeadingIdUtils.ts | 4 +- .../docusaurus-utils/src/markdownLinks.ts | 2 +- packages/docusaurus-utils/src/urlUtils.ts | 8 +-- .../src/client/BaseUrlIssueBanner/index.tsx | 4 +- .../src/commands/swizzle/components.ts | 4 +- .../src/commands/writeTranslations.ts | 5 +- .../server/plugins/__tests__/plugins.test.ts | 2 +- .../src/server/translations/translations.ts | 2 +- .../_blog tests/2022-01-21-dup-footnote.mdx | 2 + .../_blog tests/2022-01-22-dup-footnote.mdx | 2 + .../_blog tests/2022-04-20-dup-footnote.mdx | 2 + .../_dogfooding/_blog tests/custom-atom.css | 8 ++- .../_dogfooding/_blog tests/custom-rss.css | 8 ++- .../_docs tests/tests/footnotes.mdx | 49 +++++++++++++++++++ .../_pages tests/code-block-tests.mdx | 10 ++-- .../blog/2018/09-11-Towards-Docusaurus-2.mdx | 7 +-- website/blog/releases/3.8/index.mdx | 10 ++-- website/docs/browser-support.mdx | 4 +- website/docs/deployment.mdx | 4 -- website/docusaurus.config.ts | 8 +-- website/netlify.toml | 24 +++++---- .../BrowserWindow/styles.module.css | 4 +- .../src/components/TeamProfileCards/index.tsx | 4 +- website/src/data/tweets.tsx | 19 +++---- .../OperatorButton/styles.module.css | 3 +- .../plugins/featureRequests/cannyScript.js | 10 ++-- website/static/pure-html.html | 2 +- 48 files changed, 207 insertions(+), 140 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6056cc6cc490..a871f9c4389e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,6 @@ Docusaurus uses itself to build its own website, which serves as both documentat ### Monorepo Structure - `packages/` - Core Docusaurus packages and plugins, published to npm - - `docusaurus/` - Main CLI and core functionality - `docusaurus-plugin-*` - Official plugins, the main ones are `docs`, `blog`, `pages` - `docusaurus-theme-classic/` - Default theme, based on the Infima.dev design system and CSS modules diff --git a/CHANGELOG-v2.md b/CHANGELOG-v2.md index d1fea7c77a46..2f70ccf634c9 100644 --- a/CHANGELOG-v2.md +++ b/CHANGELOG-v2.md @@ -5503,9 +5503,7 @@ Bad release, check ## 2.0.0-alpha.58 #### :boom: Breaking Change - `infima` - - The following Infima classes have been renamed for consistency: - - `page-item` → `pagination__item` - `pagination-nav__link--label` → `pagination-nav__label` - `pagination-nav__link--sublabel` → `pagination-nav__sublabel` @@ -5515,7 +5513,6 @@ Bad release, check ## 2.0.0-alpha.58 If you have swizzled components, you need to replace these class names. - `docusaurus` - - [#2764](https://github.com/facebook/docusaurus/pull/2764) feat(v2): allow import SVG images ([@lex111](https://github.com/lex111)) #### :rocket: New Feature diff --git a/__tests__/validate-tsconfig.test.ts b/__tests__/validate-tsconfig.test.ts index 9253a7e6d693..17eb983fde66 100644 --- a/__tests__/validate-tsconfig.test.ts +++ b/__tests__/validate-tsconfig.test.ts @@ -47,9 +47,8 @@ describe('tsconfig files', () => { try { Joi.attempt(file.content, tsconfigSchema); } catch (e) { - ( - e as Error - ).message += `\n${file.file} does not match the required schema.`; + (e as Error).message += + `\n${file.file} does not match the required schema.`; throw e; } }); diff --git a/admin/new.docusaurus.io/netlify.toml b/admin/new.docusaurus.io/netlify.toml index 872eed87ce29..82190b133a13 100644 --- a/admin/new.docusaurus.io/netlify.toml +++ b/admin/new.docusaurus.io/netlify.toml @@ -3,31 +3,31 @@ directory = "functions" [[redirects]] -from = "/" -to = "/.netlify/functions/index" -status = 200 +from = "/" +to = "/.netlify/functions/index" +status = 200 [[redirects]] -from = "/codesandbox" -to = "/.netlify/functions/codesandbox" -status = 200 +from = "/codesandbox" +to = "/.netlify/functions/codesandbox" +status = 200 [[redirects]] -from = "/codesandbox-ts" -to = "/.netlify/functions/codesandbox-ts" -status = 200 +from = "/codesandbox-ts" +to = "/.netlify/functions/codesandbox-ts" +status = 200 [[redirects]] -from = "/stackblitz" -to = "/.netlify/functions/stackblitz" -status = 200 +from = "/stackblitz" +to = "/.netlify/functions/stackblitz" +status = 200 [[redirects]] -from = "/stackblitz-ts" -to = "/.netlify/functions/stackblitz-ts" -status = 200 +from = "/stackblitz-ts" +to = "/.netlify/functions/stackblitz-ts" +status = 200 [[redirects]] -from = "/*" -to = "/.netlify/functions/index" -status = 200 +from = "/*" +to = "/.netlify/functions/index" +status = 200 diff --git a/packages/create-docusaurus/src/index.ts b/packages/create-docusaurus/src/index.ts index 582262146132..266f96d7220b 100755 --- a/packages/create-docusaurus/src/index.ts +++ b/packages/create-docusaurus/src/index.ts @@ -626,8 +626,8 @@ export default async function init( pkgManager === 'yarn' ? 'yarn' : pkgManager === 'bun' - ? 'bun install' - : `${pkgManager} install --color always`, + ? 'bun install' + : `${pkgManager} install --color always`, [], { env: { diff --git a/packages/docusaurus-mdx-loader/src/utils.ts b/packages/docusaurus-mdx-loader/src/utils.ts index eddca6ac56fc..30ed0506fe4c 100644 --- a/packages/docusaurus-mdx-loader/src/utils.ts +++ b/packages/docusaurus-mdx-loader/src/utils.ts @@ -119,7 +119,7 @@ export async function compileToJSX({ const errorDetails = errorJSON === '{}' ? // regular JS error case: print stacktrace - error.stack ?? 'N/A' + (error.stack ?? 'N/A') : // MDX error: print extra attributes + stacktrace `${errorJSON}\n${error.stack}`; diff --git a/packages/docusaurus-plugin-content-blog/assets/atom.css b/packages/docusaurus-plugin-content-blog/assets/atom.css index d2fc20b27416..34e60c0ba022 100644 --- a/packages/docusaurus-plugin-content-blog/assets/atom.css +++ b/packages/docusaurus-plugin-content-blog/assets/atom.css @@ -11,7 +11,13 @@ main { margin: 2rem auto; max-width: 800px; /* stylelint-disable-next-line font-family-name-quotes */ - font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; + font-family: + system-ui, + -apple-system, + Segoe UI, + Roboto, + Ubuntu, + Cantarell; } .info { diff --git a/packages/docusaurus-plugin-content-blog/assets/rss.css b/packages/docusaurus-plugin-content-blog/assets/rss.css index d2fc20b27416..34e60c0ba022 100644 --- a/packages/docusaurus-plugin-content-blog/assets/rss.css +++ b/packages/docusaurus-plugin-content-blog/assets/rss.css @@ -11,7 +11,13 @@ main { margin: 2rem auto; max-width: 800px; /* stylelint-disable-next-line font-family-name-quotes */ - font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; + font-family: + system-ui, + -apple-system, + Segoe UI, + Roboto, + Ubuntu, + Cantarell; } .info { diff --git a/packages/docusaurus-plugin-content-blog/src/feed.ts b/packages/docusaurus-plugin-content-blog/src/feed.ts index 55dc59703747..1803c43b5e3e 100644 --- a/packages/docusaurus-plugin-content-blog/src/feed.ts +++ b/packages/docusaurus-plugin-content-blog/src/feed.ts @@ -196,8 +196,8 @@ async function resolveXsltFilePaths({ }) { const xsltAbsolutePath: string = path.isAbsolute(xsltFilePath) ? xsltFilePath - : (await getDataFilePath({filePath: xsltFilePath, contentPaths})) ?? - path.resolve(contentPaths.contentPath, xsltFilePath); + : ((await getDataFilePath({filePath: xsltFilePath, contentPaths})) ?? + path.resolve(contentPaths.contentPath, xsltFilePath)); if (!(await fs.pathExists(xsltAbsolutePath))) { throw new Error( diff --git a/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts b/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts index b37536c7e3f6..d78aab9c92a9 100644 --- a/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts +++ b/packages/docusaurus-plugin-content-docs/src/sidebars/generator.ts @@ -206,7 +206,7 @@ Available doc IDs: return undefined; } const id = link - ? findDocByLocalId(link.id)?.id ?? getDoc(link.id).id + ? (findDocByLocalId(link.id)?.id ?? getDoc(link.id).id) : findConventionalCategoryDocLink()?.id; if (!id) { return undefined; diff --git a/packages/docusaurus-plugin-content-docs/src/versions/files.ts b/packages/docusaurus-plugin-content-docs/src/versions/files.ts index d7b8115432f5..824c8092eef3 100644 --- a/packages/docusaurus-plugin-content-docs/src/versions/files.ts +++ b/packages/docusaurus-plugin-content-docs/src/versions/files.ts @@ -145,7 +145,7 @@ export async function readVersionNames( ); } - const versions = options.disableVersioning ? [] : versionFileContent ?? []; + const versions = options.disableVersioning ? [] : (versionFileContent ?? []); // We add the current version at the beginning, unless: // - user don't want to; or diff --git a/packages/docusaurus-plugin-ideal-image/src/plugin-ideal-image.d.ts b/packages/docusaurus-plugin-ideal-image/src/plugin-ideal-image.d.ts index 4739e8a3e8d2..e8f0281dde64 100644 --- a/packages/docusaurus-plugin-ideal-image/src/plugin-ideal-image.d.ts +++ b/packages/docusaurus-plugin-ideal-image/src/plugin-ideal-image.d.ts @@ -118,8 +118,10 @@ declare module '@theme/IdealImageLegacy' { type ThemeKey = 'placeholder' | 'img' | 'icon' | 'noscript'; - export interface ImageProps - extends Omit, 'srcSet' | 'placeholder'> { + export interface ImageProps extends Omit< + ComponentProps<'img'>, + 'srcSet' | 'placeholder' + > { /** * This function decides what icon to show based on the current state of the * component. diff --git a/packages/docusaurus-theme-classic/src/nprogress.css b/packages/docusaurus-theme-classic/src/nprogress.css index 5e369a9c8b09..a61916c25a0c 100644 --- a/packages/docusaurus-theme-classic/src/nprogress.css +++ b/packages/docusaurus-theme-classic/src/nprogress.css @@ -34,7 +34,8 @@ right: 0; width: 100px; height: 100%; - box-shadow: 0 0 10px var(--docusaurus-progress-bar-color), + box-shadow: + 0 0 10px var(--docusaurus-progress-bar-color), 0 0 5px var(--docusaurus-progress-bar-color); opacity: 1; transform: rotate(3deg) translate(0, -4px); diff --git a/packages/docusaurus-theme-classic/src/options.ts b/packages/docusaurus-theme-classic/src/options.ts index f4f84b5b1fbc..4fd46c62c40d 100644 --- a/packages/docusaurus-theme-classic/src/options.ts +++ b/packages/docusaurus-theme-classic/src/options.ts @@ -150,8 +150,8 @@ const itemWithType = (type: string | RegExp | undefined) => { type instanceof RegExp ? Joi.string().required().regex(type) : type - ? Joi.string().required().equal(type) - : Joi.string().forbidden(); + ? Joi.string().required().equal(type) + : Joi.string().forbidden(); return Joi.object({ type: typeSchema, }) diff --git a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx index 8f6a2a84a7bf..f87a0f8867f4 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx @@ -284,7 +284,9 @@ function DocSidebarItemCategoryCollapsible({ aria-current={isCurrentPage ? 'page' : undefined} role={collapsible && !href ? 'button' : undefined} aria-expanded={collapsible && !href ? !collapsed : undefined} - href={collapsible ? hrefWithSSRFallback ?? '#' : hrefWithSSRFallback} + href={ + collapsible ? (hrefWithSSRFallback ?? '#') : hrefWithSSRFallback + } {...props}> diff --git a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx index cf681939b143..821d1d1d6671 100644 --- a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx +++ b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx @@ -140,8 +140,7 @@ function useResultsFooterComponent({ }): DocSearchProps['resultsFooterComponent'] { return useMemo( () => - ({state}) => - , + ({state}) => , [closeModal], ); } diff --git a/packages/docusaurus-theme-translations/update.mjs b/packages/docusaurus-theme-translations/update.mjs index 0c91fafd939f..3331f3f2ec09 100644 --- a/packages/docusaurus-theme-translations/update.mjs +++ b/packages/docusaurus-theme-translations/update.mjs @@ -231,8 +231,8 @@ const messages = locales.map(([name, stat]) => { percentage > 0.99 ? logger.green : percentage > 0.7 - ? logger.yellow - : logger.red; + ? logger.yellow + : logger.red; const progress = color( `[${''.padStart(filled, '=')}${''.padStart(30 - filled, ' ')}]`, ); diff --git a/packages/docusaurus-types/src/plugin.d.ts b/packages/docusaurus-types/src/plugin.d.ts index 25458e9fd8c1..b3378247a4fa 100644 --- a/packages/docusaurus-types/src/plugin.d.ts +++ b/packages/docusaurus-types/src/plugin.d.ts @@ -208,10 +208,10 @@ export type LoadedPlugin = InitializedPlugin & { }; export type PluginModule = { - (context: LoadContext, options: unknown): - | Plugin - | null - | Promise | null>; + ( + context: LoadContext, + options: unknown, + ): Plugin | null | Promise | null>; validateOptions?: (data: OptionValidationContext) => U; validateThemeConfig?: (data: ThemeConfigValidationContext) => T; diff --git a/packages/docusaurus-types/src/swizzle.d.ts b/packages/docusaurus-types/src/swizzle.d.ts index de480fe55d0f..a440c4238af6 100644 --- a/packages/docusaurus-types/src/swizzle.d.ts +++ b/packages/docusaurus-types/src/swizzle.d.ts @@ -32,12 +32,13 @@ export type SwizzleConfig = { export type WrapperProps< // eslint-disable-next-line @typescript-eslint/no-explicit-any T extends keyof JSX.IntrinsicElements | JSXElementConstructor, -> = T extends JSXElementConstructor - ? unknown extends P - ? // eslint-disable-next-line @typescript-eslint/ban-types - {} - : P - : T extends keyof JSX.IntrinsicElements - ? JSX.IntrinsicElements[T] - : // eslint-disable-next-line @typescript-eslint/ban-types - {}; +> = + T extends JSXElementConstructor + ? unknown extends P + ? // eslint-disable-next-line @typescript-eslint/ban-types + {} + : P + : T extends keyof JSX.IntrinsicElements + ? JSX.IntrinsicElements[T] + : // eslint-disable-next-line @typescript-eslint/ban-types + {}; diff --git a/packages/docusaurus-utils/src/__tests__/pathUtils.test.ts b/packages/docusaurus-utils/src/__tests__/pathUtils.test.ts index 5c683e163c7e..b51970e1dbc3 100644 --- a/packages/docusaurus-utils/src/__tests__/pathUtils.test.ts +++ b/packages/docusaurus-utils/src/__tests__/pathUtils.test.ts @@ -28,10 +28,8 @@ describe('isNameTooLong', () => { 'endi-lie-fd3': false, 'yangshun-tay-48d': false, 'yangshun-tay-f3b': false, - 'foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-d46': - true, - 'foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-test-1-test-2-787': - true, + 'foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-d46': true, + 'foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-foo-bar-test-1-test-2-787': true, // Every Han zi is three bytes 字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字字: {apfs: false, xfs: true}, diff --git a/packages/docusaurus-utils/src/lastUpdateUtils.ts b/packages/docusaurus-utils/src/lastUpdateUtils.ts index 8f8acfd43716..0f1a44e86887 100644 --- a/packages/docusaurus-utils/src/lastUpdateUtils.ts +++ b/packages/docusaurus-utils/src/lastUpdateUtils.ts @@ -89,11 +89,11 @@ export async function readLastUpdateData( }); const lastUpdatedBy = showLastUpdateAuthor - ? frontMatterAuthor ?? (await getLastUpdateBy()) + ? (frontMatterAuthor ?? (await getLastUpdateBy())) : undefined; const lastUpdatedAt = showLastUpdateTime - ? frontMatterTimestamp ?? (await getLastUpdateAt()) + ? (frontMatterTimestamp ?? (await getLastUpdateAt())) : undefined; return { diff --git a/packages/docusaurus-utils/src/markdownHeadingIdUtils.ts b/packages/docusaurus-utils/src/markdownHeadingIdUtils.ts index 70d9bb8c1d84..9d49abffcaba 100644 --- a/packages/docusaurus-utils/src/markdownHeadingIdUtils.ts +++ b/packages/docusaurus-utils/src/markdownHeadingIdUtils.ts @@ -194,8 +194,8 @@ export function writeMarkdownHeadingId( const headingId = overwrite ? undefined : migrate - ? parsedHeading.id - : undefined; + ? parsedHeading.id + : undefined; return addHeadingId( parsedHeading.text, diff --git a/packages/docusaurus-utils/src/markdownLinks.ts b/packages/docusaurus-utils/src/markdownLinks.ts index 5a7ad51495d8..37a0434cf4d2 100644 --- a/packages/docusaurus-utils/src/markdownLinks.ts +++ b/packages/docusaurus-utils/src/markdownLinks.ts @@ -98,6 +98,6 @@ export function resolveMarkdownLinkPathname( ); return aliasedSourceMatch - ? sourceToPermalink.get(aliasedSourceMatch) ?? null + ? (sourceToPermalink.get(aliasedSourceMatch) ?? null) : null; } diff --git a/packages/docusaurus-utils/src/urlUtils.ts b/packages/docusaurus-utils/src/urlUtils.ts index 8cbe926202c6..98bf0123527a 100644 --- a/packages/docusaurus-utils/src/urlUtils.ts +++ b/packages/docusaurus-utils/src/urlUtils.ts @@ -190,8 +190,8 @@ export function toURLPath(url: URL): URLPath { const search = url.search ? url.search.slice(1) : url.href.includes('?') - ? '' - : undefined; + ? '' + : undefined; // Fixes annoying url.hash behavior // "" => undefined @@ -200,8 +200,8 @@ export function toURLPath(url: URL): URLPath { const hash = url.hash ? url.hash.slice(1) : url.href.includes('#') - ? '' - : undefined; + ? '' + : undefined; return { pathname, diff --git a/packages/docusaurus/src/client/BaseUrlIssueBanner/index.tsx b/packages/docusaurus/src/client/BaseUrlIssueBanner/index.tsx index b5c10996cd47..e378195f72ad 100644 --- a/packages/docusaurus/src/client/BaseUrlIssueBanner/index.tsx +++ b/packages/docusaurus/src/client/BaseUrlIssueBanner/index.tsx @@ -32,8 +32,8 @@ function createInlineHtmlBanner(baseUrl: string) {

Your Docusaurus site did not load properly.

A very common reason is a wrong site baseUrl configuration.

Current configured baseUrl = ${baseUrl} ${ - baseUrl === '/' ? ' (default value)' : '' - }

+ baseUrl === '/' ? ' (default value)' : '' + }

We suggest trying baseUrl =

`; diff --git a/packages/docusaurus/src/commands/swizzle/components.ts b/packages/docusaurus/src/commands/swizzle/components.ts index 50ae374a6765..87daaea3f897 100644 --- a/packages/docusaurus/src/commands/swizzle/components.ts +++ b/packages/docusaurus/src/commands/swizzle/components.ts @@ -79,9 +79,7 @@ export async function readComponentNames(themePath: string): Promise { async function walk(dir: string): Promise { const files: File[] = await Promise.all( - ( - await fs.readdir(dir) - ).flatMap(async (file) => { + (await fs.readdir(dir)).flatMap(async (file) => { const fullPath = path.join(dir, file); const stat = await fs.stat(fullPath); const isDir = stat.isDirectory(); diff --git a/packages/docusaurus/src/commands/writeTranslations.ts b/packages/docusaurus/src/commands/writeTranslations.ts index ab577806faa3..ff05f2ba852d 100644 --- a/packages/docusaurus/src/commands/writeTranslations.ts +++ b/packages/docusaurus/src/commands/writeTranslations.ts @@ -106,9 +106,8 @@ Available locales are: ${context.i18n.locales.join(',')}.`, extraSourceCodeFilePaths: await getExtraSourceCodeFilePaths(), }); - const defaultCodeMessages = await loadPluginsDefaultCodeTranslationMessages( - plugins, - ); + const defaultCodeMessages = + await loadPluginsDefaultCodeTranslationMessages(plugins); const codeTranslations = applyDefaultCodeTranslations({ extractedCodeTranslations, diff --git a/packages/docusaurus/src/server/plugins/__tests__/plugins.test.ts b/packages/docusaurus/src/server/plugins/__tests__/plugins.test.ts index b62276638b1b..7ac41662e42c 100644 --- a/packages/docusaurus/src/server/plugins/__tests__/plugins.test.ts +++ b/packages/docusaurus/src/server/plugins/__tests__/plugins.test.ts @@ -292,7 +292,7 @@ describe('loadPlugins', () => { someAttributeGlobal: this.someAttribute, }); }, - } as Plugin & ThisType<{someAttribute: string}>), + }) as Plugin & ThisType<{someAttribute: string}>, ); expect(plugin.content).toMatchInlineSnapshot(`"val"`); diff --git a/packages/docusaurus/src/server/translations/translations.ts b/packages/docusaurus/src/server/translations/translations.ts index 51140f33477f..2e63537e3e0f 100644 --- a/packages/docusaurus/src/server/translations/translations.ts +++ b/packages/docusaurus/src/server/translations/translations.ts @@ -92,7 +92,7 @@ function mergeTranslationFileContent({ // If messages already exist, we don't override them (unless requested) message: options.override ? message - : existingContent[key]?.message ?? message, + : (existingContent[key]?.message ?? message), description, }; }, diff --git a/website/_dogfooding/_blog tests/2022-01-21-dup-footnote.mdx b/website/_dogfooding/_blog tests/2022-01-21-dup-footnote.mdx index efbec159e70d..9a92f9b6af2b 100644 --- a/website/_dogfooding/_blog tests/2022-01-21-dup-footnote.mdx +++ b/website/_dogfooding/_blog tests/2022-01-21-dup-footnote.mdx @@ -9,5 +9,7 @@ bar[^2] baz[^3] [^1]: foo + [^2]: bar + [^3]: baz diff --git a/website/_dogfooding/_blog tests/2022-01-22-dup-footnote.mdx b/website/_dogfooding/_blog tests/2022-01-22-dup-footnote.mdx index 5079f97dfc05..7d710c19f124 100644 --- a/website/_dogfooding/_blog tests/2022-01-22-dup-footnote.mdx +++ b/website/_dogfooding/_blog tests/2022-01-22-dup-footnote.mdx @@ -9,5 +9,7 @@ bar[^2] baz[^3] [^1]: foo + [^2]: bar + [^3]: baz diff --git a/website/_dogfooding/_blog tests/2022-04-20-dup-footnote.mdx b/website/_dogfooding/_blog tests/2022-04-20-dup-footnote.mdx index b512db7244ff..21fd121281e5 100644 --- a/website/_dogfooding/_blog tests/2022-04-20-dup-footnote.mdx +++ b/website/_dogfooding/_blog tests/2022-04-20-dup-footnote.mdx @@ -9,5 +9,7 @@ bar[^2] baz[^3] [^1]: foo + [^2]: bar + [^3]: baz diff --git a/website/_dogfooding/_blog tests/custom-atom.css b/website/_dogfooding/_blog tests/custom-atom.css index c016178d9007..ad5829c20101 100644 --- a/website/_dogfooding/_blog tests/custom-atom.css +++ b/website/_dogfooding/_blog tests/custom-atom.css @@ -16,7 +16,13 @@ main { padding: 1.5 rem; max-width: 800px; /* stylelint-disable-next-line font-family-name-quotes */ - font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; + font-family: + system-ui, + -apple-system, + Segoe UI, + Roboto, + Ubuntu, + Cantarell; } .info { diff --git a/website/_dogfooding/_blog tests/custom-rss.css b/website/_dogfooding/_blog tests/custom-rss.css index c016178d9007..ad5829c20101 100644 --- a/website/_dogfooding/_blog tests/custom-rss.css +++ b/website/_dogfooding/_blog tests/custom-rss.css @@ -16,7 +16,13 @@ main { padding: 1.5 rem; max-width: 800px; /* stylelint-disable-next-line font-family-name-quotes */ - font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; + font-family: + system-ui, + -apple-system, + Segoe UI, + Roboto, + Ubuntu, + Cantarell; } .info { diff --git a/website/_dogfooding/_docs tests/tests/footnotes.mdx b/website/_dogfooding/_docs tests/tests/footnotes.mdx index da28ea2d66ce..aad2b9aac17a 100644 --- a/website/_dogfooding/_docs tests/tests/footnotes.mdx +++ b/website/_dogfooding/_docs tests/tests/footnotes.mdx @@ -95,52 +95,101 @@ Lorem ipsum dolor sit amet [^48] Lorem ipsum dolor sit amet [^49] [^50] [^1]: footnote 1 + [^2]: footnote 2 + [^3]: footnote 3 + [^4]: footnote 4 + [^5]: footnote 5 + [^6]: footnote 6 + [^7]: footnote 7 + [^8]: footnote 8 + [^9]: footnote 9 + [^10]: footnote 10 + [^11]: footnote 11 + [^12]: footnote 12 + [^13]: footnote 13 + [^14]: footnote 14 + [^15]: footnote 15 + [^16]: footnote 16 + [^17]: footnote 17 + [^18]: footnote 18 + [^19]: footnote 19 + [^20]: footnote 20 + [^21]: footnote 21 + [^22]: footnote 22 + [^23]: footnote 23 + [^24]: footnote 24 + [^25]: footnote 25 + [^26]: footnote 26 + [^27]: footnote 27 + [^28]: footnote 28 + [^29]: footnote 29 + [^30]: footnote 30 + [^31]: footnote 31 + [^32]: footnote 32 + [^33]: footnote 33 + [^34]: footnote 34 + [^35]: footnote 35 + [^36]: footnote 36 + [^37]: footnote 37 + [^38]: footnote 38 + [^39]: footnote 39 + [^40]: footnote 40 + [^41]: footnote 41 + [^42]: footnote 42 + [^43]: footnote 43 + [^44]: footnote 44 + [^45]: footnote 45 + [^46]: footnote 46 + [^47]: footnote 47 + [^48]: footnote 48 + [^49]: footnote 49 + [^50]: footnote 50 diff --git a/website/_dogfooding/_pages tests/code-block-tests.mdx b/website/_dogfooding/_pages tests/code-block-tests.mdx index 69034fdac42b..1848b56493d6 100644 --- a/website/_dogfooding/_pages tests/code-block-tests.mdx +++ b/website/_dogfooding/_pages tests/code-block-tests.mdx @@ -142,9 +142,8 @@ Multi-line text inside `pre` will turn into one-liner, but it's okay (https://gi Input: a = "abcd", b = "cdabcdab"
Output: 3
- Explanation: a after three repetitions become "ab - cdabcdab - cd", at which time b is a substring. + Explanation: a after three repetitions become "ab + cdabcdabcd", at which time b is a substring.
@@ -182,9 +181,8 @@ Multi-line text inside `pre` will turn into one-liner, but it's okay (https://gi Input: a = "abcd", b = "cdabcdab"
Output: 3
- Explanation: a after three repetitions become "ab - cdabcdab - cd", at which time b is a substring. + Explanation: a after three repetitions become "ab + cdabcdabcd", at which time b is a substring.
diff --git a/website/blog/2018/09-11-Towards-Docusaurus-2.mdx b/website/blog/2018/09-11-Towards-Docusaurus-2.mdx index 1cc08c93e0ee..723445d339f4 100644 --- a/website/blog/2018/09-11-Towards-Docusaurus-2.mdx +++ b/website/blog/2018/09-11-Towards-Docusaurus-2.mdx @@ -20,9 +20,10 @@ It all started with this [RFC issue](https://github.com/facebook/docusaurus/issu {'[RFC] Docusaurus v2 · Issue #789 · facebook/docusaurus'} - These are some of the problems I'm seeing in Docusaurus now and also how we can - address them in v2. A number of the ideas here were inspired by VuePress and other - static site generators. In the current static site generators ecosystem, t... + These are some of the problems I'm seeing in Docusaurus now and also how we + can address them in v2. A number of the ideas here were inspired by VuePress + and other static site generators. In the current static site generators + ecosystem, t... Most of the suggested improvements are mentioned in the issue; I will provide details on some of issues in Docusaurus 1 and how we are going to address them in Docusaurus 2. diff --git a/website/blog/releases/3.8/index.mdx b/website/blog/releases/3.8/index.mdx index 673a085983bf..a9243ab2ed35 100644 --- a/website/blog/releases/3.8/index.mdx +++ b/website/blog/releases/3.8/index.mdx @@ -118,15 +118,15 @@ If bundling time is a concern, consider disabling the optional `concatenateModul We have upgraded the [React Native website to Docusaurus v3.8](https://github.com/facebook/react-native-website/pull/4607) already. Here's an updated benchmark showing the global Docusaurus Faster impact on total build time for a site with ~2000 pages: -| ReactNative.dev | Cold Build | Warm Rebuild | -| --------------------- | ------------------ | ------------------ | -| 🐢 Docusaurus Slower | 120s (baseline) | 33s (3.6 × faster) | +| ReactNative.dev | Cold Build | Warm Rebuild | +| -------------------- | ------------------ | ------------------ | +| 🐢 Docusaurus Slower | 120s (baseline) | 33s (3.6 × faster) | | ⚡️ Docusaurus Faster | 31s (3.8 × faster) | 17s (7 × faster) | We measured similar results on our website: -| Docusaurus.io | Cold Build | Warm Rebuild | -| --------------------- | ------------------ | ------------------ | +| Docusaurus.io | Cold Build | Warm Rebuild | +| -------------------- | ------------------ | ------------------ | | 🐢️ Docusaurus Slower | 146s (baseline) | 45s (3.2 × faster) | | ⚡️ Docusaurus Faster | 42s (3.5 × faster) | 24s (6.1 × faster) | diff --git a/website/docs/browser-support.mdx b/website/docs/browser-support.mdx index 675e833367f7..ef64d9d94984 100644 --- a/website/docs/browser-support.mdx +++ b/website/docs/browser-support.mdx @@ -25,8 +25,8 @@ const value = (_obj = obj) === null || _obj === void 0 ? void 0 : (_obj$prop = _obj.prop) === null || _obj$prop === void 0 - ? void 0 - : _obj$prop.val; + ? void 0 + : _obj$prop.val; ``` However, this penalizes all other users with increased site load time because the 29-character line now becomes 168 characters—a 6-fold increase! (In practice, it will be better because the names used will be shorter.) As a tradeoff, the JS loader only transpiles the syntax to the degree that's supported by all browser versions defined in the browser list. diff --git a/website/docs/deployment.mdx b/website/docs/deployment.mdx index 290a62e8a1a0..de114761a0f6 100644 --- a/website/docs/deployment.mdx +++ b/website/docs/deployment.mdx @@ -827,11 +827,9 @@ That's it. Watch the status and wait till the app is deployed. To open the appli [Hostman](https://hostman.com/) allows you to host static websites for free. Hostman automates everything, you just need to connect your repository and follow these easy steps: 1. Create a service. - - To deploy a Docusaurus static website, click **Create** in the top-left corner of your [Dashboard](https://dashboard.hostman.com/) and choose **Front-end app or static website**. 2. Select the project to deploy. - - If you are logged in to Hostman with your GitHub, GitLab, or Bitbucket account, you will see the repository with your projects, including the private ones. - Choose the project you want to deploy. It must contain the directory with the project's files (e.g. `website`). @@ -841,7 +839,6 @@ That's it. Watch the status and wait till the app is deployed. To open the appli - If you didn't use your Git account credentials to log in, you'll be able to access the necessary account now, and then select the project. 3. Configure the build settings. - - Next, the **Website customization** window will appear. Choose the **Static website** option from the list of frameworks. - The **Directory with app** points at the directory that will contain the project's files after the build. If you selected the repository with the contents of the website (or `my_website`) directory during Step 2, you can leave it empty. @@ -855,7 +852,6 @@ That's it. Watch the status and wait till the app is deployed. To open the appli - You can modify the build command if needed. You can enter multiple commands separated by `&&`. 4. Deploy. - - Click **Deploy** to start the build process. - Once it starts, you will enter the deployment log. If there are any issues with the code, you will get warning or error messages in the log specifying the cause of the problem. Usually, the log contains all the debugging data you'll need. diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 7246fcc3266e..6568c81b3c75 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -222,10 +222,10 @@ export default async function createConfigAsync() { ? // Deploy preview and branch deploys: keep them fast! [defaultLocale] : isI18nStaging - ? // Staging locales: https://docusaurus-i18n-staging.netlify.app/ - [defaultLocale, 'ja'] - : // Production locales - [defaultLocale, 'fr', 'pt-BR', 'ko', 'zh-CN'], + ? // Staging locales: https://docusaurus-i18n-staging.netlify.app/ + [defaultLocale, 'ja'] + : // Production locales + [defaultLocale, 'fr', 'pt-BR', 'ko', 'zh-CN'], }, markdown: { format: 'detect', diff --git a/website/netlify.toml b/website/netlify.toml index 2e2e8fec7d52..9c16410452ef 100644 --- a/website/netlify.toml +++ b/website/netlify.toml @@ -5,14 +5,14 @@ # See also https://github.com/netlify/build/issues/2483 [build] - command = "yarn --cwd .. build:packages && yarn build" - publish = "website/build" +command = "yarn --cwd .. build:packages && yarn build" +publish = "website/build" [build.environment] - NETLIFY_USE_YARN = "true" - YARN_VERSION = "1.22.19" - NODE_VERSION = "24" - NODE_OPTIONS = "--max_old_space_size=8192" +NETLIFY_USE_YARN = "true" +YARN_VERSION = "1.22.19" +NODE_VERSION = "24" +NODE_OPTIONS = "--max_old_space_size=8192" # Note, we run build:packages and git backfill in parallel to speed up builds @@ -20,17 +20,15 @@ # See https://github.com/facebook/docusaurus/pull/11553 [context.production] - command = "(echo 'Build packages start' && yarn --cwd .. build:packages && echo 'Build packages end') & (echo 'Git backfill start' && git backfill && echo 'Git backfill end' ) & wait && yarn netlify:build:production" +command = "(echo 'Build packages start' && yarn --cwd .. build:packages && echo 'Build packages end') & (echo 'Git backfill start' && git backfill && echo 'Git backfill end' ) & wait && yarn netlify:build:production" [context.branch-deploy] - command = "(echo 'Build packages start' && yarn --cwd .. build:packages && echo 'Build packages end') & (echo 'Git backfill start' && git backfill && echo 'Git backfill end' ) & wait && yarn netlify:build:branchDeploy" +command = "(echo 'Build packages start' && yarn --cwd .. build:packages && echo 'Build packages end') & (echo 'Git backfill start' && git backfill && echo 'Git backfill end' ) & wait && yarn netlify:build:branchDeploy" [context.deploy-preview] - command = "(echo 'Build packages start' && yarn --cwd .. build:packages && echo 'Build packages end') & (echo 'Git backfill start' && git backfill && echo 'Git backfill end' ) & wait && yarn netlify:build:deployPreview" +command = "(echo 'Build packages start' && yarn --cwd .. build:packages && echo 'Build packages end') & (echo 'Git backfill start' && git backfill && echo 'Git backfill end' ) & wait && yarn netlify:build:deployPreview" [[plugins]] package = "netlify-plugin-cache" - [plugins.inputs] - paths = [ - "node_modules/.cache", - ] +[plugins.inputs] +paths = ["node_modules/.cache"] diff --git a/website/src/components/BrowserWindow/styles.module.css b/website/src/components/BrowserWindow/styles.module.css index aec42957ce99..bab968586099 100644 --- a/website/src/components/BrowserWindow/styles.module.css +++ b/website/src/components/BrowserWindow/styles.module.css @@ -45,7 +45,9 @@ background-color: var(--ifm-background-color); color: var(--ifm-color-gray-800); padding: 5px 15px; - font: 400 13px Arial, sans-serif; + font: + 400 13px Arial, + sans-serif; user-select: none; } diff --git a/website/src/components/TeamProfileCards/index.tsx b/website/src/components/TeamProfileCards/index.tsx index 331ed26960ce..14111b2e557f 100644 --- a/website/src/components/TeamProfileCards/index.tsx +++ b/website/src/components/TeamProfileCards/index.tsx @@ -160,8 +160,8 @@ export function HonoraryAlumniTeamRow(): ReactNode { githubUrl="https://github.com/wgao19" xUrl="https://x.com/wgao19"> - 🏻‍🌾 Work in progress React developer, maintains Docusaurus, writes - docs and spams this world with many websites. + 🏻‍🌾 Work in progress React developer, maintains Docusaurus, writes docs + and spams this world with many websites. diff --git a/website/src/data/tweets.tsx b/website/src/data/tweets.tsx index b222b1bd96dd..1a7face35106 100644 --- a/website/src/data/tweets.tsx +++ b/website/src/data/tweets.tsx @@ -221,9 +221,9 @@ const TWEETS: TweetItem[] = [ I ❤️ @docusaurus - it makes it so easy to spin up docs, blogs and simple websites. I've used it to:
-
✅ Replatform my blog with GitHub pages
- ✅ Build a website for a local business
✅ Build internal facing - blog/docs sites with @AzureStaticApps +
✅ Replatform my blog with GitHub pages
✅ Build a website + for a local business
✅ Build internal facing blog/docs sites with + @AzureStaticApps ), showOnHomepage: false, @@ -258,11 +258,9 @@ const TWEETS: TweetItem[] = [ @docusaurus v2
- Some obvious changes:
- 🌔 Dark mode
- ⚡️ SPA navigation / prefetching
- 🧐 @algolia DocSearch v3
- 💥 @mdx_js enable many new possibilities
+ Some obvious changes:
🌔 Dark mode
+ ⚡️ SPA navigation / prefetching
🧐 @algolia DocSearch v3
💥 + @mdx_js enable many new possibilities

Check it out: https://reactnative.dev @@ -299,9 +297,8 @@ const TWEETS: TweetItem[] = [ <> New #mobx docs are online! More modern, fixing many UI issues.
-
- 👏 @cloverich did the awesome job of migrating from ancient gitbook - -> @docusaurus! 👏
+
👏 @cloverich did the awesome job of migrating from ancient + gitbook -> @docusaurus! 👏

No real content updates yet, but contributing and publishing has become way easier diff --git a/website/src/pages/showcase/_components/OperatorButton/styles.module.css b/website/src/pages/showcase/_components/OperatorButton/styles.module.css index 4fde44d184fc..6d9fa0d9017c 100644 --- a/website/src/pages/showcase/_components/OperatorButton/styles.module.css +++ b/website/src/pages/showcase/_components/OperatorButton/styles.module.css @@ -25,7 +25,8 @@ .checkboxLabel:hover { opacity: 1; - box-shadow: var(--ifm-global-shadow-md), + box-shadow: + var(--ifm-global-shadow-md), 0 0 2px 1px var(--ifm-color-primary-dark); } diff --git a/website/src/plugins/featureRequests/cannyScript.js b/website/src/plugins/featureRequests/cannyScript.js index a97536feec73..dce00dfadb6a 100644 --- a/website/src/plugins/featureRequests/cannyScript.js +++ b/website/src/plugins/featureRequests/cannyScript.js @@ -7,23 +7,23 @@ function cannyScript() { if (!d.getElementById(i)) { let f = d.getElementsByTagName(s)[0], e = d.createElement(s); - (e.type = 'text/javascript'), + ((e.type = 'text/javascript'), (e.async = !0), (e.src = 'https://canny.io/sdk.js'), - f.parentNode.insertBefore(e, f); + f.parentNode.insertBefore(e, f)); } } if (typeof w.Canny !== 'function') { var c = function () { c.q.push(arguments); }; - (c.q = []), + ((c.q = []), (w.Canny = c), d.readyState === 'complete' ? l() : w.attachEvent - ? w.attachEvent('onload', l) - : w.addEventListener('load', l, !1); + ? w.attachEvent('onload', l) + : w.addEventListener('load', l, !1)); } })(window, document, 'canny-jssdk', 'script'); } diff --git a/website/static/pure-html.html b/website/static/pure-html.html index a7605f8dafdd..6ea1e731dc66 100644 --- a/website/static/pure-html.html +++ b/website/static/pure-html.html @@ -1,4 +1,4 @@ - + Purely HTML page | Docusaurus From 54cdc64f630f7a7c41cc435c9dc3b1979ced83f4 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Wed, 29 Apr 2026 18:34:00 +0800 Subject: [PATCH 5/9] chore: remove unused oxfmt entries from project-words.txt --- project-words.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/project-words.txt b/project-words.txt index 61485e8f99cc..ace33eb4eff6 100644 --- a/project-words.txt +++ b/project-words.txt @@ -209,8 +209,6 @@ orta osascript Outerbounds outerbounds -Oxfmt -oxfmt overrideable ozaki ozakione From 0f367fa990f382a5a07ab5e5a98ea53c2fa03a6a Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 7 May 2026 12:32:40 +0200 Subject: [PATCH 6/9] change some prettier refs --- .eslintrc.js | 2 +- AGENTS.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 41859a9031f7..eb5e22d7b00c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -82,7 +82,7 @@ module.exports = { 'max-len': [ WARNING, { - code: Infinity, // Code width is already enforced by Prettier + code: Infinity, // Code width is already enforced by Prettier/oxfmt tabWidth: 2, comments: 80, ignoreUrls: true, diff --git a/AGENTS.md b/AGENTS.md index a871f9c4389e..a24ab85ad724 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,7 +41,7 @@ The main CLI commands available - `yarn install` - Install dependencies and then build all monorepo packages - `yarn build:packages` - Build all monorepo packages - `yarn watch` - Incremental build of monorepo packages with file watchers -- `yarn format` - Format code with Prettier +- `yarn format` - Format code with oxfmt - `yarn lint` - Run linting (ESLint + Stylelint + spell check) - `yarn test` - Run all tests using Jest - `yarn clear` - Clean all build artifacts and caches @@ -67,7 +67,7 @@ Update Jest failing snapshots with the `-u` option. Do not blindly update snapsh ### Linting & Formatting -- `yarn format` - Format code with Prettier +- `yarn format` - Format code with oxfmt - `yarn lint:js` - ESLint for JS/TS files - `yarn lint:style` - Stylelint for CSS files - `yarn lint:spelling` - CSpell for spell checking From 4b2ba8aa3c4437f068f0a3f1b109b2b5534214da Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 7 May 2026 12:33:09 +0200 Subject: [PATCH 7/9] remove prettier from deps, remove @prettier/plugin-xml --- package.json | 1 - yarn.lock | 32 -------------------------------- 2 files changed, 33 deletions(-) diff --git a/package.json b/package.json index 4de58b805198..7592c0a912ef 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,6 @@ "devDependencies": { "@ai-sdk/react": "^2.0.30", "@crowdin/cli": "^4.14.2", - "@prettier/plugin-xml": "^2.2.0", "@swc/core": "^1.15.32", "@swc/jest": "^0.2.39", "@testing-library/dom": "^10.4.1", diff --git a/yarn.lock b/yarn.lock index 96de569532a2..6f7d9f895fd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3856,14 +3856,6 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.28.tgz#d45e01c4a56f143ee69c54dd6b12eade9e270a73" integrity sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw== -"@prettier/plugin-xml@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@prettier/plugin-xml/-/plugin-xml-2.2.0.tgz#2bc2ae667aa817369fdb939aa7d36ea88105483d" - integrity sha512-UWRmygBsyj4bVXvDiqSccwT1kmsorcwQwaIy30yVh8T+Gspx4OlC0shX1y+ZuwXZvgnafmpRYKks0bAu9urJew== - dependencies: - "@xml-tools/parser" "^1.0.11" - prettier ">=2.4.0" - "@rollup/plugin-babel@^5.2.0": version "5.3.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" @@ -5827,13 +5819,6 @@ "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" -"@xml-tools/parser@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@xml-tools/parser/-/parser-1.0.11.tgz#a118a14099ea5c3c537e4781fad2fc195b57f8ff" - integrity sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA== - dependencies: - chevrotain "7.1.1" - "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -7039,13 +7024,6 @@ chevrotain-allstar@~0.4.1: dependencies: lodash-es "^4.17.21" -chevrotain@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-7.1.1.tgz#5122814eafd1585a9601f9180a7be9c42d5699c6" - integrity sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw== - dependencies: - regexp-to-ast "0.5.0" - chevrotain@~12.0.0: version "12.0.0" resolved "https://registry.yarnpkg.com/chevrotain/-/chevrotain-12.0.0.tgz#8ebefe0a0516b1b314a8d9c7f4e948a509098d1c" @@ -15879,11 +15857,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@>=2.4.0: - version "2.8.8" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" - integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== - pretty-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pretty-ansi/-/pretty-ansi-4.0.0.tgz#92b84c10706efb5f5ce107599eeb03ca2794954f" @@ -16516,11 +16489,6 @@ regexp-ast-analysis@^0.6.0: "@eslint-community/regexpp" "^4.5.0" refa "^0.11.0" -regexp-to-ast@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz#56c73856bee5e1fef7f73a00f1473452ab712a24" - integrity sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw== - regexp.prototype.flags@^1.5.2: version "1.5.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz#b3ae40b1d2499b8350ab2c3fe6ef3845d3a96f42" From 5c01fc7e6f0d1d905dd81c68d3e88f5428c1194d Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 7 May 2026 13:01:51 +0200 Subject: [PATCH 8/9] fix project words --- project-words.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/project-words.txt b/project-words.txt index ace33eb4eff6..10e4269bd81d 100644 --- a/project-words.txt +++ b/project-words.txt @@ -210,6 +210,7 @@ osascript Outerbounds outerbounds overrideable +oxfmt ozaki ozakione O’Shannessy From 296451d48f7ade506bfa9062752f4295b3e49d84 Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 7 May 2026 13:41:38 +0200 Subject: [PATCH 9/9] fix formatting of lib/theme files for swizzling --- .oxfmtrc.json | 3 +++ packages/docusaurus-plugin-debug/package.json | 2 +- packages/docusaurus-plugin-ideal-image/package.json | 2 +- packages/docusaurus-plugin-pwa/package.json | 2 +- packages/docusaurus-theme-classic/package.json | 2 +- packages/docusaurus-theme-live-codeblock/package.json | 2 +- packages/docusaurus-theme-mermaid/package.json | 2 +- packages/docusaurus-theme-search-algolia/package.json | 2 +- 8 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 4d48c5b15bdd..c23c781a341c 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -18,7 +18,10 @@ "packages/lqip-loader/lib/", "packages/docusaurus/lib/", "packages/docusaurus-*/lib/*", + "packages/create-docusaurus/lib/*", + "!packages/docusaurus-*/lib/theme/**", + "packages/create-docusaurus/templates/*/docusaurus.config.js", "packages/eslint-plugin/lib/", "packages/stylelint-copyright/lib/", diff --git a/packages/docusaurus-plugin-debug/package.json b/packages/docusaurus-plugin-debug/package.json index 02d36dc53ce8..4f4d565ccae2 100644 --- a/packages/docusaurus-plugin-debug/package.json +++ b/packages/docusaurus-plugin-debug/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "src/plugin-debug.d.ts", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-plugin-ideal-image/package.json b/packages/docusaurus-plugin-ideal-image/package.json index 10aebdbd5fc8..1327562bd10b 100644 --- a/packages/docusaurus-plugin-ideal-image/package.json +++ b/packages/docusaurus-plugin-ideal-image/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "src/plugin-ideal-image.d.ts", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-plugin-pwa/package.json b/packages/docusaurus-plugin-pwa/package.json index 620cc4992811..77b57b1356d1 100644 --- a/packages/docusaurus-plugin-pwa/package.json +++ b/packages/docusaurus-plugin-pwa/package.json @@ -5,7 +5,7 @@ "main": "lib/index.js", "types": "src/plugin-pwa.d.ts", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-classic/package.json b/packages/docusaurus-theme-classic/package.json index 293e6dc0eb72..825ff3c9fee2 100644 --- a/packages/docusaurus-theme-classic/package.json +++ b/packages/docusaurus-theme-classic/package.json @@ -14,7 +14,7 @@ }, "license": "MIT", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-live-codeblock/package.json b/packages/docusaurus-theme-live-codeblock/package.json index 6d3db680ff75..57d2e961749b 100644 --- a/packages/docusaurus-theme-live-codeblock/package.json +++ b/packages/docusaurus-theme-live-codeblock/package.json @@ -23,7 +23,7 @@ "access": "public" }, "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-mermaid/package.json b/packages/docusaurus-theme-mermaid/package.json index 7848bbe450da..d05cbc34f134 100644 --- a/packages/docusaurus-theme-mermaid/package.json +++ b/packages/docusaurus-theme-mermaid/package.json @@ -27,7 +27,7 @@ }, "license": "MIT", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch" diff --git a/packages/docusaurus-theme-search-algolia/package.json b/packages/docusaurus-theme-search-algolia/package.json index bd6eb37bf5fa..a680b28d285d 100644 --- a/packages/docusaurus-theme-search-algolia/package.json +++ b/packages/docusaurus-theme-search-algolia/package.json @@ -27,7 +27,7 @@ }, "license": "MIT", "scripts": { - "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt --write --no-error-on-unmatched-pattern \"lib/theme/**/*.js\"", + "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", "watch": "run-p -c copy:watch build:watch", "build:watch": "tsc --build --watch", "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"