@docusaurus/core 4.0.0-canary-6896 → 4.0.0-canary-6899
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;
|
|
@@ -47,18 +47,14 @@ exports.DEFAULT_STORAGE_CONFIG = {
|
|
|
47
47
|
};
|
|
48
48
|
exports.DEFAULT_FASTER_CONFIG = {
|
|
49
49
|
swcJsMinimizer: false,
|
|
50
|
-
swcHtmlMinimizer: false,
|
|
51
50
|
rspackBundler: false,
|
|
52
51
|
rspackPersistentCache: false,
|
|
53
|
-
gitEagerVcs: false,
|
|
54
52
|
};
|
|
55
53
|
// When using the "faster: true" shortcut
|
|
56
54
|
exports.DEFAULT_FASTER_CONFIG_TRUE = {
|
|
57
55
|
swcJsMinimizer: true,
|
|
58
|
-
swcHtmlMinimizer: true,
|
|
59
56
|
rspackBundler: true,
|
|
60
57
|
rspackPersistentCache: true,
|
|
61
|
-
gitEagerVcs: true,
|
|
62
58
|
};
|
|
63
59
|
exports.DEFAULT_FUTURE_V4_CONFIG = {
|
|
64
60
|
useCssCascadeLayers: false,
|
|
@@ -76,7 +72,6 @@ exports.DEFAULT_FUTURE_V4_CONFIG_TRUE = {
|
|
|
76
72
|
exports.DEFAULT_FUTURE_CONFIG = {
|
|
77
73
|
v4: exports.DEFAULT_FUTURE_V4_CONFIG,
|
|
78
74
|
faster: exports.DEFAULT_FASTER_CONFIG,
|
|
79
|
-
experimental_vcs: (0, utils_1.getVcsPreset)('default-v1'),
|
|
80
75
|
experimental_router: 'browser',
|
|
81
76
|
};
|
|
82
77
|
const DEFAULT_MARKDOWN_HOOKS = {
|
|
@@ -108,6 +103,7 @@ const DEFAULT_MARKDOWN_CONFIG = {
|
|
|
108
103
|
exports.DEFAULT_CONFIG = {
|
|
109
104
|
i18n: exports.DEFAULT_I18N_CONFIG,
|
|
110
105
|
storage: exports.DEFAULT_STORAGE_CONFIG,
|
|
106
|
+
vcs: (0, utils_1.getVcsPreset)('default'),
|
|
111
107
|
future: exports.DEFAULT_FUTURE_CONFIG,
|
|
112
108
|
onBrokenLinks: 'throw',
|
|
113
109
|
onBrokenAnchors: 'warn', // TODO Docusaurus v4: change to throw
|
|
@@ -203,10 +199,8 @@ const I18N_CONFIG_SCHEMA = utils_validation_1.Joi.object({
|
|
|
203
199
|
const FASTER_CONFIG_SCHEMA = utils_validation_1.Joi.alternatives()
|
|
204
200
|
.try(utils_validation_1.Joi.object({
|
|
205
201
|
swcJsMinimizer: utils_validation_1.Joi.boolean(),
|
|
206
|
-
swcHtmlMinimizer: utils_validation_1.Joi.boolean(),
|
|
207
202
|
rspackBundler: utils_validation_1.Joi.boolean(),
|
|
208
203
|
rspackPersistentCache: utils_validation_1.Joi.boolean(),
|
|
209
|
-
gitEagerVcs: utils_validation_1.Joi.boolean(),
|
|
210
204
|
swcJsLoader: utils_validation_1.Joi.any()
|
|
211
205
|
.forbidden()
|
|
212
206
|
.messages({
|
|
@@ -254,22 +248,17 @@ const VCS_CONFIG_SCHEMA = utils_validation_1.Joi.custom((input) => {
|
|
|
254
248
|
return (0, utils_1.getVcsPreset)(presetName);
|
|
255
249
|
}
|
|
256
250
|
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;
|
|
251
|
+
return input ? (0, utils_1.getVcsPreset)('default') : (0, utils_1.getVcsPreset)('disabled');
|
|
262
252
|
}
|
|
263
253
|
const { error, value } = VCS_CONFIG_OBJECT_SCHEMA.validate(input);
|
|
264
254
|
if (error) {
|
|
265
255
|
throw error;
|
|
266
256
|
}
|
|
267
257
|
return value;
|
|
268
|
-
}).default(
|
|
258
|
+
}).default(() => exports.DEFAULT_CONFIG.vcs);
|
|
269
259
|
const FUTURE_CONFIG_SCHEMA = utils_validation_1.Joi.object({
|
|
270
260
|
v4: FUTURE_V4_SCHEMA,
|
|
271
261
|
faster: FASTER_CONFIG_SCHEMA,
|
|
272
|
-
experimental_vcs: VCS_CONFIG_SCHEMA,
|
|
273
262
|
experimental_router: utils_validation_1.Joi.string()
|
|
274
263
|
.equal('browser', 'hash')
|
|
275
264
|
.default(exports.DEFAULT_FUTURE_CONFIG.experimental_router),
|
|
@@ -296,6 +285,7 @@ exports.ConfigSchema = utils_validation_1.Joi.object({
|
|
|
296
285
|
trailingSlash: utils_validation_1.Joi.boolean(), // No default value! undefined = retrocompatible legacy behavior!
|
|
297
286
|
i18n: I18N_CONFIG_SCHEMA,
|
|
298
287
|
storage: STORAGE_CONFIG_SCHEMA,
|
|
288
|
+
vcs: VCS_CONFIG_SCHEMA,
|
|
299
289
|
future: FUTURE_CONFIG_SCHEMA,
|
|
300
290
|
onBrokenLinks: utils_validation_1.Joi.string()
|
|
301
291
|
.equal('ignore', 'log', 'warn', 'throw')
|
|
@@ -454,15 +444,6 @@ Please migrate and move this option to code=${'siteConfig.markdown.hooks.onBroke
|
|
|
454
444
|
// We erase the former one to ensure we don't use it anywhere
|
|
455
445
|
config.onBrokenMarkdownLinks = undefined;
|
|
456
446
|
}
|
|
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
447
|
if (config.future.faster.rspackPersistentCache &&
|
|
467
448
|
!config.future.faster.rspackBundler) {
|
|
468
449
|
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/lib/ssg/ssgParams.d.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Manifest } from 'react-loadable-ssr-addon-v5-slorber';
|
|
8
8
|
import type { Props } from '@docusaurus/types';
|
|
9
|
-
import type { HtmlMinifierType } from '@docusaurus/bundler';
|
|
10
9
|
export type SSGParams = {
|
|
11
10
|
trailingSlash: boolean | undefined;
|
|
12
11
|
manifest: Manifest;
|
|
@@ -17,7 +16,6 @@ export type SSGParams = {
|
|
|
17
16
|
baseUrl: string;
|
|
18
17
|
noIndex: boolean;
|
|
19
18
|
DOCUSAURUS_VERSION: string;
|
|
20
|
-
htmlMinifierType: HtmlMinifierType;
|
|
21
19
|
serverBundlePath: string;
|
|
22
20
|
ssgTemplateContent: string;
|
|
23
21
|
};
|
package/lib/ssg/ssgParams.js
CHANGED
|
@@ -26,9 +26,6 @@ async function createSSGParams({ props, serverBundlePath, clientManifestPath, })
|
|
|
26
26
|
noIndex: props.siteConfig.noIndex,
|
|
27
27
|
DOCUSAURUS_VERSION: utils_1.DOCUSAURUS_VERSION,
|
|
28
28
|
serverBundlePath,
|
|
29
|
-
htmlMinifierType: props.siteConfig.future.faster.swcHtmlMinimizer
|
|
30
|
-
? 'swc'
|
|
31
|
-
: 'terser',
|
|
32
29
|
};
|
|
33
30
|
// Useless but ensures that SSG params remain serializable
|
|
34
31
|
return structuredClone(params);
|
package/lib/ssg/ssgRenderer.js
CHANGED
|
@@ -41,9 +41,7 @@ async function loadSSGRenderer({ params, }) {
|
|
|
41
41
|
logger_1.PerfLogger.async('Load App renderer', () => loadAppRenderer({
|
|
42
42
|
serverBundlePath: params.serverBundlePath,
|
|
43
43
|
})),
|
|
44
|
-
logger_1.PerfLogger.async('Load HTML minifier', () => (0, bundler_1.getHtmlMinifier)({
|
|
45
|
-
type: params.htmlMinifierType,
|
|
46
|
-
})),
|
|
44
|
+
logger_1.PerfLogger.async('Load HTML minifier', () => (0, bundler_1.getHtmlMinifier)({ type: 'swc' })),
|
|
47
45
|
logger_1.PerfLogger.async('Compile SSG template', () => (0, ssgTemplate_1.compileSSGTemplate)(params.ssgTemplateContent)),
|
|
48
46
|
]);
|
|
49
47
|
return {
|
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-6899",
|
|
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-6899",
|
|
37
|
+
"@docusaurus/bundler": "4.0.0-canary-6899",
|
|
38
|
+
"@docusaurus/fs": "4.0.0-canary-6899",
|
|
39
|
+
"@docusaurus/glob": "4.0.0-canary-6899",
|
|
40
|
+
"@docusaurus/logger": "4.0.0-canary-6899",
|
|
41
|
+
"@docusaurus/mdx-loader": "4.0.0-canary-6899",
|
|
42
|
+
"@docusaurus/utils": "4.0.0-canary-6899",
|
|
43
|
+
"@docusaurus/utils-common": "4.0.0-canary-6899",
|
|
44
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6899",
|
|
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-6899",
|
|
76
|
+
"@docusaurus/types": "4.0.0-canary-6899",
|
|
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-6899",
|
|
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": "72622a2308261a457ca37d1e090d3efe608558cc"
|
|
104
104
|
}
|