@docusaurus/core 3.8.1-canary-6350 → 3.8.1-canary-6353
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,8 +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 { FasterConfig, FutureConfig, FutureV4Config, StorageConfig } from '@docusaurus/types
|
|
9
|
-
import type { DocusaurusConfig, I18nConfig, MarkdownConfig } from '@docusaurus/types';
|
|
8
|
+
import type { FasterConfig, FutureConfig, FutureV4Config, StorageConfig, DocusaurusConfig, I18nConfig, MarkdownConfig, MarkdownHooks } from '@docusaurus/types';
|
|
10
9
|
export declare const DEFAULT_I18N_CONFIG: I18nConfig;
|
|
11
10
|
export declare const DEFAULT_STORAGE_CONFIG: StorageConfig;
|
|
12
11
|
export declare const DEFAULT_FASTER_CONFIG: FasterConfig;
|
|
@@ -14,6 +13,7 @@ export declare const DEFAULT_FASTER_CONFIG_TRUE: FasterConfig;
|
|
|
14
13
|
export declare const DEFAULT_FUTURE_V4_CONFIG: FutureV4Config;
|
|
15
14
|
export declare const DEFAULT_FUTURE_V4_CONFIG_TRUE: FutureV4Config;
|
|
16
15
|
export declare const DEFAULT_FUTURE_CONFIG: FutureConfig;
|
|
16
|
+
export declare const DEFAULT_MARKDOWN_HOOKS: MarkdownHooks;
|
|
17
17
|
export declare const DEFAULT_MARKDOWN_CONFIG: MarkdownConfig;
|
|
18
18
|
export declare const DEFAULT_CONFIG: Pick<DocusaurusConfig, 'i18n' | 'future' | 'onBrokenLinks' | 'onBrokenAnchors' | 'onBrokenMarkdownLinks' | 'onDuplicateRoutes' | 'plugins' | 'themes' | 'presets' | 'headTags' | 'stylesheets' | 'scripts' | 'clientModules' | 'customFields' | 'themeConfig' | 'titleDelimiter' | 'noIndex' | 'tagline' | 'baseUrlIssueBanner' | 'staticDirectories' | 'markdown'>;
|
|
19
19
|
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_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_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");
|
|
@@ -60,9 +60,14 @@ exports.DEFAULT_FUTURE_CONFIG = {
|
|
|
60
60
|
experimental_storage: exports.DEFAULT_STORAGE_CONFIG,
|
|
61
61
|
experimental_router: 'browser',
|
|
62
62
|
};
|
|
63
|
+
exports.DEFAULT_MARKDOWN_HOOKS = {
|
|
64
|
+
onBrokenMarkdownLinks: 'warn',
|
|
65
|
+
onBrokenMarkdownImages: 'throw',
|
|
66
|
+
};
|
|
63
67
|
exports.DEFAULT_MARKDOWN_CONFIG = {
|
|
64
68
|
format: 'mdx', // TODO change this to "detect" in Docusaurus v4?
|
|
65
69
|
mermaid: false,
|
|
70
|
+
emoji: true,
|
|
66
71
|
preprocessor: undefined,
|
|
67
72
|
parseFrontMatter: utils_1.DEFAULT_PARSE_FRONT_MATTER,
|
|
68
73
|
mdx1Compat: {
|
|
@@ -74,13 +79,14 @@ exports.DEFAULT_MARKDOWN_CONFIG = {
|
|
|
74
79
|
maintainCase: false,
|
|
75
80
|
},
|
|
76
81
|
remarkRehypeOptions: undefined,
|
|
82
|
+
hooks: exports.DEFAULT_MARKDOWN_HOOKS,
|
|
77
83
|
};
|
|
78
84
|
exports.DEFAULT_CONFIG = {
|
|
79
85
|
i18n: exports.DEFAULT_I18N_CONFIG,
|
|
80
86
|
future: exports.DEFAULT_FUTURE_CONFIG,
|
|
81
87
|
onBrokenLinks: 'throw',
|
|
82
88
|
onBrokenAnchors: 'warn', // TODO Docusaurus v4: change to throw
|
|
83
|
-
onBrokenMarkdownLinks:
|
|
89
|
+
onBrokenMarkdownLinks: undefined,
|
|
84
90
|
onDuplicateRoutes: 'warn',
|
|
85
91
|
plugins: [],
|
|
86
92
|
themes: [],
|
|
@@ -248,7 +254,7 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
248
254
|
.default(exports.DEFAULT_CONFIG.onBrokenAnchors),
|
|
249
255
|
onBrokenMarkdownLinks: utils_validation_1.Joi.string()
|
|
250
256
|
.equal('ignore', 'log', 'warn', 'throw')
|
|
251
|
-
.default(exports.DEFAULT_CONFIG.onBrokenMarkdownLinks),
|
|
257
|
+
.default(() => exports.DEFAULT_CONFIG.onBrokenMarkdownLinks),
|
|
252
258
|
onDuplicateRoutes: utils_validation_1.Joi.string()
|
|
253
259
|
.equal('ignore', 'log', 'warn', 'throw')
|
|
254
260
|
.default(exports.DEFAULT_CONFIG.onDuplicateRoutes),
|
|
@@ -315,6 +321,7 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
315
321
|
.default(exports.DEFAULT_CONFIG.markdown.format),
|
|
316
322
|
parseFrontMatter: utils_validation_1.Joi.function().default(() => exports.DEFAULT_CONFIG.markdown.parseFrontMatter),
|
|
317
323
|
mermaid: utils_validation_1.Joi.boolean().default(exports.DEFAULT_CONFIG.markdown.mermaid),
|
|
324
|
+
emoji: utils_validation_1.Joi.boolean().default(exports.DEFAULT_CONFIG.markdown.emoji),
|
|
318
325
|
preprocessor: utils_validation_1.Joi.function()
|
|
319
326
|
.arity(1)
|
|
320
327
|
.optional()
|
|
@@ -332,13 +339,29 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
332
339
|
anchors: utils_validation_1.Joi.object({
|
|
333
340
|
maintainCase: utils_validation_1.Joi.boolean().default(exports.DEFAULT_CONFIG.markdown.anchors.maintainCase),
|
|
334
341
|
}).default(exports.DEFAULT_CONFIG.markdown.anchors),
|
|
342
|
+
hooks: utils_validation_1.Joi.object({
|
|
343
|
+
onBrokenMarkdownLinks: utils_validation_1.Joi.alternatives()
|
|
344
|
+
.try(utils_validation_1.Joi.string().equal('ignore', 'log', 'warn', 'throw'), utils_validation_1.Joi.function())
|
|
345
|
+
.default(exports.DEFAULT_CONFIG.markdown.hooks.onBrokenMarkdownLinks),
|
|
346
|
+
onBrokenMarkdownImages: utils_validation_1.Joi.alternatives()
|
|
347
|
+
.try(utils_validation_1.Joi.string().equal('ignore', 'log', 'warn', 'throw'), utils_validation_1.Joi.function())
|
|
348
|
+
.default(exports.DEFAULT_CONFIG.markdown.hooks.onBrokenMarkdownImages),
|
|
349
|
+
}).default(exports.DEFAULT_CONFIG.markdown.hooks),
|
|
335
350
|
}).default(exports.DEFAULT_CONFIG.markdown),
|
|
336
351
|
}).messages({
|
|
337
352
|
'docusaurus.configValidationWarning': 'Docusaurus config validation warning. Field {#label}: {#warningMessage}',
|
|
338
353
|
});
|
|
339
354
|
// Expressing this kind of logic in Joi is a pain
|
|
340
355
|
// We also want to decouple logic from Joi: easier to remove it later!
|
|
341
|
-
function
|
|
356
|
+
function postProcessDocusaurusConfig(config) {
|
|
357
|
+
if (config.onBrokenMarkdownLinks) {
|
|
358
|
+
logger_1.default.warn `The code=${'siteConfig.onBrokenMarkdownLinks'} config option is deprecated and will be removed in Docusaurus v4.
|
|
359
|
+
Please migrate and move this option to code=${'siteConfig.markdown.hooks.onBrokenMarkdownLinks'} instead.`;
|
|
360
|
+
// For v3 retro compatibility we use the old attribute over the new one
|
|
361
|
+
config.markdown.hooks.onBrokenMarkdownLinks = config.onBrokenMarkdownLinks;
|
|
362
|
+
// We erase the former one to ensure we don't use it anywhere
|
|
363
|
+
config.onBrokenMarkdownLinks = undefined;
|
|
364
|
+
}
|
|
342
365
|
if (config.future.experimental_faster.ssgWorkerThreads &&
|
|
343
366
|
!config.future.v4.removeLegacyPostBuildHeadAttribute) {
|
|
344
367
|
throw new Error(`Docusaurus config ${logger_1.default.code('future.experimental_faster.ssgWorkerThreads')} requires the future flag ${logger_1.default.code('future.v4.removeLegacyPostBuildHeadAttribute')} to be turned on.
|
|
@@ -371,6 +394,6 @@ function validateConfig(config, siteConfigPath) {
|
|
|
371
394
|
: formattedError;
|
|
372
395
|
throw new Error(formattedError);
|
|
373
396
|
}
|
|
374
|
-
|
|
397
|
+
postProcessDocusaurusConfig(value);
|
|
375
398
|
return value;
|
|
376
399
|
}
|
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.8.1-canary-
|
|
4
|
+
"version": "3.8.1-canary-6353",
|
|
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.8.1-canary-
|
|
37
|
-
"@docusaurus/bundler": "3.8.1-canary-
|
|
38
|
-
"@docusaurus/logger": "3.8.1-canary-
|
|
39
|
-
"@docusaurus/mdx-loader": "3.8.1-canary-
|
|
40
|
-
"@docusaurus/utils": "3.8.1-canary-
|
|
41
|
-
"@docusaurus/utils-common": "3.8.1-canary-
|
|
42
|
-
"@docusaurus/utils-validation": "3.8.1-canary-
|
|
36
|
+
"@docusaurus/babel": "3.8.1-canary-6353",
|
|
37
|
+
"@docusaurus/bundler": "3.8.1-canary-6353",
|
|
38
|
+
"@docusaurus/logger": "3.8.1-canary-6353",
|
|
39
|
+
"@docusaurus/mdx-loader": "3.8.1-canary-6353",
|
|
40
|
+
"@docusaurus/utils": "3.8.1-canary-6353",
|
|
41
|
+
"@docusaurus/utils-common": "3.8.1-canary-6353",
|
|
42
|
+
"@docusaurus/utils-validation": "3.8.1-canary-6353",
|
|
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.8.1-canary-
|
|
81
|
-
"@docusaurus/types": "3.8.1-canary-
|
|
80
|
+
"@docusaurus/module-type-aliases": "3.8.1-canary-6353",
|
|
81
|
+
"@docusaurus/types": "3.8.1-canary-6353",
|
|
82
82
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
83
83
|
"@types/detect-port": "^1.3.3",
|
|
84
84
|
"@types/react-dom": "^18.2.7",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"engines": {
|
|
99
99
|
"node": ">=18.0"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "341b17e813febec7a8a1ff39f92d7a5066b72eae"
|
|
102
102
|
}
|