@docusaurus/core 0.0.0-4711 → 0.0.0-4715

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.
@@ -9,4 +9,4 @@ import { type ReactNode } from 'react';
9
9
  import type { InterpolateProps, InterpolateValues } from '@docusaurus/Interpolate';
10
10
  export declare function interpolate<Str extends string>(text: Str, values?: InterpolateValues<Str, string | number>): string;
11
11
  export declare function interpolate<Str extends string, Value extends ReactNode>(text: Str, values?: InterpolateValues<Str, Value>): ReactNode;
12
- export default function Interpolate<Str extends string>({ children, values, }: InterpolateProps<Str>): ReactNode;
12
+ export default function Interpolate<Str extends string>({ children, values, }: InterpolateProps<Str>): JSX.Element;
@@ -10,7 +10,7 @@ Minimal implementation of a React interpolate component.
10
10
  We don't ship a markdown parser nor a feature-complete i18n library on purpose.
11
11
  More details here: https://github.com/facebook/docusaurus/pull/4295
12
12
  */
13
- const ValueRegexp = /{\w+}/g;
13
+ const ValueRegexp = /\{\w+\}/g;
14
14
  const ValueFoundMarker = '{}'; // does not care much
15
15
  export function interpolate(text, values) {
16
16
  const elements = [];
@@ -52,5 +52,5 @@ export default function Interpolate({ children, values, }) {
52
52
  console.warn('Illegal <Interpolate> children', children);
53
53
  throw new Error('The Docusaurus <Interpolate> component only accept simple string values');
54
54
  }
55
- return interpolate(children, values);
55
+ return <>{interpolate(children, values)}</>;
56
56
  }
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  /// <reference types="@docusaurus/module-type-aliases" />
8
- import type { ReactNode } from 'react';
8
+ /// <reference types="react" />
9
9
  import { type InterpolateValues } from '@docusaurus/Interpolate';
10
10
  import type { TranslateParam, TranslateProps } from '@docusaurus/Translate';
11
11
  export declare function translate<Str extends string>({ message, id }: TranslateParam<Str>, values?: InterpolateValues<Str, string | number>): string;
12
- export default function Translate<Str extends string>({ children, id, values, }: TranslateProps<Str>): ReactNode;
12
+ export default function Translate<Str extends string>({ children, id, values, }: TranslateProps<Str>): JSX.Element;
@@ -4,6 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ import React from 'react';
7
8
  import { interpolate } from '@docusaurus/Interpolate';
8
9
  // Can't read it from context, due to exposing imperative API
9
10
  import codeTranslations from '@generated/codeTranslations';
@@ -29,5 +30,5 @@ export default function Translate({ children, id, values, }) {
29
30
  throw new Error('The Docusaurus <Translate> component only accept simple string values');
30
31
  }
31
32
  const localizedMessage = getLocalizedMessage({ message: children, id });
32
- return interpolate(localizedMessage, values);
33
+ return <>{interpolate(localizedMessage, values)}</>;
33
34
  }
@@ -13,11 +13,7 @@ export default function normalizeLocation(location) {
13
13
  pathname: pathnames[location.pathname],
14
14
  };
15
15
  }
16
- let pathname = location.pathname || '/';
17
- pathname = pathname.trim().replace(/\/index\.html$/, '');
18
- if (pathname === '') {
19
- pathname = '/';
20
- }
16
+ const pathname = location.pathname.trim().replace(/\/index\.html$/, '') || '/';
21
17
  pathnames[location.pathname] = pathname;
22
18
  return {
23
19
  ...location,
@@ -56,7 +56,7 @@ function hasSSHProtocol(sourceRepoUrl) {
56
56
  }
57
57
  catch {
58
58
  // Fails when there isn't a protocol
59
- return /^(?:[\w-]+@)?[\w.-]+:[\w./_-]+/.test(sourceRepoUrl); // git@github.com:facebook/docusaurus.git
59
+ return /^(?:[\w-]+@)?[\w.-]+:[\w./-]+/.test(sourceRepoUrl); // git@github.com:facebook/docusaurus.git
60
60
  }
61
61
  }
62
62
  exports.hasSSHProtocol = hasSSHProtocol;
@@ -15,7 +15,7 @@ async function loadConfig(configPath) {
15
15
  throw new Error(`Config file at "${configPath}" not found.`);
16
16
  }
17
17
  const importedConfig = (0, import_fresh_1.default)(configPath);
18
- const loadedConfig = importedConfig instanceof Function
18
+ const loadedConfig = typeof importedConfig === 'function'
19
19
  ? await importedConfig()
20
20
  : await importedConfig;
21
21
  return (0, configValidation_1.validateConfig)(loadedConfig);
@@ -299,7 +299,7 @@ ${Object.entries(registry)
299
299
  return props;
300
300
  }
301
301
  exports.load = load;
302
- // We want all @docusaurus/* packages to have the exact same version!
302
+ // We want all @docusaurus/* packages to have the exact same version!
303
303
  // See https://github.com/facebook/docusaurus/issues/3371
304
304
  // See https://github.com/facebook/docusaurus/pull/3386
305
305
  function checkDocusaurusPackagesVersion(siteMetadata) {
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-4711",
4
+ "version": "0.0.0-4715",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -41,13 +41,13 @@
41
41
  "@babel/runtime": "^7.17.2",
42
42
  "@babel/runtime-corejs3": "^7.17.2",
43
43
  "@babel/traverse": "^7.17.3",
44
- "@docusaurus/cssnano-preset": "0.0.0-4711",
45
- "@docusaurus/logger": "0.0.0-4711",
46
- "@docusaurus/mdx-loader": "0.0.0-4711",
44
+ "@docusaurus/cssnano-preset": "0.0.0-4715",
45
+ "@docusaurus/logger": "0.0.0-4715",
46
+ "@docusaurus/mdx-loader": "0.0.0-4715",
47
47
  "@docusaurus/react-loadable": "5.5.2",
48
- "@docusaurus/utils": "0.0.0-4711",
49
- "@docusaurus/utils-common": "0.0.0-4711",
50
- "@docusaurus/utils-validation": "0.0.0-4711",
48
+ "@docusaurus/utils": "0.0.0-4715",
49
+ "@docusaurus/utils-common": "0.0.0-4715",
50
+ "@docusaurus/utils-validation": "0.0.0-4715",
51
51
  "@slorber/static-site-generator-webpack-plugin": "^4.0.1",
52
52
  "@svgr/webpack": "^6.2.1",
53
53
  "autoprefixer": "^10.4.2",
@@ -106,8 +106,8 @@
106
106
  "webpackbar": "^5.0.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@docusaurus/module-type-aliases": "0.0.0-4711",
110
- "@docusaurus/types": "0.0.0-4711",
109
+ "@docusaurus/module-type-aliases": "0.0.0-4715",
110
+ "@docusaurus/types": "0.0.0-4715",
111
111
  "@types/detect-port": "^1.3.2",
112
112
  "@types/nprogress": "^0.2.0",
113
113
  "@types/react-dom": "^17.0.13",
@@ -128,5 +128,5 @@
128
128
  "engines": {
129
129
  "node": ">=14"
130
130
  },
131
- "gitHead": "d1717d919f8d8a94bc3d1a597056642d5e349975"
131
+ "gitHead": "4e437fa53e0fb6cfc5b6c4d2291c91302f8868be"
132
132
  }