From 784b443cfe82d9c39f15fa799fe1d5b9d33af07b Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 28 Mar 2025 10:30:42 -0700 Subject: [PATCH 01/35] chore: switch to tinyglobby --- packages/docusaurus-utils/package.json | 2 +- packages/docusaurus-utils/src/globUtils.ts | 6 +++--- .../docusaurus/src/commands/swizzle/actions.ts | 2 +- .../docusaurus/src/commands/writeHeadingIds.ts | 11 +++++------ .../docusaurus/src/webpack/aliases/index.ts | 2 +- yarn.lock | 18 +++++++++--------- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/packages/docusaurus-utils/package.json b/packages/docusaurus-utils/package.json index 7dde60ae3a3d..f1ee86dfb90c 100644 --- a/packages/docusaurus-utils/package.json +++ b/packages/docusaurus-utils/package.json @@ -26,7 +26,6 @@ "file-loader": "^6.2.0", "fs-extra": "^11.1.1", "github-slugger": "^1.5.0", - "globby": "^11.1.0", "gray-matter": "^4.0.3", "jiti": "^1.20.0", "js-yaml": "^4.1.0", @@ -34,6 +33,7 @@ "micromatch": "^4.0.5", "prompts": "^2.4.2", "resolve-pathname": "^3.0.0", + "tinyglobby": "^0.2.12", "tslib": "^2.6.0", "url-loader": "^4.1.1", "utility-types": "^3.10.0", diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index c7e2cab13421..0f1b14e2447c 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -10,7 +10,7 @@ import path from 'path'; import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby import {addSuffix} from '@docusaurus/utils-common'; -import Globby from 'globby'; +import Globby from 'tinyglobby'; import {posixPath} from './pathUtils'; /** A re-export of the globby instance. */ @@ -93,7 +93,7 @@ export function createAbsoluteFilePathMatcher( // See https://github.com/facebook/docusaurus/pull/4222#issuecomment-795517329 export async function safeGlobby( patterns: string[], - options?: Globby.GlobbyOptions, + options?: Globby.GlobOptions, ): Promise { // Required for Windows support, as paths using \ should not be used by globby // (also using the windows hard drive prefix like c: is not a good idea) @@ -101,7 +101,7 @@ export async function safeGlobby( posixPath(path.relative(process.cwd(), dirPath)), ); - return Globby(globPaths, options); + return Globby.glob(globPaths, options); } // A bit weird to put this here, but it's used by core + theme-translations diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index d5074697ecc0..597d4abc90d9 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -61,7 +61,7 @@ export async function eject({ const globPatternPosix = posixPath(globPattern); - const filesToCopy = await Globby(globPatternPosix, { + const filesToCopy = await Globby.glob(globPatternPosix, { ignore: _.compact([ '**/*.{story,stories,test,tests}.{js,jsx,ts,tsx}', // When ejecting JS components, we want to avoid emitting TS files diff --git a/packages/docusaurus/src/commands/writeHeadingIds.ts b/packages/docusaurus/src/commands/writeHeadingIds.ts index 3963270dc582..7cbda9520635 100644 --- a/packages/docusaurus/src/commands/writeHeadingIds.ts +++ b/packages/docusaurus/src/commands/writeHeadingIds.ts @@ -47,12 +47,11 @@ export async function writeHeadingIds( ): Promise { const siteDir = await fs.realpath(siteDirParam); - const markdownFiles = await safeGlobby( - files ?? (await getPathsToWatch(siteDir)), - { - expandDirectories: ['**/*.{md,mdx}'], - }, - ); + const markdownFiles = ( + await safeGlobby(files ?? (await getPathsToWatch(siteDir)), { + expandDirectories: true, + }) + ).filter((file) => file.endsWith('.md') || file.endsWith('.mdx')); const result = await Promise.all( markdownFiles.map((p) => transformMarkdownFile(p, options)), diff --git a/packages/docusaurus/src/webpack/aliases/index.ts b/packages/docusaurus/src/webpack/aliases/index.ts index dbade3a77e36..7fc59ee6b2bf 100644 --- a/packages/docusaurus/src/webpack/aliases/index.ts +++ b/packages/docusaurus/src/webpack/aliases/index.ts @@ -51,7 +51,7 @@ export async function createAliasesForTheme( return {}; } - const themeComponentFiles = await Globby(['**/*.{js,jsx,ts,tsx}'], { + const themeComponentFiles = await Globby.glob(['**/*.{js,jsx,ts,tsx}'], { cwd: themePath, }); diff --git a/yarn.lock b/yarn.lock index f90d6cc687f6..b40d2606a1cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8556,10 +8556,10 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fdir@^6.4.0: - version "6.4.2" - resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.2.tgz#ddaa7ce1831b161bc3657bb99cb36e1622702689" - integrity sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ== +fdir@^6.4.0, fdir@^6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.3.tgz#011cdacf837eca9b811c89dbb902df714273db72" + integrity sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw== feed@^4.2.2: version "4.2.2" @@ -17231,12 +17231,12 @@ tinyexec@^0.3.0: resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.0.tgz#ed60cfce19c17799d4a241e06b31b0ec2bee69e6" integrity sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg== -tinyglobby@^0.2.9: - version "0.2.9" - resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.9.tgz#6baddd1b0fe416403efb0dd40442c7d7c03c1c66" - integrity sha512-8or1+BGEdk1Zkkw2ii16qSS7uVrQJPre5A9o/XkWPATkk23FZh/15BKFxPnlTy6vkljZxLqYCzzBMj30ZrSvjw== +tinyglobby@^0.2.12, tinyglobby@^0.2.9: + version "0.2.12" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.12.tgz#ac941a42e0c5773bd0b5d08f32de82e74a1a61b5" + integrity sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww== dependencies: - fdir "^6.4.0" + fdir "^6.4.3" picomatch "^4.0.2" tinypool@^1.0.2: From b1ddd480069a3da6991e53aaf60328a513ffcf2e Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 8 Apr 2025 14:37:09 +0200 Subject: [PATCH 02/35] fix tinyglobby integration --- packages/docusaurus-utils/src/globUtils.ts | 12 ++++++++---- packages/docusaurus/src/commands/swizzle/actions.ts | 2 +- packages/docusaurus/src/webpack/aliases/index.ts | 2 +- yarn.lock | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index 0f1b14e2447c..561ea6649f95 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -10,11 +10,15 @@ import path from 'path'; import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby import {addSuffix} from '@docusaurus/utils-common'; -import Globby from 'tinyglobby'; +import * as Tinyglobby from 'tinyglobby'; import {posixPath} from './pathUtils'; +type GlobOptions = Tinyglobby.GlobOptions; + +// TODO Docusaurus v4 refactor, hide lib behind home-made abstraction +// See https://github.com/facebook/docusaurus/pull/11042 /** A re-export of the globby instance. */ -export {Globby}; +export const Globby = Tinyglobby.glob; /** * The default glob patterns we ignore when sourcing content. @@ -93,7 +97,7 @@ export function createAbsoluteFilePathMatcher( // See https://github.com/facebook/docusaurus/pull/4222#issuecomment-795517329 export async function safeGlobby( patterns: string[], - options?: Globby.GlobOptions, + options?: GlobOptions, ): Promise { // Required for Windows support, as paths using \ should not be used by globby // (also using the windows hard drive prefix like c: is not a good idea) @@ -101,7 +105,7 @@ export async function safeGlobby( posixPath(path.relative(process.cwd(), dirPath)), ); - return Globby.glob(globPaths, options); + return Globby(globPaths, options); } // A bit weird to put this here, but it's used by core + theme-translations diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index 597d4abc90d9..d5074697ecc0 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -61,7 +61,7 @@ export async function eject({ const globPatternPosix = posixPath(globPattern); - const filesToCopy = await Globby.glob(globPatternPosix, { + const filesToCopy = await Globby(globPatternPosix, { ignore: _.compact([ '**/*.{story,stories,test,tests}.{js,jsx,ts,tsx}', // When ejecting JS components, we want to avoid emitting TS files diff --git a/packages/docusaurus/src/webpack/aliases/index.ts b/packages/docusaurus/src/webpack/aliases/index.ts index 7fc59ee6b2bf..dbade3a77e36 100644 --- a/packages/docusaurus/src/webpack/aliases/index.ts +++ b/packages/docusaurus/src/webpack/aliases/index.ts @@ -51,7 +51,7 @@ export async function createAliasesForTheme( return {}; } - const themeComponentFiles = await Globby.glob(['**/*.{js,jsx,ts,tsx}'], { + const themeComponentFiles = await Globby(['**/*.{js,jsx,ts,tsx}'], { cwd: themePath, }); diff --git a/yarn.lock b/yarn.lock index b40d2606a1cc..8824d75bd258 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8556,7 +8556,7 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fdir@^6.4.0, fdir@^6.4.3: +fdir@^6.4.3: version "6.4.3" resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.3.tgz#011cdacf837eca9b811c89dbb902df714273db72" integrity sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw== From 32c5be420f088801a535da28e075a97ad08a8415 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 8 Apr 2025 16:20:04 +0200 Subject: [PATCH 03/35] spelling --- project-words.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project-words.txt b/project-words.txt index 1e3d5345951e..3bd183e24233 100644 --- a/project-words.txt +++ b/project-words.txt @@ -331,6 +331,8 @@ Tagkey Teik Therox thisweekinreact +Tinyglobby +tinyglobby toplevel Transifex transpiles From 3a7fc225b5a2e990cf151af4718fb8eeba9f3386 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 8 Apr 2025 16:20:48 +0200 Subject: [PATCH 04/35] empty From e0d3696f649dc65ded792a4fc16c92921b89db0a Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sat, 19 Apr 2025 11:47:26 -0700 Subject: [PATCH 05/35] upgrade tinyglobby --- packages/docusaurus-utils/package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/docusaurus-utils/package.json b/packages/docusaurus-utils/package.json index f1ee86dfb90c..4951bc15fead 100644 --- a/packages/docusaurus-utils/package.json +++ b/packages/docusaurus-utils/package.json @@ -33,7 +33,7 @@ "micromatch": "^4.0.5", "prompts": "^2.4.2", "resolve-pathname": "^3.0.0", - "tinyglobby": "^0.2.12", + "tinyglobby": "^0.2.13", "tslib": "^2.6.0", "url-loader": "^4.1.1", "utility-types": "^3.10.0", diff --git a/yarn.lock b/yarn.lock index 4f67ec43719c..16f1c4d275af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8813,10 +8813,10 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fdir@^6.4.3: - version "6.4.3" - resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.3.tgz#011cdacf837eca9b811c89dbb902df714273db72" - integrity sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw== +fdir@^6.4.3, fdir@^6.4.4: + version "6.4.4" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.4.tgz#1cfcf86f875a883e19a8fab53622cfe992e8d2f9" + integrity sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg== feed@^4.2.2: version "4.2.2" @@ -17482,12 +17482,12 @@ tinyexec@^0.3.2: resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2" integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA== -tinyglobby@^0.2.12: - version "0.2.12" - resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.12.tgz#ac941a42e0c5773bd0b5d08f32de82e74a1a61b5" - integrity sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww== +tinyglobby@^0.2.12, tinyglobby@^0.2.13: + version "0.2.13" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.13.tgz#a0e46515ce6cbcd65331537e57484af5a7b2ff7e" + integrity sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw== dependencies: - fdir "^6.4.3" + fdir "^6.4.4" picomatch "^4.0.2" tinypool@^1.0.2: From 1207ebef324f9a412548efe35fdc9b4fdf1b9599 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sat, 19 Apr 2025 14:01:04 -0700 Subject: [PATCH 06/35] update lockfile --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 16f1c4d275af..0bca0e0b3d64 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8813,7 +8813,7 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fdir@^6.4.3, fdir@^6.4.4: +fdir@^6.4.4: version "6.4.4" resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.4.tgz#1cfcf86f875a883e19a8fab53622cfe992e8d2f9" integrity sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg== From cac8d4881d4512986d4c1162bceda3777ef90074 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 25 May 2025 11:47:30 -0700 Subject: [PATCH 07/35] upgrade tinyglobby --- packages/docusaurus-utils/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/docusaurus-utils/package.json b/packages/docusaurus-utils/package.json index 4951bc15fead..dd9c0d61b884 100644 --- a/packages/docusaurus-utils/package.json +++ b/packages/docusaurus-utils/package.json @@ -33,7 +33,7 @@ "micromatch": "^4.0.5", "prompts": "^2.4.2", "resolve-pathname": "^3.0.0", - "tinyglobby": "^0.2.13", + "tinyglobby": "^0.2.14", "tslib": "^2.6.0", "url-loader": "^4.1.1", "utility-types": "^3.10.0", diff --git a/yarn.lock b/yarn.lock index 0bca0e0b3d64..dc7d0e5936f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17482,10 +17482,10 @@ tinyexec@^0.3.2: resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2" integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA== -tinyglobby@^0.2.12, tinyglobby@^0.2.13: - version "0.2.13" - resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.13.tgz#a0e46515ce6cbcd65331537e57484af5a7b2ff7e" - integrity sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw== +tinyglobby@^0.2.12, tinyglobby@^0.2.14: + version "0.2.14" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.14.tgz#5280b0cf3f972b050e74ae88406c0a6a58f4079d" + integrity sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ== dependencies: fdir "^6.4.4" picomatch "^4.0.2" From 346a349836ee647dc6f63c9bea18fbccde52084a Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 25 May 2025 14:50:43 -0700 Subject: [PATCH 08/35] simplify --- .../src/commands/swizzle/__tests__/index.test.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts index 013fbab245eb..4fb86c366daf 100644 --- a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts +++ b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts @@ -91,15 +91,10 @@ async function createTestSite() { const siteThemePathPosix = posixPath(siteThemePath); expect(tree(siteThemePathPosix)).toMatchSnapshot('theme dir tree'); - const files = (await Globby(siteThemePathPosix)) - .map((file) => path.posix.relative(siteThemePathPosix, file)) - .sort(); + const files = (await Globby(siteThemePathPosix, {absolute: true})).sort(); for (const file of files) { - const fileContent = await fs.readFile( - path.posix.join(siteThemePath, file), - 'utf-8', - ); + const fileContent = await fs.readFile(file, 'utf-8'); expect(fileContent).toMatchSnapshot(file); } } From ca54f5dcdc1d7b92967288153f0fcbcf5dc9e9f4 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 25 May 2025 18:14:24 -0700 Subject: [PATCH 09/35] Revert "simplify" This reverts commit 346a349836ee647dc6f63c9bea18fbccde52084a. --- .../src/commands/swizzle/__tests__/index.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts index 4fb86c366daf..013fbab245eb 100644 --- a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts +++ b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts @@ -91,10 +91,15 @@ async function createTestSite() { const siteThemePathPosix = posixPath(siteThemePath); expect(tree(siteThemePathPosix)).toMatchSnapshot('theme dir tree'); - const files = (await Globby(siteThemePathPosix, {absolute: true})).sort(); + const files = (await Globby(siteThemePathPosix)) + .map((file) => path.posix.relative(siteThemePathPosix, file)) + .sort(); for (const file of files) { - const fileContent = await fs.readFile(file, 'utf-8'); + const fileContent = await fs.readFile( + path.posix.join(siteThemePath, file), + 'utf-8', + ); expect(fileContent).toMatchSnapshot(file); } } From ac906820b2bf735994efbddc4e68aa62f1ff5f03 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 5 Dec 2025 19:39:02 +0100 Subject: [PATCH 10/35] try upgrade --- packages/docusaurus-utils/package.json | 2 +- yarn.lock | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-utils/package.json b/packages/docusaurus-utils/package.json index f76e67e15494..5e3cb5884df3 100644 --- a/packages/docusaurus-utils/package.json +++ b/packages/docusaurus-utils/package.json @@ -34,7 +34,7 @@ "prompts": "^2.4.2", "p-queue": "^6.6.2", "resolve-pathname": "^3.0.0", - "tinyglobby": "^0.2.14", + "tinyglobby": "^0.2.15", "tslib": "^2.6.0", "url-loader": "^4.1.1", "utility-types": "^3.10.0", diff --git a/yarn.lock b/yarn.lock index 59b60ddbcb91..3598c9f9fea6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8818,6 +8818,11 @@ fdir@^6.4.4: resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.4.tgz#1cfcf86f875a883e19a8fab53622cfe992e8d2f9" integrity sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg== +fdir@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== + feed@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/feed/-/feed-4.2.2.tgz#865783ef6ed12579e2c44bbef3c9113bc4956a7e" @@ -14289,6 +14294,11 @@ picomatch@^4.0.2: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== +picomatch@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== + pidtree@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.1.tgz#ef09ac2cc0533df1f3250ccf2c4d366b0d12114a" @@ -17477,7 +17487,7 @@ tinyexec@^0.3.2: resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2" integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA== -tinyglobby@^0.2.12, tinyglobby@^0.2.14: +tinyglobby@^0.2.12: version "0.2.14" resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.14.tgz#5280b0cf3f972b050e74ae88406c0a6a58f4079d" integrity sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ== @@ -17485,6 +17495,14 @@ tinyglobby@^0.2.12, tinyglobby@^0.2.14: fdir "^6.4.4" picomatch "^4.0.2" +tinyglobby@^0.2.15: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== + dependencies: + fdir "^6.5.0" + picomatch "^4.0.3" + tinypool@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-1.0.2.tgz#706193cc532f4c100f66aa00b01c42173d9051b2" From dd0ee05f97a0fa1ff2e60eb284a47d1ac3c31319 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 5 Dec 2025 19:55:50 +0100 Subject: [PATCH 11/35] lockfile --- yarn.lock | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4793e070766a..5d69849ae22e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8994,11 +8994,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -fdir@^6.4.4: - version "6.4.4" - resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.4.tgz#1cfcf86f875a883e19a8fab53622cfe992e8d2f9" - integrity sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg== - fdir@^6.5.0: version "6.5.0" resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" @@ -14536,12 +14531,7 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatc resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -picomatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" - integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== - -picomatch@^4.0.3: +picomatch@^4.0.2, picomatch@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== @@ -17723,15 +17713,7 @@ tinyexec@^0.3.2: resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2" integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA== -tinyglobby@^0.2.12: - version "0.2.14" - resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.14.tgz#5280b0cf3f972b050e74ae88406c0a6a58f4079d" - integrity sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ== - dependencies: - fdir "^6.4.4" - picomatch "^4.0.2" - -tinyglobby@^0.2.15: +tinyglobby@^0.2.12, tinyglobby@^0.2.15: version "0.2.15" resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== From d168d18aa655d1a086c84191d93de820ad55419c Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 5 Dec 2025 20:06:20 +0100 Subject: [PATCH 12/35] log component names to swizzle --- website/_dogfooding/testSwizzleThemeClassic.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/website/_dogfooding/testSwizzleThemeClassic.mjs b/website/_dogfooding/testSwizzleThemeClassic.mjs index 364958b4ec74..c294fc198397 100644 --- a/website/_dogfooding/testSwizzleThemeClassic.mjs +++ b/website/_dogfooding/testSwizzleThemeClassic.mjs @@ -80,6 +80,7 @@ async function getAllComponentNames() { } const componentNames = await getAllComponentNames(); +console.log('componentNames', componentNames); const componentsNotFound = Object.keys(swizzleConfig.components).filter( (componentName) => !componentNames.includes(componentName), From e3e5fe6520164bb497a2333999c3b36e39ce1877 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 5 Dec 2025 20:09:29 +0100 Subject: [PATCH 13/35] try to ignore tests on windows? --- packages/docusaurus/src/commands/swizzle/actions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index d5074697ecc0..bc63559ad14e 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -68,6 +68,7 @@ export async function eject({ // In particular the .d.ts files that theme build output contains typescript ? null : '**/*.{d.ts,ts,tsx}', '**/{__fixtures__,__tests__}/*', + '**\\{__fixtures__,__tests__}\\*', ]), }); From a61d775f33391c307a920f0cebfb876920c57d1c Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 5 Dec 2025 20:10:25 +0100 Subject: [PATCH 14/35] try to ignore tests on windows? --- packages/docusaurus/src/commands/swizzle/actions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index bc63559ad14e..96c904a05c78 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -72,6 +72,8 @@ export async function eject({ ]), }); + console.log('eject', componentName, {filesToCopy}); + if (filesToCopy.length === 0) { // This should never happen throw new Error( From feebe3103c68f9785ae3662b3816206931cac83a Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 23 Dec 2025 12:23:46 +0100 Subject: [PATCH 15/35] try to fix tinyglobby swizzle CI bug? --- packages/docusaurus/src/commands/swizzle/actions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index 96c904a05c78..5ad2a7b3ba85 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -62,13 +62,18 @@ export async function eject({ const globPatternPosix = posixPath(globPattern); const filesToCopy = await Globby(globPatternPosix, { + // Workaround for Tinyglobby bug? + // We glob from the repo root, not from the website dir + // See https://github.com/SuperchupuDev/tinyglobby/issues/186 + cwd: path.join(process.cwd(), '..'), + absolute: true, + ignore: _.compact([ '**/*.{story,stories,test,tests}.{js,jsx,ts,tsx}', // When ejecting JS components, we want to avoid emitting TS files // In particular the .d.ts files that theme build output contains typescript ? null : '**/*.{d.ts,ts,tsx}', '**/{__fixtures__,__tests__}/*', - '**\\{__fixtures__,__tests__}\\*', ]), }); From 4593f3aa615722fbebf2cda5087c81f41be5a5b4 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 23 Dec 2025 15:13:50 +0100 Subject: [PATCH 16/35] remove useless log --- packages/docusaurus/src/commands/swizzle/actions.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index 5ad2a7b3ba85..32f90cbf2133 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -77,8 +77,6 @@ export async function eject({ ]), }); - console.log('eject', componentName, {filesToCopy}); - if (filesToCopy.length === 0) { // This should never happen throw new Error( From 267a800e7a238aa9a8765207b9620efba496bf0c Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 23 Dec 2025 15:19:56 +0100 Subject: [PATCH 17/35] test log --- .../server/translations/__tests__/translationsExtractor.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts b/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts index 69c9ec46831f..f626494214bf 100644 --- a/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts +++ b/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts @@ -17,6 +17,7 @@ async function createTmpDir() { const {path: siteDirPath} = await tmp.dir({ prefix: 'jest-createTmpSiteDir', }); + console.log(`Created temporary directory at ${siteDirPath}`); return siteDirPath; } From 1c13e463a00628b612cb3f6fe1aab157bf534dd9 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 23 Dec 2025 15:33:34 +0100 Subject: [PATCH 18/35] try to fix tinyglobby error on windows --- .../docusaurus-babel/src/babelTranslationsExtractor.ts | 7 ++++--- packages/docusaurus-utils/src/globUtils.ts | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-babel/src/babelTranslationsExtractor.ts b/packages/docusaurus-babel/src/babelTranslationsExtractor.ts index 744f1aaa2161..00ef7a9b6ce1 100644 --- a/packages/docusaurus-babel/src/babelTranslationsExtractor.ts +++ b/packages/docusaurus-babel/src/babelTranslationsExtractor.ts @@ -6,7 +6,6 @@ */ import fs from 'fs-extra'; -import logger from '@docusaurus/logger'; import traverse, {type Node} from '@babel/traverse'; import generate from '@babel/generator'; import { @@ -56,8 +55,10 @@ export async function extractSourceCodeFileTranslations( ); return translations; } catch (err) { - logger.error`Error while attempting to extract Docusaurus translations from source code file at path=${sourceCodeFilePath}.`; - throw err; + throw new Error( + `Error while attempting to extract Docusaurus translations from source code file at path=${sourceCodeFilePath}.`, + {cause: err as Error}, + ); } } diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index 305b3ff383cf..c26e84ab65d7 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -136,6 +136,8 @@ export const isTranslatableSourceFile: (filePath: string) => boolean = (() => { export async function globTranslatableSourceFiles( patterns: string[], ): Promise { - const filePaths = await safeGlobby(patterns); + const filePaths = await safeGlobby(patterns, { + absolute: true, + }); return filePaths.filter(isTranslatableSourceFile); } From f2edb911d8e0dc698c066a3a358c9d60f1a47af6 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 23 Dec 2025 15:38:22 +0100 Subject: [PATCH 19/35] try to fix tinyglobby --- .../__tests__/babelTranslationsExtractor.test.ts | 11 ++--------- .../src/babelTranslationsExtractor.ts | 3 ++- .../src/__tests__/utils.test.ts | 16 ++++++++-------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts b/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts index f221bd235019..f38d5650bf7c 100644 --- a/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts +++ b/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import {jest} from '@jest/globals'; import fs from 'fs-extra'; import tmp from 'tmp-promise'; import {getBabelOptions} from '../utils'; @@ -45,16 +44,10 @@ const default => { `, }); - const errorMock = jest.spyOn(console, 'error').mockImplementation(() => {}); - await expect( extractSourceCodeFileTranslations(sourceCodeFilePath, TestBabelOptions), - ).rejects.toThrow(); - - expect(errorMock).toHaveBeenCalledWith( - expect.stringMatching( - /Error while attempting to extract Docusaurus translations from source code file at/, - ), + ).rejects.toThrow( + /Error while attempting to extract Docusaurus translations from source code file at/, ); }); diff --git a/packages/docusaurus-babel/src/babelTranslationsExtractor.ts b/packages/docusaurus-babel/src/babelTranslationsExtractor.ts index 00ef7a9b6ce1..9675d1176f57 100644 --- a/packages/docusaurus-babel/src/babelTranslationsExtractor.ts +++ b/packages/docusaurus-babel/src/babelTranslationsExtractor.ts @@ -14,6 +14,7 @@ import { type NodePath, type TransformOptions, } from '@babel/core'; +import {logger} from '@docusaurus/logger'; import type {TranslationFileContent} from '@docusaurus/types'; export type SourceCodeFileTranslations = { @@ -56,7 +57,7 @@ export async function extractSourceCodeFileTranslations( return translations; } catch (err) { throw new Error( - `Error while attempting to extract Docusaurus translations from source code file at path=${sourceCodeFilePath}.`, + logger.interpolate`Error while attempting to extract Docusaurus translations from source code file at path=${sourceCodeFilePath}.`, {cause: err as Error}, ); } diff --git a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts index 2f8949b55fe0..3b86d354ad7a 100644 --- a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts +++ b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts @@ -13,14 +13,14 @@ describe('extractThemeCodeMessages', () => { await expect(() => extractThemeCodeMessages([path.join(__dirname, '__fixtures__/theme')]), ).rejects.toThrowErrorMatchingInlineSnapshot(` - " - Please make sure all theme translations are static! - Some warnings were found! + " + Please make sure all theme translations are static! + Some warnings were found! - Translate content could not be extracted. It has to be a static string and use optional but static props, like text. - File: packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 4 - Full code: {index} - " - `); + Translate content could not be extracted. It has to be a static string and use optional but static props, like text. + File: /packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 4 + Full code: {index} + " + `); }); }); From fafe9f5469922d837850b4866142231228783a31 Mon Sep 17 00:00:00 2001 From: sebastien Date: Tue, 23 Dec 2025 16:27:34 +0100 Subject: [PATCH 20/35] test windows --- jest/snapshotPathNormalizer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jest/snapshotPathNormalizer.ts b/jest/snapshotPathNormalizer.ts index b8a5ec33ab52..32c7e96fcc1b 100644 --- a/jest/snapshotPathNormalizer.ts +++ b/jest/snapshotPathNormalizer.ts @@ -66,6 +66,9 @@ function normalizePaths(value: T): T { const cwd = process.cwd(); const cwdReal = getRealPath(cwd); + console.log('CWD:', cwd); + console.log('CWD Real:', cwdReal); + const tempDir = os.tmpdir(); const tempDirReal = getRealPath(tempDir); const homeDir = os.homedir(); From 787ed3c704d31f23ba4e1b80e010c72510e2cf8a Mon Sep 17 00:00:00 2001 From: sebastien Date: Wed, 31 Dec 2025 15:36:44 +0100 Subject: [PATCH 21/35] remove logs --- jest/snapshotPathNormalizer.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/jest/snapshotPathNormalizer.ts b/jest/snapshotPathNormalizer.ts index 32c7e96fcc1b..b380d033af8d 100644 --- a/jest/snapshotPathNormalizer.ts +++ b/jest/snapshotPathNormalizer.ts @@ -66,8 +66,6 @@ function normalizePaths(value: T): T { const cwd = process.cwd(); const cwdReal = getRealPath(cwd); - console.log('CWD:', cwd); - console.log('CWD Real:', cwdReal); const tempDir = os.tmpdir(); const tempDirReal = getRealPath(tempDir); From c57db483fc4dcb49dd41a7cee73b79bf31c5420a Mon Sep 17 00:00:00 2001 From: sebastien Date: Wed, 31 Dec 2025 19:32:18 +0100 Subject: [PATCH 22/35] try to normalize windows paths --- jest/snapshotPathNormalizer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jest/snapshotPathNormalizer.ts b/jest/snapshotPathNormalizer.ts index 378344c108b5..d54c6f261775 100644 --- a/jest/snapshotPathNormalizer.ts +++ b/jest/snapshotPathNormalizer.ts @@ -11,7 +11,7 @@ import os from 'os'; import path from 'path'; import _ from 'lodash'; -import {escapePath} from '@docusaurus/utils'; +import {escapePath, posixPath} from '@docusaurus/utils'; import {version} from '@docusaurus/core/package.json'; import stripAnsi from 'strip-ansi'; @@ -71,8 +71,10 @@ function normalizePaths(value: T): T { const runner: ((val: string) => string)[] = [ (val) => (val.includes('keepAnsi') ? val : stripAnsi(val)), + // Replace process.cwd with (val) => val.split(cwd).join(''), + (val) => val.split(posixPath(cwd)).join(''), // Replace temp directory with (val) => val.split(tempDir).join(''), From 8dcf2339453a4c861df656596716f3e974db308c Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 1 Jan 2026 11:50:33 +0100 Subject: [PATCH 23/35] remove log --- .../server/translations/__tests__/translationsExtractor.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts b/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts index f626494214bf..69c9ec46831f 100644 --- a/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts +++ b/packages/docusaurus/src/server/translations/__tests__/translationsExtractor.test.ts @@ -17,7 +17,6 @@ async function createTmpDir() { const {path: siteDirPath} = await tmp.dir({ prefix: 'jest-createTmpSiteDir', }); - console.log(`Created temporary directory at ${siteDirPath}`); return siteDirPath; } From 5389e3a2d752d46ccde2fb37ea784e34a36e0263 Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 1 Jan 2026 11:55:13 +0100 Subject: [PATCH 24/35] remove absolute glob translations --- packages/docusaurus-utils/src/globUtils.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index c26e84ab65d7..305b3ff383cf 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -136,8 +136,6 @@ export const isTranslatableSourceFile: (filePath: string) => boolean = (() => { export async function globTranslatableSourceFiles( patterns: string[], ): Promise { - const filePaths = await safeGlobby(patterns, { - absolute: true, - }); + const filePaths = await safeGlobby(patterns); return filePaths.filter(isTranslatableSourceFile); } From 736aaa5d3fe0bb13eff443c43a8f60024c922f13 Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 1 Jan 2026 11:55:25 +0100 Subject: [PATCH 25/35] remove absolute glob translations --- .../docusaurus-theme-translations/src/__tests__/utils.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts index 3b86d354ad7a..a2b253fb91c6 100644 --- a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts +++ b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts @@ -18,7 +18,7 @@ describe('extractThemeCodeMessages', () => { Some warnings were found! Translate content could not be extracted. It has to be a static string and use optional but static props, like text. - File: /packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 4 + File: packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 4 Full code: {index} " `); From 2b1dccea2bfb8aca90eba86a7f69c291cb9ee347 Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 1 Jan 2026 11:55:51 +0100 Subject: [PATCH 26/35] improve eject glob workaround --- packages/docusaurus/src/commands/swizzle/actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index 32f90cbf2133..f0b9d51bcb0e 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -63,9 +63,9 @@ export async function eject({ const filesToCopy = await Globby(globPatternPosix, { // Workaround for Tinyglobby bug? - // We glob from the repo root, not from the website dir + // We glob absolute from the theme root path, not from cwd // See https://github.com/SuperchupuDev/tinyglobby/issues/186 - cwd: path.join(process.cwd(), '..'), + cwd: themePath, absolute: true, ignore: _.compact([ From 77da395bb65b438b1b92914ebe8270f8f657ca00 Mon Sep 17 00:00:00 2001 From: sebastien Date: Thu, 1 Jan 2026 12:09:53 +0100 Subject: [PATCH 27/35] fix windows globbing issue again? --- .../docusaurus-theme-translations/src/__tests__/utils.test.ts | 2 +- packages/docusaurus-utils/src/globUtils.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts index a2b253fb91c6..3b86d354ad7a 100644 --- a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts +++ b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts @@ -18,7 +18,7 @@ describe('extractThemeCodeMessages', () => { Some warnings were found! Translate content could not be extracted. It has to be a static string and use optional but static props, like text. - File: packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 4 + File: /packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 4 Full code: {index} " `); diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index 305b3ff383cf..c26e84ab65d7 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -136,6 +136,8 @@ export const isTranslatableSourceFile: (filePath: string) => boolean = (() => { export async function globTranslatableSourceFiles( patterns: string[], ): Promise { - const filePaths = await safeGlobby(patterns); + const filePaths = await safeGlobby(patterns, { + absolute: true, + }); return filePaths.filter(isTranslatableSourceFile); } From 22e5fe5405f3355cc04da115f0f9cf8dafc1d51e Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 17:30:21 +0200 Subject: [PATCH 28/35] fix snapshot --- .../src/__tests__/utils.test.ts | 5 ++--- packages/docusaurus-theme-translations/src/utils.ts | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts index 7e7a0eedd33f..08ccf37e999c 100644 --- a/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts +++ b/packages/docusaurus-theme-translations/src/__tests__/utils.test.ts @@ -14,12 +14,11 @@ describe('extractThemeCodeMessages', () => { await expect(() => extractThemeCodeMessages([path.join(__dirname, '__fixtures__/theme')]), ).rejects.toThrowErrorMatchingInlineSnapshot(` - [Error: - Please make sure all theme translations are static! + [Error: Please make sure all theme translations are static! Some warnings were found! Translate content could not be extracted. It has to be a static string and use optional but static props, like text. - File: packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 5 + File: /packages/docusaurus-theme-translations/src/__tests__/__fixtures__/theme/index.js at line 5 Full code: {index} ] `); diff --git a/packages/docusaurus-theme-translations/src/utils.ts b/packages/docusaurus-theme-translations/src/utils.ts index 9b3d313ff798..6eda4f98919a 100644 --- a/packages/docusaurus-theme-translations/src/utils.ts +++ b/packages/docusaurus-theme-translations/src/utils.ts @@ -72,8 +72,7 @@ export async function extractThemeCodeMessages( filesExtractedTranslations.forEach((fileExtractedTranslations) => { if (fileExtractedTranslations.warnings.length > 0) { - throw new Error(` -Please make sure all theme translations are static! + throw new Error(`Please make sure all theme translations are static! Some warnings were found! ${fileExtractedTranslations.warnings.join('\n\n')} From 8af4f011511c5d73a2f1423e28f55dae4046d7ab Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 17:34:10 +0200 Subject: [PATCH 29/35] fix extractSourceCodeFileTranslations --- .../src/__tests__/babelTranslationsExtractor.test.ts | 12 +++--------- .../src/babelTranslationsExtractor.ts | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts b/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts index b3b08839339f..0f9e3dd6cfb4 100644 --- a/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts +++ b/packages/docusaurus-babel/src/__tests__/babelTranslationsExtractor.test.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import {describe, expect, it, vi} from 'vitest'; +import {describe, expect, it} from 'vitest'; import fs from 'fs-extra'; import {mkdtempDisposable, realpath} from 'node:fs/promises'; import {tmpdir} from 'node:os'; @@ -53,16 +53,10 @@ const default => { `, }); - using error = vi.spyOn(console, 'error'); - await expect( extractSourceCodeFileTranslations(sourceCodeFile.path, TestBabelOptions), - ).rejects.toThrow(); - - expect(error).toHaveBeenCalledWith( - expect.stringMatching( - /Error while attempting to extract Docusaurus translations from source code file at/, - ), + ).rejects.toThrow( + /Error while attempting to extract Docusaurus translations from source code file at/, ); }); diff --git a/packages/docusaurus-babel/src/babelTranslationsExtractor.ts b/packages/docusaurus-babel/src/babelTranslationsExtractor.ts index 9675d1176f57..e53d21ce1a81 100644 --- a/packages/docusaurus-babel/src/babelTranslationsExtractor.ts +++ b/packages/docusaurus-babel/src/babelTranslationsExtractor.ts @@ -58,7 +58,7 @@ export async function extractSourceCodeFileTranslations( } catch (err) { throw new Error( logger.interpolate`Error while attempting to extract Docusaurus translations from source code file at path=${sourceCodeFilePath}.`, - {cause: err as Error}, + {cause: err}, ); } } From f85bb9da9cedfd51455e77e1bc3aa284e011f13f Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 18:19:23 +0200 Subject: [PATCH 30/35] try migrate globUtils --- packages/docusaurus-utils/src/globUtils.ts | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index c26e84ab65d7..b713c7eb18c3 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -8,17 +8,27 @@ // Globby/Micromatch are the 2 libs we use in Docusaurus consistently import path from 'path'; +import {glob} from 'node:fs/promises'; +import {join} from 'node:path'; import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby import {addSuffix} from '@docusaurus/utils-common'; -import * as Tinyglobby from 'tinyglobby'; import {posixPath} from './pathUtils'; -type GlobOptions = Tinyglobby.GlobOptions; +type GlobOptions = { + cwd?: string; + exclude?: ((fileName: string) => boolean) | readonly string[]; +}; -// TODO Docusaurus v4 refactor, hide lib behind home-made abstraction -// See https://github.com/facebook/docusaurus/pull/11042 -/** A re-export of the globby instance. */ -export const Globby = Tinyglobby.glob; +export async function Globby( + patterns: string | readonly string[], + options?: GlobOptions, +): Promise { + const files = await Array.fromAsync( + glob(patterns, {...options, withFileTypes: true} as any), + ); + + return files.filter((d) => d.isFile()).map((d) => join(d.parentPath, d.name)); +} /** * The default glob patterns we ignore when sourcing content. @@ -137,7 +147,7 @@ export async function globTranslatableSourceFiles( patterns: string[], ): Promise { const filePaths = await safeGlobby(patterns, { - absolute: true, + // absolute: true, }); return filePaths.filter(isTranslatableSourceFile); } From 3cdacd88a511f0936908d5f540e085363e553ce1 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 18:36:15 +0200 Subject: [PATCH 31/35] try migrate globUtils --- packages/docusaurus-utils/src/globUtils.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index b713c7eb18c3..b533d02e114e 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -9,25 +9,35 @@ import path from 'path'; import {glob} from 'node:fs/promises'; -import {join} from 'node:path'; import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby import {addSuffix} from '@docusaurus/utils-common'; import {posixPath} from './pathUtils'; type GlobOptions = { cwd?: string; + absolute?: boolean; exclude?: ((fileName: string) => boolean) | readonly string[]; }; export async function Globby( patterns: string | readonly string[], - options?: GlobOptions, + options: GlobOptions = {}, ): Promise { + const {absolute, cwd, exclude} = options; const files = await Array.fromAsync( - glob(patterns, {...options, withFileTypes: true} as any), + glob(patterns, {patterns, cwd, exclude, withFileTypes: true} as any), ); - return files.filter((d) => d.isFile()).map((d) => join(d.parentPath, d.name)); + return files + .filter((d) => d.isFile()) + .map((d) => { + const absolutePath = path.join(d.parentPath, d.name); + if (absolute) { + return absolutePath; + } else { + return path.relative(cwd ?? process.cwd(), absolutePath); + } + }); } /** From 141f3b5f71dccb22f526d764e59da9b74a2cbfbd Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 18:37:00 +0200 Subject: [PATCH 32/35] migrate glob options --- packages/docusaurus-plugin-content-blog/src/blogUtils.ts | 2 +- packages/docusaurus-plugin-content-docs/src/docs.ts | 2 +- packages/docusaurus-plugin-content-pages/src/content.ts | 2 +- packages/docusaurus/src/commands/swizzle/actions.ts | 6 +----- packages/docusaurus/src/webpack/aliases/index.ts | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/docusaurus-plugin-content-blog/src/blogUtils.ts b/packages/docusaurus-plugin-content-blog/src/blogUtils.ts index a30480b84025..d3bdae46ce5b 100644 --- a/packages/docusaurus-plugin-content-blog/src/blogUtils.ts +++ b/packages/docusaurus-plugin-content-blog/src/blogUtils.ts @@ -399,7 +399,7 @@ export async function generateBlogPosts( const blogSourceFiles = await Globby(include, { cwd: contentPaths.contentPath, - ignore: exclude, + exclude, }); async function doProcessBlogSourceFile(blogSourceFile: string) { diff --git a/packages/docusaurus-plugin-content-docs/src/docs.ts b/packages/docusaurus-plugin-content-docs/src/docs.ts index 06704fbff1dd..c74bccec662b 100644 --- a/packages/docusaurus-plugin-content-docs/src/docs.ts +++ b/packages/docusaurus-plugin-content-docs/src/docs.ts @@ -68,7 +68,7 @@ export async function readVersionDocs( ): Promise { const sources = await Globby(options.include, { cwd: versionMetadata.contentPath, - ignore: options.exclude, + exclude: options.exclude, }); return Promise.all( sources.map((source) => readDocFile(versionMetadata, source)), diff --git a/packages/docusaurus-plugin-content-pages/src/content.ts b/packages/docusaurus-plugin-content-pages/src/content.ts index 1ddc6eeb5616..65fa6af26205 100644 --- a/packages/docusaurus-plugin-content-pages/src/content.ts +++ b/packages/docusaurus-plugin-content-pages/src/content.ts @@ -71,7 +71,7 @@ export async function loadPagesContent( const pagesFiles = await Globby(params.options.include, { cwd: params.contentPaths.contentPath, - ignore: options.exclude, + exclude: options.exclude, }); async function doProcessPageSourceFile(relativeSource: string) { diff --git a/packages/docusaurus/src/commands/swizzle/actions.ts b/packages/docusaurus/src/commands/swizzle/actions.ts index f0b9d51bcb0e..023709fc6ce7 100644 --- a/packages/docusaurus/src/commands/swizzle/actions.ts +++ b/packages/docusaurus/src/commands/swizzle/actions.ts @@ -62,13 +62,9 @@ export async function eject({ const globPatternPosix = posixPath(globPattern); const filesToCopy = await Globby(globPatternPosix, { - // Workaround for Tinyglobby bug? - // We glob absolute from the theme root path, not from cwd - // See https://github.com/SuperchupuDev/tinyglobby/issues/186 cwd: themePath, absolute: true, - - ignore: _.compact([ + exclude: _.compact([ '**/*.{story,stories,test,tests}.{js,jsx,ts,tsx}', // When ejecting JS components, we want to avoid emitting TS files // In particular the .d.ts files that theme build output contains diff --git a/packages/docusaurus/src/webpack/aliases/index.ts b/packages/docusaurus/src/webpack/aliases/index.ts index 03e14426b04d..3dee22efda9a 100644 --- a/packages/docusaurus/src/webpack/aliases/index.ts +++ b/packages/docusaurus/src/webpack/aliases/index.ts @@ -53,7 +53,7 @@ export async function createAliasesForTheme( const themeComponentFiles = await Globby(['**/*.{js,jsx,ts,tsx}'], { cwd: themePath, - ignore: [ + exclude: [ // Ignore co-located test files '**/__tests__/**', '**/*.test.{js,jsx,ts,tsx}', From 3ceeea949ae4d3d5efd0b54e0bf33240c7cb5ed3 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 19:07:08 +0200 Subject: [PATCH 33/35] poc migration of glob native failures --- .../docusaurus-theme-translations/src/utils.ts | 4 +++- packages/docusaurus-utils/src/globUtils.ts | 15 ++++++++++++--- .../server/translations/translationsExtractor.ts | 6 ++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/packages/docusaurus-theme-translations/src/utils.ts b/packages/docusaurus-theme-translations/src/utils.ts index 6eda4f98919a..4f605029af68 100644 --- a/packages/docusaurus-theme-translations/src/utils.ts +++ b/packages/docusaurus-theme-translations/src/utils.ts @@ -59,7 +59,9 @@ export async function extractThemeCodeMessages( // eslint-disable-next-line no-param-reassign targetDirs ??= (await getThemes()).flatMap((theme) => theme.src); - const filePaths = (await globTranslatableSourceFiles(targetDirs)).filter( + const patterns = targetDirs.map((dir) => path.join(dir, '**/*')); + + const filePaths = (await globTranslatableSourceFiles(patterns)).filter( (filePath) => ['.js', '.jsx'].includes(path.extname(filePath)), ); diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index b533d02e114e..0396e44755c6 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -17,18 +17,22 @@ type GlobOptions = { cwd?: string; absolute?: boolean; exclude?: ((fileName: string) => boolean) | readonly string[]; + expandDirectories?: boolean; }; export async function Globby( patterns: string | readonly string[], options: GlobOptions = {}, ): Promise { - const {absolute, cwd, exclude} = options; + const {absolute, cwd, exclude, expandDirectories} = options; + + console.log({patterns, expandDirectories}); // TODO wire + const files = await Array.fromAsync( glob(patterns, {patterns, cwd, exclude, withFileTypes: true} as any), ); - return files + const filePaths = files .filter((d) => d.isFile()) .map((d) => { const absolutePath = path.join(d.parentPath, d.name); @@ -38,6 +42,11 @@ export async function Globby( return path.relative(cwd ?? process.cwd(), absolutePath); } }); + + console.log({filePaths}); + filePaths.sort(); + + return filePaths; } /** @@ -157,7 +166,7 @@ export async function globTranslatableSourceFiles( patterns: string[], ): Promise { const filePaths = await safeGlobby(patterns, { - // absolute: true, + absolute: true, }); return filePaths.filter(isTranslatableSourceFile); } diff --git a/packages/docusaurus/src/server/translations/translationsExtractor.ts b/packages/docusaurus/src/server/translations/translationsExtractor.ts index f3a778286e13..bb17ae54beb1 100644 --- a/packages/docusaurus/src/server/translations/translationsExtractor.ts +++ b/packages/docusaurus/src/server/translations/translationsExtractor.ts @@ -32,7 +32,7 @@ function getPluginSourceCodeFilePaths(plugin: InitializedPlugin): string[] { // We also include theme code const themePath = plugin.getThemePath?.(); if (themePath) { - codePaths.push(themePath); + codePaths.push(nodePath.join(themePath, '**/*')); } return codePaths.map((p) => nodePath.resolve(plugin.path, p)); @@ -42,7 +42,9 @@ async function getSourceCodeFilePaths( siteDir: string, plugins: InitializedPlugin[], ): Promise { - const sitePaths = getSiteSourceCodeFilePaths(siteDir); + const sitePaths = getSiteSourceCodeFilePaths(siteDir).map((p) => + nodePath.join(p, '**/*'), + ); // The getPathsToWatch() generally returns the js/jsx/ts/tsx/md/mdx file paths // We can use this method as well to know which folders we should try to From 414d34081a03ded2965e40625bd23952605b7804 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 19:10:39 +0200 Subject: [PATCH 34/35] update snapshot --- .../__snapshots__/index.test.ts.snap | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap b/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap index c6c95b5c6f84..f571e6696324 100644 --- a/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap +++ b/packages/docusaurus-plugin-content-pages/src/__tests__/__snapshots__/index.test.ts.snap @@ -2,16 +2,6 @@ exports[`docusaurus-plugin-content-pages > loads simple pages 1`] = ` [ - { - "permalink": "/", - "source": "@site/src/pages/index.js", - "type": "jsx", - }, - { - "permalink": "/typescript", - "source": "@site/src/pages/typescript.tsx", - "type": "jsx", - }, { "description": "Markdown index page", "editUrl": undefined, @@ -67,21 +57,21 @@ exports[`docusaurus-plugin-content-pages > loads simple pages 1`] = ` "source": "@site/src/pages/hello/world.js", "type": "jsx", }, -] -`; - -exports[`docusaurus-plugin-content-pages > loads simple pages with french translations (translate: false) 1`] = ` -[ { - "permalink": "/fr/", + "permalink": "/", "source": "@site/src/pages/index.js", "type": "jsx", }, { - "permalink": "/fr/typescript", + "permalink": "/typescript", "source": "@site/src/pages/typescript.tsx", "type": "jsx", }, +] +`; + +exports[`docusaurus-plugin-content-pages > loads simple pages with french translations (translate: false) 1`] = ` +[ { "description": "Markdown index page", "editUrl": undefined, @@ -137,11 +127,6 @@ exports[`docusaurus-plugin-content-pages > loads simple pages with french transl "source": "@site/src/pages/hello/world.js", "type": "jsx", }, -] -`; - -exports[`docusaurus-plugin-content-pages > loads simple pages with french translations 1`] = ` -[ { "permalink": "/fr/", "source": "@site/src/pages/index.js", @@ -152,6 +137,11 @@ exports[`docusaurus-plugin-content-pages > loads simple pages with french transl "source": "@site/src/pages/typescript.tsx", "type": "jsx", }, +] +`; + +exports[`docusaurus-plugin-content-pages > loads simple pages with french translations 1`] = ` +[ { "description": "Markdown index page", "editUrl": undefined, @@ -207,21 +197,21 @@ exports[`docusaurus-plugin-content-pages > loads simple pages with french transl "source": "@site/src/pages/hello/world.js", "type": "jsx", }, -] -`; - -exports[`docusaurus-plugin-content-pages > loads simple pages with last update 1`] = ` -[ { - "permalink": "/", + "permalink": "/fr/", "source": "@site/src/pages/index.js", "type": "jsx", }, { - "permalink": "/typescript", + "permalink": "/fr/typescript", "source": "@site/src/pages/typescript.tsx", "type": "jsx", }, +] +`; + +exports[`docusaurus-plugin-content-pages > loads simple pages with last update 1`] = ` +[ { "description": "Markdown index page", "editUrl": "url placeholder", @@ -277,5 +267,15 @@ exports[`docusaurus-plugin-content-pages > loads simple pages with last update 1 "source": "@site/src/pages/hello/world.js", "type": "jsx", }, + { + "permalink": "/", + "source": "@site/src/pages/index.js", + "type": "jsx", + }, + { + "permalink": "/typescript", + "source": "@site/src/pages/typescript.tsx", + "type": "jsx", + }, ] `; From f6a18dfc67e054865cd613406bd035e472abccef Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 12 Jun 2026 19:18:02 +0200 Subject: [PATCH 35/35] fix changelog plugin --- packages/docusaurus-utils/src/globUtils.ts | 2 +- website/src/plugins/changelog/index.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-utils/src/globUtils.ts b/packages/docusaurus-utils/src/globUtils.ts index 0396e44755c6..f632e309bae4 100644 --- a/packages/docusaurus-utils/src/globUtils.ts +++ b/packages/docusaurus-utils/src/globUtils.ts @@ -26,7 +26,7 @@ export async function Globby( ): Promise { const {absolute, cwd, exclude, expandDirectories} = options; - console.log({patterns, expandDirectories}); // TODO wire + console.log({patterns, expandDirectories}); // TODO wire expandDirectories ? const files = await Array.fromAsync( glob(patterns, {patterns, cwd, exclude, withFileTypes: true} as any), diff --git a/website/src/plugins/changelog/index.ts b/website/src/plugins/changelog/index.ts index da009a7c2caf..248460e4103c 100644 --- a/website/src/plugins/changelog/index.ts +++ b/website/src/plugins/changelog/index.ts @@ -20,10 +20,14 @@ export {validateOptions} from '@docusaurus/plugin-content-blog'; const MonorepoRoot = path.resolve(path.join(__dirname, '../../../..')); -const ChangelogFilePattern = 'CHANGELOG(-v[0-9]*)?.md'; +const ChangelogFileNames = [ + 'CHANGELOG.md', + 'CHANGELOG-v2.md', + 'CHANGELOG-v3.md', +]; async function getChangelogFiles() { - const files = await safeGlobby([ChangelogFilePattern], { + const files = await safeGlobby(ChangelogFileNames, { cwd: MonorepoRoot, }); // As of today, there are 2 changelog files @@ -110,7 +114,7 @@ const ChangelogPlugin: typeof pluginContentBlog = }, getPathsToWatch() { - return [path.join(MonorepoRoot, ChangelogFilePattern)]; + return ChangelogFileNames.map((name) => path.join(MonorepoRoot, name)); }, }; };