@docusaurus/core 0.0.0-5037 → 0.0.0-5041

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.
@@ -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').version,
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" | "location" | "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>>;
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;
@@ -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
  }
@@ -27,7 +27,7 @@ export default function Loading({ error, retry, pastDelay, }) {
27
27
  maxWidth: '50%',
28
28
  width: '100%',
29
29
  }}>
30
- <p>{error.message}</p>
30
+ <p>{String(error)}</p>
31
31
  <div>
32
32
  <button type="button" onClick={retry}>
33
33
  Retry
@@ -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<any>;
12
- export declare function validateConfig(config: Partial<DocusaurusConfig>): DocusaurusConfig;
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-5037",
4
+ "version": "0.0.0-5041",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -43,13 +43,13 @@
43
43
  "@babel/runtime": "^7.18.0",
44
44
  "@babel/runtime-corejs3": "^7.18.0",
45
45
  "@babel/traverse": "^7.18.0",
46
- "@docusaurus/cssnano-preset": "0.0.0-5037",
47
- "@docusaurus/logger": "0.0.0-5037",
48
- "@docusaurus/mdx-loader": "0.0.0-5037",
46
+ "@docusaurus/cssnano-preset": "0.0.0-5041",
47
+ "@docusaurus/logger": "0.0.0-5041",
48
+ "@docusaurus/mdx-loader": "0.0.0-5041",
49
49
  "@docusaurus/react-loadable": "5.5.2",
50
- "@docusaurus/utils": "0.0.0-5037",
51
- "@docusaurus/utils-common": "0.0.0-5037",
52
- "@docusaurus/utils-validation": "0.0.0-5037",
50
+ "@docusaurus/utils": "0.0.0-5041",
51
+ "@docusaurus/utils-common": "0.0.0-5041",
52
+ "@docusaurus/utils-validation": "0.0.0-5041",
53
53
  "@slorber/static-site-generator-webpack-plugin": "^4.0.4",
54
54
  "@svgr/webpack": "^6.2.1",
55
55
  "autoprefixer": "^10.4.7",
@@ -107,8 +107,8 @@
107
107
  "webpackbar": "^5.0.2"
108
108
  },
109
109
  "devDependencies": {
110
- "@docusaurus/module-type-aliases": "0.0.0-5037",
111
- "@docusaurus/types": "0.0.0-5037",
110
+ "@docusaurus/module-type-aliases": "0.0.0-5041",
111
+ "@docusaurus/types": "0.0.0-5041",
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": "923ee2cb13be47d28b5286d469ccab06d85a87df"
131
+ "gitHead": "5a3b9a5a3a9c680f7f6d29b622416fc30cd8275d"
132
132
  }