@docusaurus/core 3.9.2-canary-6562 → 3.9.2-canary-6568
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { Joi } from '@docusaurus/utils-validation';
|
|
8
|
-
import type { DocusaurusConfig, FasterConfig, FutureConfig, FutureV4Config, I18nConfig, MarkdownConfig, MarkdownHooks, StorageConfig } from '@docusaurus/types';
|
|
8
|
+
import type { DocusaurusConfig, FasterConfig, FutureConfig, FutureV4Config, I18nConfig, MDX1CompatOptions, MarkdownConfig, MarkdownHooks, StorageConfig } from '@docusaurus/types';
|
|
9
9
|
export declare const DEFAULT_I18N_CONFIG: I18nConfig;
|
|
10
10
|
export declare const DEFAULT_STORAGE_CONFIG: StorageConfig;
|
|
11
11
|
export declare const DEFAULT_FASTER_CONFIG: FasterConfig;
|
|
@@ -14,6 +14,7 @@ export declare const DEFAULT_FUTURE_V4_CONFIG: FutureV4Config;
|
|
|
14
14
|
export declare const DEFAULT_FUTURE_V4_CONFIG_TRUE: FutureV4Config;
|
|
15
15
|
export declare const DEFAULT_FUTURE_CONFIG: FutureConfig;
|
|
16
16
|
export declare const DEFAULT_MARKDOWN_HOOKS: MarkdownHooks;
|
|
17
|
+
export declare const DEFAULT_MARKDOWN_MDX1COMPAT: MDX1CompatOptions;
|
|
17
18
|
export declare const DEFAULT_MARKDOWN_CONFIG: MarkdownConfig;
|
|
18
19
|
export declare const DEFAULT_CONFIG: Pick<DocusaurusConfig, 'i18n' | 'storage' | 'future' | 'onBrokenLinks' | 'onBrokenAnchors' | 'onBrokenMarkdownLinks' | 'onDuplicateRoutes' | 'plugins' | 'themes' | 'presets' | 'headTags' | 'stylesheets' | 'scripts' | 'clientModules' | 'customFields' | 'themeConfig' | 'titleDelimiter' | 'noIndex' | 'tagline' | 'baseUrlIssueBanner' | 'staticDirectories' | 'markdown'>;
|
|
19
20
|
export declare const ConfigSchema: Joi.ObjectSchema<DocusaurusConfig>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ConfigSchema = exports.DEFAULT_CONFIG = exports.DEFAULT_MARKDOWN_CONFIG = exports.DEFAULT_MARKDOWN_HOOKS = exports.DEFAULT_FUTURE_CONFIG = exports.DEFAULT_FUTURE_V4_CONFIG_TRUE = exports.DEFAULT_FUTURE_V4_CONFIG = exports.DEFAULT_FASTER_CONFIG_TRUE = exports.DEFAULT_FASTER_CONFIG = exports.DEFAULT_STORAGE_CONFIG = exports.DEFAULT_I18N_CONFIG = void 0;
|
|
9
|
+
exports.ConfigSchema = exports.DEFAULT_CONFIG = exports.DEFAULT_MARKDOWN_CONFIG = exports.DEFAULT_MARKDOWN_MDX1COMPAT = exports.DEFAULT_MARKDOWN_HOOKS = exports.DEFAULT_FUTURE_CONFIG = exports.DEFAULT_FUTURE_V4_CONFIG_TRUE = exports.DEFAULT_FUTURE_V4_CONFIG = exports.DEFAULT_FASTER_CONFIG_TRUE = exports.DEFAULT_FASTER_CONFIG = exports.DEFAULT_STORAGE_CONFIG = exports.DEFAULT_I18N_CONFIG = void 0;
|
|
10
10
|
exports.validateConfig = validateConfig;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
const utils_1 = require("@docusaurus/utils");
|
|
@@ -74,6 +74,7 @@ exports.DEFAULT_FUTURE_V4_CONFIG = {
|
|
|
74
74
|
useCssCascadeLayers: false,
|
|
75
75
|
siteStorageNamespacing: false,
|
|
76
76
|
fasterByDefault: false,
|
|
77
|
+
mdx1CompatDisabledByDefault: false,
|
|
77
78
|
};
|
|
78
79
|
// When using the "v4: true" shortcut
|
|
79
80
|
exports.DEFAULT_FUTURE_V4_CONFIG_TRUE = {
|
|
@@ -81,6 +82,7 @@ exports.DEFAULT_FUTURE_V4_CONFIG_TRUE = {
|
|
|
81
82
|
useCssCascadeLayers: true,
|
|
82
83
|
siteStorageNamespacing: true,
|
|
83
84
|
fasterByDefault: true,
|
|
85
|
+
mdx1CompatDisabledByDefault: true,
|
|
84
86
|
};
|
|
85
87
|
exports.DEFAULT_FUTURE_CONFIG = {
|
|
86
88
|
v4: exports.DEFAULT_FUTURE_V4_CONFIG,
|
|
@@ -92,17 +94,21 @@ exports.DEFAULT_MARKDOWN_HOOKS = {
|
|
|
92
94
|
onBrokenMarkdownLinks: 'warn',
|
|
93
95
|
onBrokenMarkdownImages: 'throw',
|
|
94
96
|
};
|
|
97
|
+
exports.DEFAULT_MARKDOWN_MDX1COMPAT = {
|
|
98
|
+
comments: true,
|
|
99
|
+
admonitions: true,
|
|
100
|
+
headingIds: true,
|
|
101
|
+
};
|
|
95
102
|
exports.DEFAULT_MARKDOWN_CONFIG = {
|
|
96
|
-
|
|
103
|
+
// TODO Docusaurus v5: change this to "detect"?
|
|
104
|
+
// we probably need stable CommonMark support first
|
|
105
|
+
// see https://github.com/facebook/docusaurus/issues/9092
|
|
106
|
+
format: 'mdx',
|
|
97
107
|
mermaid: false,
|
|
98
108
|
emoji: true,
|
|
99
109
|
preprocessor: undefined,
|
|
100
110
|
parseFrontMatter: utils_1.DEFAULT_PARSE_FRONT_MATTER,
|
|
101
|
-
mdx1Compat:
|
|
102
|
-
comments: true,
|
|
103
|
-
admonitions: true,
|
|
104
|
-
headingIds: true,
|
|
105
|
-
},
|
|
111
|
+
mdx1Compat: exports.DEFAULT_MARKDOWN_MDX1COMPAT,
|
|
106
112
|
anchors: {
|
|
107
113
|
maintainCase: false,
|
|
108
114
|
},
|
|
@@ -225,6 +231,7 @@ const FUTURE_V4_SCHEMA = utils_validation_1.Joi.alternatives()
|
|
|
225
231
|
useCssCascadeLayers: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.useCssCascadeLayers),
|
|
226
232
|
siteStorageNamespacing: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.siteStorageNamespacing),
|
|
227
233
|
fasterByDefault: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.fasterByDefault),
|
|
234
|
+
mdx1CompatDisabledByDefault: utils_validation_1.Joi.boolean().default(exports.DEFAULT_FUTURE_V4_CONFIG.mdx1CompatDisabledByDefault),
|
|
228
235
|
}), utils_validation_1.Joi.boolean()
|
|
229
236
|
.required()
|
|
230
237
|
.custom((bool) => bool ? exports.DEFAULT_FUTURE_V4_CONFIG_TRUE : exports.DEFAULT_FUTURE_V4_CONFIG))
|
|
@@ -385,11 +392,14 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
385
392
|
.arity(1)
|
|
386
393
|
.optional()
|
|
387
394
|
.default(() => exports.DEFAULT_CONFIG.markdown.preprocessor),
|
|
395
|
+
// Individual boolean defaults are not set here on purpose
|
|
396
|
+
// They are resolved in postProcessDocusaurusConfig based on
|
|
397
|
+
// the future.v4.mdx1CompatDisabledByDefault flag
|
|
388
398
|
mdx1Compat: utils_validation_1.Joi.object({
|
|
389
|
-
comments: utils_validation_1.Joi.boolean()
|
|
390
|
-
admonitions: utils_validation_1.Joi.boolean()
|
|
391
|
-
headingIds: utils_validation_1.Joi.boolean()
|
|
392
|
-
}).default(
|
|
399
|
+
comments: utils_validation_1.Joi.boolean(),
|
|
400
|
+
admonitions: utils_validation_1.Joi.boolean(),
|
|
401
|
+
headingIds: utils_validation_1.Joi.boolean(),
|
|
402
|
+
}).default({}),
|
|
393
403
|
remarkRehypeOptions:
|
|
394
404
|
// add proper external options validation?
|
|
395
405
|
// Not sure if it's a good idea, validation is likely to become stale
|
|
@@ -406,13 +416,19 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
406
416
|
.try(utils_validation_1.Joi.string().equal('ignore', 'log', 'warn', 'throw'), utils_validation_1.Joi.function())
|
|
407
417
|
.default(exports.DEFAULT_CONFIG.markdown.hooks.onBrokenMarkdownImages),
|
|
408
418
|
}).default(exports.DEFAULT_CONFIG.markdown.hooks),
|
|
409
|
-
}).default(
|
|
419
|
+
}).default({
|
|
420
|
+
...exports.DEFAULT_CONFIG.markdown,
|
|
421
|
+
mdx1Compat: {
|
|
422
|
+
// erased on purpose, filled using postprocessing
|
|
423
|
+
},
|
|
424
|
+
}),
|
|
410
425
|
}).messages({
|
|
411
426
|
'docusaurus.configValidationWarning': 'Docusaurus config validation warning. Field {#label}: {#warningMessage}',
|
|
412
427
|
});
|
|
413
428
|
// Expressing this kind of logic in Joi is a pain
|
|
414
429
|
// We also want to decouple logic from Joi: easier to remove it later!
|
|
415
430
|
function postProcessDocusaurusConfig(config) {
|
|
431
|
+
var _a;
|
|
416
432
|
// Resolve storage.namespace based on the v4 future flag
|
|
417
433
|
// undefined means "not explicitly set by user"
|
|
418
434
|
if (config.storage.namespace === undefined) {
|
|
@@ -430,6 +446,13 @@ function postProcessDocusaurusConfig(config) {
|
|
|
430
446
|
config.future.faster[key] = fasterDefault;
|
|
431
447
|
}
|
|
432
448
|
}
|
|
449
|
+
// Resolve mdx1Compat config based on the v4.mdx1CompatDisabledByDefault flag
|
|
450
|
+
// undefined means "not explicitly set by user"
|
|
451
|
+
const mdx1CompatDefault = !config.future.v4.mdx1CompatDisabledByDefault;
|
|
452
|
+
const mdx1CompatKeys = Object.keys(exports.DEFAULT_MARKDOWN_MDX1COMPAT);
|
|
453
|
+
for (const key of mdx1CompatKeys) {
|
|
454
|
+
(_a = config.markdown.mdx1Compat)[key] ?? (_a[key] = mdx1CompatDefault);
|
|
455
|
+
}
|
|
433
456
|
if (config.onBrokenMarkdownLinks) {
|
|
434
457
|
logger_1.default.warn `The code=${'siteConfig.onBrokenMarkdownLinks'} config option is deprecated and will be removed in Docusaurus v4.
|
|
435
458
|
Please migrate and move this option to code=${'siteConfig.markdown.hooks.onBrokenMarkdownLinks'} instead.`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/core",
|
|
3
3
|
"description": "Easy to Maintain Open Source Documentation Websites",
|
|
4
|
-
"version": "3.9.2-canary-
|
|
4
|
+
"version": "3.9.2-canary-6568",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@docusaurus/babel": "3.9.2-canary-
|
|
37
|
-
"@docusaurus/bundler": "3.9.2-canary-
|
|
38
|
-
"@docusaurus/logger": "3.9.2-canary-
|
|
39
|
-
"@docusaurus/mdx-loader": "3.9.2-canary-
|
|
40
|
-
"@docusaurus/utils": "3.9.2-canary-
|
|
41
|
-
"@docusaurus/utils-common": "3.9.2-canary-
|
|
42
|
-
"@docusaurus/utils-validation": "3.9.2-canary-
|
|
36
|
+
"@docusaurus/babel": "3.9.2-canary-6568",
|
|
37
|
+
"@docusaurus/bundler": "3.9.2-canary-6568",
|
|
38
|
+
"@docusaurus/logger": "3.9.2-canary-6568",
|
|
39
|
+
"@docusaurus/mdx-loader": "3.9.2-canary-6568",
|
|
40
|
+
"@docusaurus/utils": "3.9.2-canary-6568",
|
|
41
|
+
"@docusaurus/utils-common": "3.9.2-canary-6568",
|
|
42
|
+
"@docusaurus/utils-validation": "3.9.2-canary-6568",
|
|
43
43
|
"boxen": "^6.2.1",
|
|
44
44
|
"chalk": "^4.1.2",
|
|
45
45
|
"chokidar": "^3.5.3",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"webpack-merge": "^6.0.1"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@docusaurus/module-type-aliases": "3.9.2-canary-
|
|
81
|
-
"@docusaurus/types": "3.9.2-canary-
|
|
80
|
+
"@docusaurus/module-type-aliases": "3.9.2-canary-6568",
|
|
81
|
+
"@docusaurus/types": "3.9.2-canary-6568",
|
|
82
82
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
83
83
|
"@types/detect-port": "^1.3.3",
|
|
84
84
|
"@types/react-dom": "^19.2.3",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
|
105
|
-
"node": ">=
|
|
105
|
+
"node": ">=24.14"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "3ff37c23de6a4f4e0d24bc0d5e938255a78086fb"
|
|
108
108
|
}
|