@docusaurus/core 3.8.1-canary-6350 → 3.8.1-canary-6352
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,6 +60,10 @@ 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,
|
|
@@ -74,13 +78,14 @@ exports.DEFAULT_MARKDOWN_CONFIG = {
|
|
|
74
78
|
maintainCase: false,
|
|
75
79
|
},
|
|
76
80
|
remarkRehypeOptions: undefined,
|
|
81
|
+
hooks: exports.DEFAULT_MARKDOWN_HOOKS,
|
|
77
82
|
};
|
|
78
83
|
exports.DEFAULT_CONFIG = {
|
|
79
84
|
i18n: exports.DEFAULT_I18N_CONFIG,
|
|
80
85
|
future: exports.DEFAULT_FUTURE_CONFIG,
|
|
81
86
|
onBrokenLinks: 'throw',
|
|
82
87
|
onBrokenAnchors: 'warn', // TODO Docusaurus v4: change to throw
|
|
83
|
-
onBrokenMarkdownLinks:
|
|
88
|
+
onBrokenMarkdownLinks: undefined,
|
|
84
89
|
onDuplicateRoutes: 'warn',
|
|
85
90
|
plugins: [],
|
|
86
91
|
themes: [],
|
|
@@ -248,7 +253,7 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
248
253
|
.default(exports.DEFAULT_CONFIG.onBrokenAnchors),
|
|
249
254
|
onBrokenMarkdownLinks: utils_validation_1.Joi.string()
|
|
250
255
|
.equal('ignore', 'log', 'warn', 'throw')
|
|
251
|
-
.default(exports.DEFAULT_CONFIG.onBrokenMarkdownLinks),
|
|
256
|
+
.default(() => exports.DEFAULT_CONFIG.onBrokenMarkdownLinks),
|
|
252
257
|
onDuplicateRoutes: utils_validation_1.Joi.string()
|
|
253
258
|
.equal('ignore', 'log', 'warn', 'throw')
|
|
254
259
|
.default(exports.DEFAULT_CONFIG.onDuplicateRoutes),
|
|
@@ -332,13 +337,29 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
332
337
|
anchors: utils_validation_1.Joi.object({
|
|
333
338
|
maintainCase: utils_validation_1.Joi.boolean().default(exports.DEFAULT_CONFIG.markdown.anchors.maintainCase),
|
|
334
339
|
}).default(exports.DEFAULT_CONFIG.markdown.anchors),
|
|
340
|
+
hooks: utils_validation_1.Joi.object({
|
|
341
|
+
onBrokenMarkdownLinks: utils_validation_1.Joi.alternatives()
|
|
342
|
+
.try(utils_validation_1.Joi.string().equal('ignore', 'log', 'warn', 'throw'), utils_validation_1.Joi.function())
|
|
343
|
+
.default(exports.DEFAULT_CONFIG.markdown.hooks.onBrokenMarkdownLinks),
|
|
344
|
+
onBrokenMarkdownImages: utils_validation_1.Joi.alternatives()
|
|
345
|
+
.try(utils_validation_1.Joi.string().equal('ignore', 'log', 'warn', 'throw'), utils_validation_1.Joi.function())
|
|
346
|
+
.default(exports.DEFAULT_CONFIG.markdown.hooks.onBrokenMarkdownImages),
|
|
347
|
+
}).default(exports.DEFAULT_CONFIG.markdown.hooks),
|
|
335
348
|
}).default(exports.DEFAULT_CONFIG.markdown),
|
|
336
349
|
}).messages({
|
|
337
350
|
'docusaurus.configValidationWarning': 'Docusaurus config validation warning. Field {#label}: {#warningMessage}',
|
|
338
351
|
});
|
|
339
352
|
// Expressing this kind of logic in Joi is a pain
|
|
340
353
|
// We also want to decouple logic from Joi: easier to remove it later!
|
|
341
|
-
function
|
|
354
|
+
function postProcessDocusaurusConfig(config) {
|
|
355
|
+
if (config.onBrokenMarkdownLinks) {
|
|
356
|
+
logger_1.default.warn `The code=${'siteConfig.onBrokenMarkdownLinks'} config option is deprecated and will be removed in Docusaurus v4.
|
|
357
|
+
Please migrate and move this option to code=${'siteConfig.markdown.hooks.onBrokenMarkdownLinks'} instead.`;
|
|
358
|
+
// For v3 retro compatibility we use the old attribute over the new one
|
|
359
|
+
config.markdown.hooks.onBrokenMarkdownLinks = config.onBrokenMarkdownLinks;
|
|
360
|
+
// We erase the former one to ensure we don't use it anywhere
|
|
361
|
+
config.onBrokenMarkdownLinks = undefined;
|
|
362
|
+
}
|
|
342
363
|
if (config.future.experimental_faster.ssgWorkerThreads &&
|
|
343
364
|
!config.future.v4.removeLegacyPostBuildHeadAttribute) {
|
|
344
365
|
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 +392,6 @@ function validateConfig(config, siteConfigPath) {
|
|
|
371
392
|
: formattedError;
|
|
372
393
|
throw new Error(formattedError);
|
|
373
394
|
}
|
|
374
|
-
|
|
395
|
+
postProcessDocusaurusConfig(value);
|
|
375
396
|
return value;
|
|
376
397
|
}
|
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-6352",
|
|
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-6352",
|
|
37
|
+
"@docusaurus/bundler": "3.8.1-canary-6352",
|
|
38
|
+
"@docusaurus/logger": "3.8.1-canary-6352",
|
|
39
|
+
"@docusaurus/mdx-loader": "3.8.1-canary-6352",
|
|
40
|
+
"@docusaurus/utils": "3.8.1-canary-6352",
|
|
41
|
+
"@docusaurus/utils-common": "3.8.1-canary-6352",
|
|
42
|
+
"@docusaurus/utils-validation": "3.8.1-canary-6352",
|
|
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-6352",
|
|
81
|
+
"@docusaurus/types": "3.8.1-canary-6352",
|
|
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": "a3190d2cdcb4d4ab6704dbd8de92868ef67165cb"
|
|
102
102
|
}
|