@docusaurus/core 0.0.0-4625 → 0.0.0-4626
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/bin/beforeCli.mjs +1 -3
- package/lib/babel/preset.d.ts +1 -2
- package/lib/client/App.d.ts +1 -2
- package/lib/client/App.js +1 -2
- package/lib/client/exports/BrowserOnly.d.ts +1 -2
- package/lib/client/exports/BrowserOnly.js +1 -2
- package/lib/client/exports/ComponentCreator.d.ts +1 -2
- package/lib/client/exports/ComponentCreator.js +1 -2
- package/lib/client/exports/ErrorBoundary.d.ts +2 -2
- package/lib/client/exports/ErrorBoundary.js +1 -2
- package/lib/client/exports/Head.d.ts +1 -2
- package/lib/client/exports/Head.js +1 -2
- package/lib/client/exports/renderRoutes.d.ts +1 -2
- package/lib/client/exports/renderRoutes.js +1 -2
- package/lib/client/exports/useDocusaurusContext.d.ts +1 -2
- package/lib/client/exports/useDocusaurusContext.js +1 -2
- package/lib/client/flat.d.ts +1 -2
- package/lib/client/flat.js +1 -2
- package/lib/client/normalizeLocation.d.ts +1 -2
- package/lib/client/normalizeLocation.js +1 -2
- package/lib/client/prefetch.d.ts +1 -2
- package/lib/client/prefetch.js +1 -2
- package/lib/client/theme-fallback/Error/index.d.ts +1 -2
- package/lib/client/theme-fallback/Error/index.js +1 -2
- package/lib/client/theme-fallback/Layout/index.d.ts +1 -2
- package/lib/client/theme-fallback/Layout/index.js +1 -2
- package/lib/client/theme-fallback/NotFound/index.d.ts +1 -2
- package/lib/client/theme-fallback/NotFound/index.js +1 -2
- package/lib/client/theme-fallback/Root/index.d.ts +1 -2
- package/lib/client/theme-fallback/Root/index.js +1 -2
- package/lib/server/loadSetup.d.ts +1 -2
- package/lib/server/loadSetup.js +2 -2
- package/lib/webpack/plugins/ChunkAssetPlugin.d.ts +1 -2
- package/lib/webpack/plugins/CleanWebpackPlugin.d.ts +1 -2
- package/package.json +10 -10
package/bin/beforeCli.mjs
CHANGED
|
@@ -36,7 +36,7 @@ const {
|
|
|
36
36
|
*
|
|
37
37
|
* cache data is stored in `~/.config/configstore/update-notifier-@docusaurus`
|
|
38
38
|
*/
|
|
39
|
-
async function beforeCli() {
|
|
39
|
+
export default async function beforeCli() {
|
|
40
40
|
const notifier = updateNotifier({
|
|
41
41
|
pkg: {
|
|
42
42
|
name,
|
|
@@ -134,5 +134,3 @@ async function beforeCli() {
|
|
|
134
134
|
process.exit(1);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
export default beforeCli;
|
package/lib/babel/preset.d.ts
CHANGED
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { ConfigAPI, TransformOptions } from '@babel/core';
|
|
8
|
-
|
|
9
|
-
export default babelPresets;
|
|
8
|
+
export default function babelPresets(api: ConfigAPI): TransformOptions;
|
package/lib/client/App.d.ts
CHANGED
package/lib/client/App.js
CHANGED
|
@@ -16,7 +16,7 @@ import './client-lifecycles-dispatcher';
|
|
|
16
16
|
// TODO, quick fix for CSS insertion order
|
|
17
17
|
import ErrorBoundary from '@docusaurus/ErrorBoundary';
|
|
18
18
|
import Error from '@theme/Error';
|
|
19
|
-
function App() {
|
|
19
|
+
export default function App() {
|
|
20
20
|
return (<ErrorBoundary fallback={Error}>
|
|
21
21
|
<DocusaurusContextProvider>
|
|
22
22
|
<BrowserContextProvider>
|
|
@@ -30,4 +30,3 @@ function App() {
|
|
|
30
30
|
</DocusaurusContextProvider>
|
|
31
31
|
</ErrorBoundary>);
|
|
32
32
|
}
|
|
33
|
-
export default App;
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
/// <reference types="react" />
|
|
8
|
-
|
|
8
|
+
export default function BrowserOnly({ children, fallback, }: {
|
|
9
9
|
children: () => JSX.Element;
|
|
10
10
|
fallback?: JSX.Element;
|
|
11
11
|
}): JSX.Element | null;
|
|
12
|
-
export default BrowserOnly;
|
|
@@ -8,7 +8,7 @@ import React, { isValidElement } from 'react';
|
|
|
8
8
|
import useIsBrowser from '@docusaurus/useIsBrowser';
|
|
9
9
|
// Similar comp to the one described here:
|
|
10
10
|
// https://www.joshwcomeau.com/react/the-perils-of-rehydration/#abstractions
|
|
11
|
-
function BrowserOnly({ children, fallback, }) {
|
|
11
|
+
export default function BrowserOnly({ children, fallback, }) {
|
|
12
12
|
const isBrowser = useIsBrowser();
|
|
13
13
|
if (isBrowser) {
|
|
14
14
|
if (typeof children !== 'function' &&
|
|
@@ -20,4 +20,3 @@ Current type: ${isValidElement(children) ? 'React element' : typeof children}`);
|
|
|
20
20
|
}
|
|
21
21
|
return fallback || null;
|
|
22
22
|
}
|
|
23
|
-
export default BrowserOnly;
|
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import Loadable from 'react-loadable';
|
|
8
|
-
|
|
9
|
-
export default ComponentCreator;
|
|
8
|
+
export default function ComponentCreator(path: string, hash: string): ReturnType<typeof Loadable>;
|
|
@@ -10,7 +10,7 @@ import Loading from '@theme/Loading';
|
|
|
10
10
|
import routesChunkNames from '@generated/routesChunkNames';
|
|
11
11
|
import registry from '@generated/registry';
|
|
12
12
|
import flat from '../flat';
|
|
13
|
-
function ComponentCreator(path, hash) {
|
|
13
|
+
export default function ComponentCreator(path, hash) {
|
|
14
14
|
// 404 page
|
|
15
15
|
if (path === '*') {
|
|
16
16
|
return Loadable({
|
|
@@ -76,4 +76,3 @@ function ComponentCreator(path, hash) {
|
|
|
76
76
|
},
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
export default ComponentCreator;
|
|
@@ -10,9 +10,9 @@ import type { Props } from '@docusaurus/ErrorBoundary';
|
|
|
10
10
|
interface State {
|
|
11
11
|
error: Error | null;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
export default class ErrorBoundary extends React.Component<Props, State> {
|
|
14
14
|
constructor(props: Props);
|
|
15
15
|
componentDidCatch(error: Error): void;
|
|
16
16
|
render(): ReactNode;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
|
9
9
|
import DefaultFallback from '@theme/Error';
|
|
10
|
-
class ErrorBoundary extends React.Component {
|
|
10
|
+
export default class ErrorBoundary extends React.Component {
|
|
11
11
|
constructor(props) {
|
|
12
12
|
super(props);
|
|
13
13
|
this.state = { error: null };
|
|
@@ -34,4 +34,3 @@ class ErrorBoundary extends React.Component {
|
|
|
34
34
|
null);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
export default ErrorBoundary;
|
|
@@ -7,5 +7,4 @@
|
|
|
7
7
|
/// <reference types="@docusaurus/module-type-aliases" />
|
|
8
8
|
/// <reference types="react" />
|
|
9
9
|
import type { Props } from '@docusaurus/Head';
|
|
10
|
-
|
|
11
|
-
export default Head;
|
|
10
|
+
export default function Head(props: Props): JSX.Element;
|
|
@@ -4,5 +4,4 @@
|
|
|
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
|
-
|
|
8
|
-
export default renderRoutes;
|
|
7
|
+
export { renderRoutes as default } from 'react-router-config';
|
|
@@ -4,5 +4,4 @@
|
|
|
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
|
-
|
|
8
|
-
export default renderRoutes;
|
|
7
|
+
export { renderRoutes as default } from 'react-router-config';
|
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { DocusaurusContext } from '@docusaurus/types';
|
|
8
|
-
|
|
9
|
-
export default useDocusaurusContext;
|
|
8
|
+
export default function useDocusaurusContext(): DocusaurusContext;
|
package/lib/client/flat.d.ts
CHANGED
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { RouteChunksTree } from '@docusaurus/types';
|
|
8
|
-
|
|
9
|
-
export default flat;
|
|
8
|
+
export default function flat(target: RouteChunksTree): Record<string, string>;
|
package/lib/client/flat.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
const isTree = (x) => typeof x === 'object' && !!x && Object.keys(x).length > 0;
|
|
8
|
-
function flat(target) {
|
|
8
|
+
export default function flat(target) {
|
|
9
9
|
const delimiter = '.';
|
|
10
10
|
const output = {};
|
|
11
11
|
function step(object, prefix) {
|
|
@@ -23,4 +23,3 @@ function flat(target) {
|
|
|
23
23
|
step(target);
|
|
24
24
|
return output;
|
|
25
25
|
}
|
|
26
|
-
export default flat;
|
|
@@ -5,5 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { Location } from 'history';
|
|
8
|
-
|
|
9
|
-
export default normalizeLocation;
|
|
8
|
+
export default function normalizeLocation<T extends Location>(location: T): T;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
// Memoize previously normalized pathnames.
|
|
8
8
|
const pathnames = {};
|
|
9
|
-
function normalizeLocation(location) {
|
|
9
|
+
export default function normalizeLocation(location) {
|
|
10
10
|
if (pathnames[location.pathname]) {
|
|
11
11
|
return {
|
|
12
12
|
...location,
|
|
@@ -24,4 +24,3 @@ function normalizeLocation(location) {
|
|
|
24
24
|
pathname,
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export default normalizeLocation;
|
package/lib/client/prefetch.d.ts
CHANGED
|
@@ -4,5 +4,4 @@
|
|
|
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
|
-
|
|
8
|
-
export default prefetch;
|
|
7
|
+
export default function prefetch(url: string): Promise<void>;
|
package/lib/client/prefetch.js
CHANGED
|
@@ -55,7 +55,7 @@ const supportedPrefetchStrategy = support('prefetch')
|
|
|
55
55
|
? linkPrefetchStrategy
|
|
56
56
|
: xhrPrefetchStrategy;
|
|
57
57
|
const preFetched = {};
|
|
58
|
-
function prefetch(url) {
|
|
58
|
+
export default function prefetch(url) {
|
|
59
59
|
return new Promise((resolve) => {
|
|
60
60
|
if (preFetched[url]) {
|
|
61
61
|
resolve();
|
|
@@ -69,4 +69,3 @@ function prefetch(url) {
|
|
|
69
69
|
.catch(() => { }); // 404s are logged to the console anyway.
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
export default prefetch;
|
|
@@ -7,5 +7,4 @@
|
|
|
7
7
|
/// <reference types="@docusaurus/module-type-aliases" />
|
|
8
8
|
/// <reference types="react" />
|
|
9
9
|
import type { Props } from '@theme/Error';
|
|
10
|
-
|
|
11
|
-
export default Error;
|
|
10
|
+
export default function Error({ error, tryAgain }: Props): JSX.Element;
|
|
@@ -24,7 +24,7 @@ function ErrorDisplay({ error, tryAgain }) {
|
|
|
24
24
|
</button>
|
|
25
25
|
</div>);
|
|
26
26
|
}
|
|
27
|
-
function Error({ error, tryAgain }) {
|
|
27
|
+
export default function Error({ error, tryAgain }) {
|
|
28
28
|
// We wrap the error in its own error boundary because the layout can actually
|
|
29
29
|
// throw too... Only the ErrorDisplay component is simple enough to be
|
|
30
30
|
// considered safe to never throw
|
|
@@ -37,4 +37,3 @@ function Error({ error, tryAgain }) {
|
|
|
37
37
|
</Layout>
|
|
38
38
|
</ErrorBoundary>);
|
|
39
39
|
}
|
|
40
|
-
export default Error;
|
|
@@ -7,5 +7,4 @@
|
|
|
7
7
|
/// <reference types="@docusaurus/module-type-aliases" />
|
|
8
8
|
/// <reference types="react" />
|
|
9
9
|
import type { Props } from '@theme/Layout';
|
|
10
|
-
|
|
11
|
-
export default Layout;
|
|
10
|
+
export default function Layout({ children, title, description, }: Props): JSX.Element;
|
|
@@ -8,7 +8,7 @@ import React from 'react';
|
|
|
8
8
|
import Head from '@docusaurus/Head';
|
|
9
9
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
10
10
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
11
|
-
function Layout({ children, title, description }) {
|
|
11
|
+
export default function Layout({ children, title, description, }) {
|
|
12
12
|
const context = useDocusaurusContext();
|
|
13
13
|
const { siteConfig } = context;
|
|
14
14
|
const { favicon, tagline, title: defaultTitle } = siteConfig;
|
|
@@ -23,4 +23,3 @@ function Layout({ children, title, description }) {
|
|
|
23
23
|
{children}
|
|
24
24
|
</>);
|
|
25
25
|
}
|
|
26
|
-
export default Layout;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Layout from '@theme/Layout';
|
|
9
|
-
function NotFound() {
|
|
9
|
+
export default function NotFound() {
|
|
10
10
|
return (<Layout title="Page Not Found">
|
|
11
11
|
<div style={{
|
|
12
12
|
display: 'flex',
|
|
@@ -19,4 +19,3 @@ function NotFound() {
|
|
|
19
19
|
</div>
|
|
20
20
|
</Layout>);
|
|
21
21
|
}
|
|
22
|
-
export default NotFound;
|
package/lib/server/loadSetup.js
CHANGED
|
@@ -10,7 +10,7 @@ const tslib_1 = require("tslib");
|
|
|
10
10
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
11
11
|
const index_1 = require("./index");
|
|
12
12
|
// Helper methods to setup dummy/fake projects.
|
|
13
|
-
|
|
13
|
+
async function loadSetup(name) {
|
|
14
14
|
const fixtures = path_1.default.join(__dirname, '__tests__', '__fixtures__');
|
|
15
15
|
const simpleSite = path_1.default.join(fixtures, 'simple-site');
|
|
16
16
|
const customSite = path_1.default.join(fixtures, 'custom-site');
|
|
@@ -21,5 +21,5 @@ const loadSetup = async (name) => {
|
|
|
21
21
|
default:
|
|
22
22
|
return (0, index_1.load)(simpleSite);
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
exports.default = loadSetup;
|
|
@@ -54,7 +54,7 @@ export interface Options {
|
|
|
54
54
|
*/
|
|
55
55
|
cleanOnceBeforeBuildPatterns?: string[];
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
export default class CleanWebpackPlugin {
|
|
58
58
|
private readonly verbose;
|
|
59
59
|
private readonly cleanStaleWebpackAssets;
|
|
60
60
|
private readonly protectWebpackAssets;
|
|
@@ -76,4 +76,3 @@ declare class CleanWebpackPlugin {
|
|
|
76
76
|
handleDone(stats: Stats): void;
|
|
77
77
|
removeFiles(patterns: string[]): void;
|
|
78
78
|
}
|
|
79
|
-
export default CleanWebpackPlugin;
|
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-4626",
|
|
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-
|
|
45
|
-
"@docusaurus/logger": "0.0.0-
|
|
46
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
44
|
+
"@docusaurus/cssnano-preset": "0.0.0-4626",
|
|
45
|
+
"@docusaurus/logger": "0.0.0-4626",
|
|
46
|
+
"@docusaurus/mdx-loader": "0.0.0-4626",
|
|
47
47
|
"@docusaurus/react-loadable": "5.5.2",
|
|
48
|
-
"@docusaurus/utils": "0.0.0-
|
|
49
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
50
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
48
|
+
"@docusaurus/utils": "0.0.0-4626",
|
|
49
|
+
"@docusaurus/utils-common": "0.0.0-4626",
|
|
50
|
+
"@docusaurus/utils-validation": "0.0.0-4626",
|
|
51
51
|
"@slorber/static-site-generator-webpack-plugin": "^4.0.1",
|
|
52
52
|
"@svgr/webpack": "^6.2.1",
|
|
53
53
|
"autoprefixer": "^10.4.2",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"webpackbar": "^5.0.2"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
109
|
-
"@docusaurus/types": "0.0.0-
|
|
108
|
+
"@docusaurus/module-type-aliases": "0.0.0-4626",
|
|
109
|
+
"@docusaurus/types": "0.0.0-4626",
|
|
110
110
|
"@types/detect-port": "^1.3.2",
|
|
111
111
|
"@types/nprogress": "^0.2.0",
|
|
112
112
|
"@types/react-dom": "^17.0.11",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"engines": {
|
|
127
127
|
"node": ">=14"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "1a36de8f473e7e7f79779e64748d47745068c89f"
|
|
130
130
|
}
|