mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-17 08:37:57 +02:00
Merge d98d5b95cc
into a3324ff65e
This commit is contained in:
commit
858997173f
4 changed files with 22 additions and 19 deletions
|
@ -26,7 +26,6 @@
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"fs-extra": "^11.1.1",
|
"fs-extra": "^11.1.1",
|
||||||
"github-slugger": "^1.5.0",
|
"github-slugger": "^1.5.0",
|
||||||
"globby": "^11.1.0",
|
|
||||||
"gray-matter": "^4.0.3",
|
"gray-matter": "^4.0.3",
|
||||||
"jiti": "^1.20.0",
|
"jiti": "^1.20.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
|
@ -35,6 +34,7 @@
|
||||||
"p-queue": "^6.6.2",
|
"p-queue": "^6.6.2",
|
||||||
"prompts": "^2.4.2",
|
"prompts": "^2.4.2",
|
||||||
"resolve-pathname": "^3.0.0",
|
"resolve-pathname": "^3.0.0",
|
||||||
|
"tinyglobby": "^0.2.14",
|
||||||
"tslib": "^2.6.0",
|
"tslib": "^2.6.0",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"utility-types": "^3.10.0",
|
"utility-types": "^3.10.0",
|
||||||
|
|
|
@ -10,11 +10,15 @@
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby
|
import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby
|
||||||
import {addSuffix} from '@docusaurus/utils-common';
|
import {addSuffix} from '@docusaurus/utils-common';
|
||||||
import Globby from 'globby';
|
import * as Tinyglobby from 'tinyglobby';
|
||||||
import {posixPath} from './pathUtils';
|
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. */
|
/** A re-export of the globby instance. */
|
||||||
export {Globby};
|
export const Globby = Tinyglobby.glob;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The default glob patterns we ignore when sourcing content.
|
* 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
|
// See https://github.com/facebook/docusaurus/pull/4222#issuecomment-795517329
|
||||||
export async function safeGlobby(
|
export async function safeGlobby(
|
||||||
patterns: string[],
|
patterns: string[],
|
||||||
options?: Globby.GlobbyOptions,
|
options?: GlobOptions,
|
||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
// Required for Windows support, as paths using \ should not be used by globby
|
// 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)
|
// (also using the windows hard drive prefix like c: is not a good idea)
|
||||||
|
|
|
@ -47,12 +47,11 @@ export async function writeHeadingIds(
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const siteDir = await fs.realpath(siteDirParam);
|
const siteDir = await fs.realpath(siteDirParam);
|
||||||
|
|
||||||
const markdownFiles = await safeGlobby(
|
const markdownFiles = (
|
||||||
files ?? (await getPathsToWatch(siteDir)),
|
await safeGlobby(files ?? (await getPathsToWatch(siteDir)), {
|
||||||
{
|
expandDirectories: true,
|
||||||
expandDirectories: ['**/*.{md,mdx}'],
|
})
|
||||||
},
|
).filter((file) => file.endsWith('.md') || file.endsWith('.mdx'));
|
||||||
);
|
|
||||||
|
|
||||||
const result = await Promise.all(
|
const result = await Promise.all(
|
||||||
markdownFiles.map((p) => transformMarkdownFile(p, options)),
|
markdownFiles.map((p) => transformMarkdownFile(p, options)),
|
||||||
|
|
18
yarn.lock
18
yarn.lock
|
@ -8869,10 +8869,10 @@ fb-watchman@^2.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
bser "2.1.1"
|
bser "2.1.1"
|
||||||
|
|
||||||
fdir@^6.4.3:
|
fdir@^6.4.4:
|
||||||
version "6.4.3"
|
version "6.4.4"
|
||||||
resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.3.tgz#011cdacf837eca9b811c89dbb902df714273db72"
|
resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.4.4.tgz#1cfcf86f875a883e19a8fab53622cfe992e8d2f9"
|
||||||
integrity sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==
|
integrity sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==
|
||||||
|
|
||||||
feed@^4.2.2:
|
feed@^4.2.2:
|
||||||
version "4.2.2"
|
version "4.2.2"
|
||||||
|
@ -17534,12 +17534,12 @@ tinyexec@^0.3.2:
|
||||||
resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2"
|
resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.2.tgz#941794e657a85e496577995c6eef66f53f42b3d2"
|
||||||
integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==
|
integrity sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==
|
||||||
|
|
||||||
tinyglobby@^0.2.12:
|
tinyglobby@^0.2.12, tinyglobby@^0.2.14:
|
||||||
version "0.2.12"
|
version "0.2.14"
|
||||||
resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.12.tgz#ac941a42e0c5773bd0b5d08f32de82e74a1a61b5"
|
resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.14.tgz#5280b0cf3f972b050e74ae88406c0a6a58f4079d"
|
||||||
integrity sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==
|
integrity sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
fdir "^6.4.3"
|
fdir "^6.4.4"
|
||||||
picomatch "^4.0.2"
|
picomatch "^4.0.2"
|
||||||
|
|
||||||
tinypool@^1.0.2:
|
tinypool@^1.0.2:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue