@docusaurus/core 3.9.2-canary-6466 → 3.9.2-canary-6499
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.
|
@@ -63,7 +63,7 @@ function Link({ isNavLink, to, href, activeClassName, isActive, 'data-noBrokenLi
|
|
|
63
63
|
const preloaded = useRef(false);
|
|
64
64
|
const LinkComponent = (isNavLink ? NavLink : RRLink);
|
|
65
65
|
const IOSupported = ExecutionEnvironment.canUseIntersectionObserver;
|
|
66
|
-
const ioRef = useRef();
|
|
66
|
+
const ioRef = useRef(undefined);
|
|
67
67
|
const handleRef = (el) => {
|
|
68
68
|
innerRef.current = el;
|
|
69
69
|
if (IOSupported && el && isInternal) {
|
|
@@ -10,7 +10,6 @@ exports.swizzle = swizzle;
|
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
11
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
12
12
|
const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
|
|
13
|
-
const utils_1 = require("@docusaurus/utils");
|
|
14
13
|
const themes_1 = require("./themes");
|
|
15
14
|
const components_1 = require("./components");
|
|
16
15
|
const tables_1 = require("./tables");
|
|
@@ -33,7 +32,7 @@ async function getLanguageForThemeName({ themeName, plugins, options, }) {
|
|
|
33
32
|
}
|
|
34
33
|
// It's only useful to prompt the user for themes that support both JS/TS
|
|
35
34
|
if (supportsTS) {
|
|
36
|
-
return (0,
|
|
35
|
+
return (0, prompts_1.askSwizzlePreferredLanguage)();
|
|
37
36
|
}
|
|
38
37
|
return 'javascript';
|
|
39
38
|
}
|
|
@@ -10,3 +10,4 @@ export declare function askThemeName(themeNames: string[]): Promise<string>;
|
|
|
10
10
|
export declare function askComponentName(themeComponents: ThemeComponents): Promise<string>;
|
|
11
11
|
export declare function askSwizzleDangerousComponent(): Promise<boolean>;
|
|
12
12
|
export declare function askSwizzleAction(componentConfig: SwizzleComponentConfig): Promise<SwizzleAction>;
|
|
13
|
+
export declare function askSwizzlePreferredLanguage(): Promise<'javascript' | 'typescript'>;
|
|
@@ -10,6 +10,7 @@ exports.askThemeName = askThemeName;
|
|
|
10
10
|
exports.askComponentName = askComponentName;
|
|
11
11
|
exports.askSwizzleDangerousComponent = askSwizzleDangerousComponent;
|
|
12
12
|
exports.askSwizzleAction = askSwizzleAction;
|
|
13
|
+
exports.askSwizzlePreferredLanguage = askSwizzlePreferredLanguage;
|
|
13
14
|
const tslib_1 = require("tslib");
|
|
14
15
|
const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
|
|
15
16
|
const prompts_1 = tslib_1.__importDefault(require("prompts"));
|
|
@@ -107,3 +108,24 @@ async function askSwizzleAction(componentConfig) {
|
|
|
107
108
|
}
|
|
108
109
|
return action;
|
|
109
110
|
}
|
|
111
|
+
async function askSwizzlePreferredLanguage() {
|
|
112
|
+
const choices = [
|
|
113
|
+
{ title: logger_1.default.bold('JavaScript'), value: 'javascript' },
|
|
114
|
+
{ title: logger_1.default.bold('TypeScript'), value: 'typescript' },
|
|
115
|
+
{ title: logger_1.default.yellow('[Exit]'), value: '[Exit]' },
|
|
116
|
+
];
|
|
117
|
+
const { language } = await (0, prompts_1.default)({
|
|
118
|
+
type: 'select',
|
|
119
|
+
name: 'language',
|
|
120
|
+
message: 'Which language do you want to use?',
|
|
121
|
+
choices,
|
|
122
|
+
}, {
|
|
123
|
+
onCancel() {
|
|
124
|
+
process.exit(0);
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
if (typeof language === 'undefined' || language === '[Exit]') {
|
|
128
|
+
process.exit(0);
|
|
129
|
+
}
|
|
130
|
+
return language;
|
|
131
|
+
}
|
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-6499",
|
|
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-6499",
|
|
37
|
+
"@docusaurus/bundler": "3.9.2-canary-6499",
|
|
38
|
+
"@docusaurus/logger": "3.9.2-canary-6499",
|
|
39
|
+
"@docusaurus/mdx-loader": "3.9.2-canary-6499",
|
|
40
|
+
"@docusaurus/utils": "3.9.2-canary-6499",
|
|
41
|
+
"@docusaurus/utils-common": "3.9.2-canary-6499",
|
|
42
|
+
"@docusaurus/utils-validation": "3.9.2-canary-6499",
|
|
43
43
|
"boxen": "^6.2.1",
|
|
44
44
|
"chalk": "^4.1.2",
|
|
45
45
|
"chokidar": "^3.5.3",
|
|
@@ -77,16 +77,15 @@
|
|
|
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-6499",
|
|
81
|
+
"@docusaurus/types": "3.9.2-canary-6499",
|
|
82
82
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
83
83
|
"@types/detect-port": "^1.3.3",
|
|
84
|
-
"@types/react-dom": "^
|
|
84
|
+
"@types/react-dom": "^19.2.3",
|
|
85
85
|
"@types/react-router-config": "^5.0.7",
|
|
86
86
|
"@types/serve-handler": "^6.1.4",
|
|
87
87
|
"@types/update-notifier": "^6.0.4",
|
|
88
88
|
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
89
|
-
"react-test-renderer": "^18.0.0",
|
|
90
89
|
"tmp-promise": "^3.0.3",
|
|
91
90
|
"tree-node-cli": "^1.6.0"
|
|
92
91
|
},
|
|
@@ -98,5 +97,5 @@
|
|
|
98
97
|
"engines": {
|
|
99
98
|
"node": ">=20.0"
|
|
100
99
|
},
|
|
101
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "5ad8c2b9301411f0be8fabe95315c6a4ac7a7af4"
|
|
102
101
|
}
|