@docusaurus/core 0.0.0-5035 → 0.0.0-5040
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.
- package/lib/babel/preset.js +2 -1
- package/lib/client/exports/Link.d.ts +1 -1
- package/lib/client/preload.js +1 -3
- package/lib/client/theme-fallback/Loading/index.js +1 -1
- package/lib/commands/swizzle/prompts.js +8 -8
- package/lib/server/configValidation.d.ts +2 -2
- package/lib/server/configValidation.js +1 -1
- package/lib/server/getHostPort.js +2 -2
- package/lib/server/translations/translationsExtractor.js +3 -3
- package/package.json +21 -21
package/lib/babel/preset.js
CHANGED
|
@@ -51,7 +51,8 @@ function getTransformOptions(isServer) {
|
|
|
51
51
|
// better to explicitly specify the version so that it can reuse the
|
|
52
52
|
// helper better. See https://github.com/babel/babel/issues/10261
|
|
53
53
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, global-require
|
|
54
|
-
version: require('@babel/runtime/package.json')
|
|
54
|
+
version: require('@babel/runtime/package.json')
|
|
55
|
+
.version,
|
|
55
56
|
regenerator: true,
|
|
56
57
|
useESModules: true,
|
|
57
58
|
// Undocumented option that lets us encapsulate our runtime, ensuring
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
/// <reference types="@docusaurus/module-type-aliases" />
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import type { Props } from '@docusaurus/Link';
|
|
10
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "children" | "replace" | "slot" | "style" | "title" | "
|
|
10
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "location" | "children" | "replace" | "slot" | "style" | "title" | "component" | "exact" | "sensitive" | "strict" | "type" | "key" | "id" | "lang" | "dir" | "rel" | "href" | "isNavLink" | "className" | "to" | "innerRef" | "download" | "hrefLang" | "media" | "ping" | "target" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "activeClassName" | "activeStyle" | "isActive" | "data-noBrokenLinkCheck" | "autoAddBaseUrl"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
11
|
export default _default;
|
package/lib/client/preload.js
CHANGED
|
@@ -16,7 +16,5 @@ import { matchRoutes } from 'react-router-config';
|
|
|
16
16
|
*/
|
|
17
17
|
export default function preload(pathname) {
|
|
18
18
|
const matches = matchRoutes(routes, pathname);
|
|
19
|
-
return Promise.all(
|
|
20
|
-
// @ts-expect-error: ComponentCreator injected this method.
|
|
21
|
-
matches.map((match) => match.route.component?.preload?.()));
|
|
19
|
+
return Promise.all(matches.map((match) => match.route.component.preload?.()));
|
|
22
20
|
}
|
|
@@ -13,14 +13,14 @@ const prompts_1 = tslib_1.__importDefault(require("prompts"));
|
|
|
13
13
|
const common_1 = require("./common");
|
|
14
14
|
const ExitTitle = logger_1.default.yellow('[Exit]');
|
|
15
15
|
async function askThemeName(themeNames) {
|
|
16
|
-
const { themeName } = await (0, prompts_1.default)({
|
|
16
|
+
const { themeName } = (await (0, prompts_1.default)({
|
|
17
17
|
type: 'select',
|
|
18
18
|
name: 'themeName',
|
|
19
19
|
message: 'Select a theme to swizzle:',
|
|
20
20
|
choices: themeNames
|
|
21
21
|
.map((theme) => ({ title: theme, value: theme }))
|
|
22
22
|
.concat({ title: ExitTitle, value: '[Exit]' }),
|
|
23
|
-
});
|
|
23
|
+
}));
|
|
24
24
|
if (!themeName || themeName === '[Exit]') {
|
|
25
25
|
process.exit(0);
|
|
26
26
|
}
|
|
@@ -37,7 +37,7 @@ async function askComponentName(themeComponents) {
|
|
|
37
37
|
partiallySafe,
|
|
38
38
|
})}`;
|
|
39
39
|
}
|
|
40
|
-
const { componentName } = await (0, prompts_1.default)({
|
|
40
|
+
const { componentName } = (await (0, prompts_1.default)({
|
|
41
41
|
type: 'autocomplete',
|
|
42
42
|
name: 'componentName',
|
|
43
43
|
message: `
|
|
@@ -57,7 +57,7 @@ ${common_1.PartiallySafeHint} = not safe for all swizzle actions
|
|
|
57
57
|
async suggest(input, choices) {
|
|
58
58
|
return choices.filter((choice) => choice.title.toLowerCase().includes(input.toLowerCase()));
|
|
59
59
|
},
|
|
60
|
-
});
|
|
60
|
+
}));
|
|
61
61
|
logger_1.default.newLine();
|
|
62
62
|
if (!componentName || componentName === '[Exit]') {
|
|
63
63
|
return process.exit(0);
|
|
@@ -66,7 +66,7 @@ ${common_1.PartiallySafeHint} = not safe for all swizzle actions
|
|
|
66
66
|
}
|
|
67
67
|
exports.askComponentName = askComponentName;
|
|
68
68
|
async function askSwizzleDangerousComponent() {
|
|
69
|
-
const { switchToDanger } = await (0, prompts_1.default)({
|
|
69
|
+
const { switchToDanger } = (await (0, prompts_1.default)({
|
|
70
70
|
type: 'select',
|
|
71
71
|
name: 'switchToDanger',
|
|
72
72
|
message: `Do you really want to swizzle this unsafe internal component?`,
|
|
@@ -78,7 +78,7 @@ async function askSwizzleDangerousComponent() {
|
|
|
78
78
|
},
|
|
79
79
|
{ title: ExitTitle, value: '[Exit]' },
|
|
80
80
|
],
|
|
81
|
-
});
|
|
81
|
+
}));
|
|
82
82
|
if (typeof switchToDanger === 'undefined' || switchToDanger === '[Exit]') {
|
|
83
83
|
return process.exit(0);
|
|
84
84
|
}
|
|
@@ -86,7 +86,7 @@ async function askSwizzleDangerousComponent() {
|
|
|
86
86
|
}
|
|
87
87
|
exports.askSwizzleDangerousComponent = askSwizzleDangerousComponent;
|
|
88
88
|
async function askSwizzleAction(componentConfig) {
|
|
89
|
-
const { action } = await (0, prompts_1.default)({
|
|
89
|
+
const { action } = (await (0, prompts_1.default)({
|
|
90
90
|
type: 'select',
|
|
91
91
|
name: 'action',
|
|
92
92
|
message: `Which swizzle action do you want to do?`,
|
|
@@ -101,7 +101,7 @@ async function askSwizzleAction(componentConfig) {
|
|
|
101
101
|
},
|
|
102
102
|
{ title: ExitTitle, value: '[Exit]' },
|
|
103
103
|
],
|
|
104
|
-
});
|
|
104
|
+
}));
|
|
105
105
|
if (typeof action === 'undefined' || action === '[Exit]') {
|
|
106
106
|
return process.exit(0);
|
|
107
107
|
}
|
|
@@ -8,5 +8,5 @@ import { Joi } from '@docusaurus/utils-validation';
|
|
|
8
8
|
import type { DocusaurusConfig, I18nConfig } from '@docusaurus/types';
|
|
9
9
|
export declare const DEFAULT_I18N_CONFIG: I18nConfig;
|
|
10
10
|
export declare const DEFAULT_CONFIG: Pick<DocusaurusConfig, 'i18n' | 'onBrokenLinks' | 'onBrokenMarkdownLinks' | 'onDuplicateRoutes' | 'plugins' | 'themes' | 'presets' | 'stylesheets' | 'scripts' | 'clientModules' | 'customFields' | 'themeConfig' | 'titleDelimiter' | 'noIndex' | 'tagline' | 'baseUrlIssueBanner' | 'staticDirectories'>;
|
|
11
|
-
export declare const ConfigSchema: Joi.ObjectSchema<
|
|
12
|
-
export declare function validateConfig(config:
|
|
11
|
+
export declare const ConfigSchema: Joi.ObjectSchema<DocusaurusConfig>;
|
|
12
|
+
export declare function validateConfig(config: unknown): DocusaurusConfig;
|
|
@@ -100,7 +100,7 @@ const I18N_CONFIG_SCHEMA = utils_validation_1.Joi.object({
|
|
|
100
100
|
.default(exports.DEFAULT_I18N_CONFIG);
|
|
101
101
|
const SiteUrlSchema = utils_validation_1.URISchema.required().custom((value, helpers) => {
|
|
102
102
|
try {
|
|
103
|
-
const { pathname } = new URL(value);
|
|
103
|
+
const { pathname } = new URL(String(value));
|
|
104
104
|
if (pathname !== '/') {
|
|
105
105
|
helpers.warn('docusaurus.configValidationWarning', {
|
|
106
106
|
warningMessage: `the url is not supposed to contain a sub-path like '${pathname}', please use the baseUrl field for sub-paths`,
|
|
@@ -55,14 +55,14 @@ async function choosePort(host, defaultPort) {
|
|
|
55
55
|
}
|
|
56
56
|
clearConsole();
|
|
57
57
|
const existingProcess = getProcessForPort(defaultPort);
|
|
58
|
-
const { shouldChangePort } = await (0, prompts_1.default)({
|
|
58
|
+
const { shouldChangePort } = (await (0, prompts_1.default)({
|
|
59
59
|
type: 'confirm',
|
|
60
60
|
name: 'shouldChangePort',
|
|
61
61
|
message: logger_1.default.yellow(`${logger_1.default.bold('[WARNING]')} ${message}${existingProcess ? ` Probably:\n ${existingProcess}` : ''}
|
|
62
62
|
|
|
63
63
|
Would you like to run the app on another port instead?`),
|
|
64
64
|
initial: true,
|
|
65
|
-
});
|
|
65
|
+
}));
|
|
66
66
|
return shouldChangePort ? port : null;
|
|
67
67
|
}
|
|
68
68
|
catch (err) {
|
|
@@ -234,9 +234,9 @@ ${sourceWarningPart(path.node)}`);
|
|
|
234
234
|
if (firstArgEvaluated.confident &&
|
|
235
235
|
typeof firstArgEvaluated.value === 'object') {
|
|
236
236
|
const { message, id, description } = firstArgEvaluated.value;
|
|
237
|
-
translations[id ?? message] = {
|
|
238
|
-
message: message ?? id,
|
|
239
|
-
...(description && { description }),
|
|
237
|
+
translations[String(id ?? message)] = {
|
|
238
|
+
message: String(message ?? id),
|
|
239
|
+
...(Boolean(description) && { description: String(description) }),
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
else {
|
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": "0.0.0-
|
|
4
|
+
"version": "0.0.0-5040",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -33,23 +33,23 @@
|
|
|
33
33
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/core": "^7.
|
|
37
|
-
"@babel/generator": "^7.
|
|
36
|
+
"@babel/core": "^7.18.0",
|
|
37
|
+
"@babel/generator": "^7.18.0",
|
|
38
38
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
39
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
40
|
-
"@babel/preset-env": "^7.
|
|
39
|
+
"@babel/plugin-transform-runtime": "^7.18.0",
|
|
40
|
+
"@babel/preset-env": "^7.18.0",
|
|
41
41
|
"@babel/preset-react": "^7.17.12",
|
|
42
42
|
"@babel/preset-typescript": "^7.17.12",
|
|
43
|
-
"@babel/runtime": "^7.
|
|
44
|
-
"@babel/runtime-corejs3": "^7.
|
|
45
|
-
"@babel/traverse": "^7.
|
|
46
|
-
"@docusaurus/cssnano-preset": "0.0.0-
|
|
47
|
-
"@docusaurus/logger": "0.0.0-
|
|
48
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
43
|
+
"@babel/runtime": "^7.18.0",
|
|
44
|
+
"@babel/runtime-corejs3": "^7.18.0",
|
|
45
|
+
"@babel/traverse": "^7.18.0",
|
|
46
|
+
"@docusaurus/cssnano-preset": "0.0.0-5040",
|
|
47
|
+
"@docusaurus/logger": "0.0.0-5040",
|
|
48
|
+
"@docusaurus/mdx-loader": "0.0.0-5040",
|
|
49
49
|
"@docusaurus/react-loadable": "5.5.2",
|
|
50
|
-
"@docusaurus/utils": "0.0.0-
|
|
51
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
52
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
50
|
+
"@docusaurus/utils": "0.0.0-5040",
|
|
51
|
+
"@docusaurus/utils-common": "0.0.0-5040",
|
|
52
|
+
"@docusaurus/utils-validation": "0.0.0-5040",
|
|
53
53
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.4",
|
|
54
54
|
"@svgr/webpack": "^6.2.1",
|
|
55
55
|
"autoprefixer": "^10.4.7",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"core-js": "^3.22.5",
|
|
67
67
|
"css-loader": "^6.7.1",
|
|
68
68
|
"css-minimizer-webpack-plugin": "^3.4.1",
|
|
69
|
-
"cssnano": "^5.1.
|
|
69
|
+
"cssnano": "^5.1.9",
|
|
70
70
|
"del": "^6.1.0",
|
|
71
71
|
"detect-port": "^1.3.0",
|
|
72
72
|
"escape-html": "^1.0.3",
|
|
@@ -80,16 +80,16 @@
|
|
|
80
80
|
"leven": "^3.1.0",
|
|
81
81
|
"lodash": "^4.17.21",
|
|
82
82
|
"mini-css-extract-plugin": "^2.6.0",
|
|
83
|
-
"postcss": "^8.4.
|
|
83
|
+
"postcss": "^8.4.14",
|
|
84
84
|
"postcss-loader": "^6.2.1",
|
|
85
85
|
"prompts": "^2.4.2",
|
|
86
86
|
"react-dev-utils": "^12.0.1",
|
|
87
87
|
"react-helmet-async": "^1.3.0",
|
|
88
88
|
"react-loadable": "npm:@docusaurus/react-loadable@5.5.2",
|
|
89
89
|
"react-loadable-ssr-addon-v5-slorber": "^1.0.1",
|
|
90
|
-
"react-router": "^5.
|
|
90
|
+
"react-router": "^5.3.3",
|
|
91
91
|
"react-router-config": "^5.1.1",
|
|
92
|
-
"react-router-dom": "^5.
|
|
92
|
+
"react-router-dom": "^5.3.3",
|
|
93
93
|
"remark-admonitions": "^1.2.1",
|
|
94
94
|
"rtl-detect": "^1.0.4",
|
|
95
95
|
"semver": "^7.3.7",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"webpackbar": "^5.0.2"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
111
|
-
"@docusaurus/types": "0.0.0-
|
|
110
|
+
"@docusaurus/module-type-aliases": "0.0.0-5040",
|
|
111
|
+
"@docusaurus/types": "0.0.0-5040",
|
|
112
112
|
"@types/detect-port": "^1.3.2",
|
|
113
113
|
"@types/react-dom": "^18.0.4",
|
|
114
114
|
"@types/react-router-config": "^5.0.6",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"engines": {
|
|
129
129
|
"node": ">=14"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "b78c3c30f8187b22735be5d269a95324dda066c7"
|
|
132
132
|
}
|