@docusaurus/core 4.0.0-canary-6896 → 4.0.0-canary-6898
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.
|
@@ -13,6 +13,6 @@ export declare const DEFAULT_FASTER_CONFIG_TRUE: FasterConfig;
|
|
|
13
13
|
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
|
-
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'>;
|
|
16
|
+
export declare const DEFAULT_CONFIG: Pick<DocusaurusConfig, 'i18n' | 'storage' | 'vcs' | 'future' | 'onBrokenLinks' | 'onBrokenAnchors' | 'onBrokenMarkdownLinks' | 'onDuplicateRoutes' | 'plugins' | 'themes' | 'presets' | 'headTags' | 'stylesheets' | 'scripts' | 'clientModules' | 'customFields' | 'themeConfig' | 'titleDelimiter' | 'noIndex' | 'tagline' | 'baseUrlIssueBanner' | 'staticDirectories' | 'markdown'>;
|
|
17
17
|
export declare const ConfigSchema: Joi.ObjectSchema<DocusaurusConfig>;
|
|
18
18
|
export declare function validateConfig(config: unknown, siteConfigPath: string): DocusaurusConfig;
|
|
@@ -50,7 +50,6 @@ exports.DEFAULT_FASTER_CONFIG = {
|
|
|
50
50
|
swcHtmlMinimizer: false,
|
|
51
51
|
rspackBundler: false,
|
|
52
52
|
rspackPersistentCache: false,
|
|
53
|
-
gitEagerVcs: false,
|
|
54
53
|
};
|
|
55
54
|
// When using the "faster: true" shortcut
|
|
56
55
|
exports.DEFAULT_FASTER_CONFIG_TRUE = {
|
|
@@ -58,7 +57,6 @@ exports.DEFAULT_FASTER_CONFIG_TRUE = {
|
|
|
58
57
|
swcHtmlMinimizer: true,
|
|
59
58
|
rspackBundler: true,
|
|
60
59
|
rspackPersistentCache: true,
|
|
61
|
-
gitEagerVcs: true,
|
|
62
60
|
};
|
|
63
61
|
exports.DEFAULT_FUTURE_V4_CONFIG = {
|
|
64
62
|
useCssCascadeLayers: false,
|
|
@@ -76,7 +74,6 @@ exports.DEFAULT_FUTURE_V4_CONFIG_TRUE = {
|
|
|
76
74
|
exports.DEFAULT_FUTURE_CONFIG = {
|
|
77
75
|
v4: exports.DEFAULT_FUTURE_V4_CONFIG,
|
|
78
76
|
faster: exports.DEFAULT_FASTER_CONFIG,
|
|
79
|
-
experimental_vcs: (0, utils_1.getVcsPreset)('default-v1'),
|
|
80
77
|
experimental_router: 'browser',
|
|
81
78
|
};
|
|
82
79
|
const DEFAULT_MARKDOWN_HOOKS = {
|
|
@@ -108,6 +105,7 @@ const DEFAULT_MARKDOWN_CONFIG = {
|
|
|
108
105
|
exports.DEFAULT_CONFIG = {
|
|
109
106
|
i18n: exports.DEFAULT_I18N_CONFIG,
|
|
110
107
|
storage: exports.DEFAULT_STORAGE_CONFIG,
|
|
108
|
+
vcs: (0, utils_1.getVcsPreset)('default'),
|
|
111
109
|
future: exports.DEFAULT_FUTURE_CONFIG,
|
|
112
110
|
onBrokenLinks: 'throw',
|
|
113
111
|
onBrokenAnchors: 'warn', // TODO Docusaurus v4: change to throw
|
|
@@ -206,7 +204,6 @@ const FASTER_CONFIG_SCHEMA = utils_validation_1.Joi.alternatives()
|
|
|
206
204
|
swcHtmlMinimizer: utils_validation_1.Joi.boolean(),
|
|
207
205
|
rspackBundler: utils_validation_1.Joi.boolean(),
|
|
208
206
|
rspackPersistentCache: utils_validation_1.Joi.boolean(),
|
|
209
|
-
gitEagerVcs: utils_validation_1.Joi.boolean(),
|
|
210
207
|
swcJsLoader: utils_validation_1.Joi.any()
|
|
211
208
|
.forbidden()
|
|
212
209
|
.messages({
|
|
@@ -254,22 +251,17 @@ const VCS_CONFIG_SCHEMA = utils_validation_1.Joi.custom((input) => {
|
|
|
254
251
|
return (0, utils_1.getVcsPreset)(presetName);
|
|
255
252
|
}
|
|
256
253
|
if (typeof input === 'boolean') {
|
|
257
|
-
|
|
258
|
-
// We'll normalize it to a real VcsConfig later
|
|
259
|
-
// This is annoying, but we have to read the future flag to switch to the
|
|
260
|
-
// new "default-v2" config (not easy to do it here)
|
|
261
|
-
return input;
|
|
254
|
+
return input ? (0, utils_1.getVcsPreset)('default') : (0, utils_1.getVcsPreset)('disabled');
|
|
262
255
|
}
|
|
263
256
|
const { error, value } = VCS_CONFIG_OBJECT_SCHEMA.validate(input);
|
|
264
257
|
if (error) {
|
|
265
258
|
throw error;
|
|
266
259
|
}
|
|
267
260
|
return value;
|
|
268
|
-
}).default(
|
|
261
|
+
}).default(() => exports.DEFAULT_CONFIG.vcs);
|
|
269
262
|
const FUTURE_CONFIG_SCHEMA = utils_validation_1.Joi.object({
|
|
270
263
|
v4: FUTURE_V4_SCHEMA,
|
|
271
264
|
faster: FASTER_CONFIG_SCHEMA,
|
|
272
|
-
experimental_vcs: VCS_CONFIG_SCHEMA,
|
|
273
265
|
experimental_router: utils_validation_1.Joi.string()
|
|
274
266
|
.equal('browser', 'hash')
|
|
275
267
|
.default(exports.DEFAULT_FUTURE_CONFIG.experimental_router),
|
|
@@ -296,6 +288,7 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
296
288
|
trailingSlash: utils_validation_1.Joi.boolean(), // No default value! undefined = retrocompatible legacy behavior!
|
|
297
289
|
i18n: I18N_CONFIG_SCHEMA,
|
|
298
290
|
storage: STORAGE_CONFIG_SCHEMA,
|
|
291
|
+
vcs: VCS_CONFIG_SCHEMA,
|
|
299
292
|
future: FUTURE_CONFIG_SCHEMA,
|
|
300
293
|
onBrokenLinks: utils_validation_1.Joi.string()
|
|
301
294
|
.equal('ignore', 'log', 'warn', 'throw')
|
|
@@ -454,15 +447,6 @@ Please migrate and move this option to code=${'siteConfig.markdown.hooks.onBroke
|
|
|
454
447
|
// We erase the former one to ensure we don't use it anywhere
|
|
455
448
|
config.onBrokenMarkdownLinks = undefined;
|
|
456
449
|
}
|
|
457
|
-
// We normalize the VCS config when using a boolean value
|
|
458
|
-
if (typeof config.future.experimental_vcs === 'boolean') {
|
|
459
|
-
const vcsConfig = config.future.experimental_vcs
|
|
460
|
-
? config.future.faster.gitEagerVcs
|
|
461
|
-
? (0, utils_1.getVcsPreset)('default-v2')
|
|
462
|
-
: (0, utils_1.getVcsPreset)('default-v1')
|
|
463
|
-
: (0, utils_1.getVcsPreset)('disabled');
|
|
464
|
-
config.future.experimental_vcs = vcsConfig;
|
|
465
|
-
}
|
|
466
450
|
if (config.future.faster.rspackPersistentCache &&
|
|
467
451
|
!config.future.faster.rspackBundler) {
|
|
468
452
|
throw new Error(`Docusaurus config flag ${logger_1.default.code('future.faster.rspackPersistentCache')} requires the flag ${logger_1.default.code('future.faster.rspackBundler')} to be turned on.`);
|
package/lib/server/site.js
CHANGED
|
@@ -49,7 +49,7 @@ async function loadContext(params) {
|
|
|
49
49
|
// VCS initialization can be slow for large repos, and we don't want to block
|
|
50
50
|
// VCS integrations should be carefully designed to avoid blocking
|
|
51
51
|
logger_1.PerfLogger.async('VCS init', () => {
|
|
52
|
-
return initialSiteConfig.
|
|
52
|
+
return initialSiteConfig.vcs.initialize({ siteDir });
|
|
53
53
|
});
|
|
54
54
|
const currentBundler = await (0, bundler_1.getCurrentBundler)({
|
|
55
55
|
siteConfig: initialSiteConfig,
|
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": "4.0.0-canary-
|
|
4
|
+
"version": "4.0.0-canary-6898",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@docusaurus/babel": "4.0.0-canary-
|
|
37
|
-
"@docusaurus/bundler": "4.0.0-canary-
|
|
38
|
-
"@docusaurus/fs": "4.0.0-canary-
|
|
39
|
-
"@docusaurus/glob": "4.0.0-canary-
|
|
40
|
-
"@docusaurus/logger": "4.0.0-canary-
|
|
41
|
-
"@docusaurus/mdx-loader": "4.0.0-canary-
|
|
42
|
-
"@docusaurus/utils": "4.0.0-canary-
|
|
43
|
-
"@docusaurus/utils-common": "4.0.0-canary-
|
|
44
|
-
"@docusaurus/utils-validation": "4.0.0-canary-
|
|
36
|
+
"@docusaurus/babel": "4.0.0-canary-6898",
|
|
37
|
+
"@docusaurus/bundler": "4.0.0-canary-6898",
|
|
38
|
+
"@docusaurus/fs": "4.0.0-canary-6898",
|
|
39
|
+
"@docusaurus/glob": "4.0.0-canary-6898",
|
|
40
|
+
"@docusaurus/logger": "4.0.0-canary-6898",
|
|
41
|
+
"@docusaurus/mdx-loader": "4.0.0-canary-6898",
|
|
42
|
+
"@docusaurus/utils": "4.0.0-canary-6898",
|
|
43
|
+
"@docusaurus/utils-common": "4.0.0-canary-6898",
|
|
44
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6898",
|
|
45
45
|
"boxen": "^9.0.0",
|
|
46
46
|
"cli-table3": "^0.6.5",
|
|
47
47
|
"combine-promises": "^1.2.0",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"webpack-merge": "^6.0.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@docusaurus/module-type-aliases": "4.0.0-canary-
|
|
76
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
75
|
+
"@docusaurus/module-type-aliases": "4.0.0-canary-6898",
|
|
76
|
+
"@docusaurus/types": "4.0.0-canary-6898",
|
|
77
77
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
78
78
|
"@types/escape-html": "^1.0.4",
|
|
79
79
|
"@types/history": "^4.7.11",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"utility-types": "^3.11.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"@docusaurus/faster": "4.0.0-canary-
|
|
90
|
+
"@docusaurus/faster": "4.0.0-canary-6898",
|
|
91
91
|
"@mdx-js/react": "^3.1.1",
|
|
92
92
|
"react": "^19.3.0",
|
|
93
93
|
"react-dom": "^19.3.0"
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"engines": {
|
|
101
101
|
"node": ">=24.21"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "9cb6d6b09eacaefa738949b06bffe912fe759eaf"
|
|
104
104
|
}
|