@docusaurus/plugin-debug 2.0.0-beta.20 → 2.0.0-beta.21
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/index.js +1 -1
- package/lib/theme/DebugConfig/index.js +12 -13
- package/lib/theme/DebugContent/index.js +50 -25
- package/lib/theme/DebugGlobalData/index.js +12 -13
- package/lib/theme/DebugJsonView/index.js +33 -19
- package/lib/theme/DebugLayout/index.js +45 -27
- package/lib/theme/DebugRegistry/index.js +22 -18
- package/lib/theme/DebugRoutes/index.js +29 -21
- package/lib/theme/DebugSiteMetadata/index.js +35 -28
- package/package.json +10 -8
- package/src/index.ts +2 -2
- package/src/theme/DebugConfig/index.tsx +1 -3
- package/src/theme/DebugGlobalData/index.tsx +1 -2
- package/src/theme/DebugJsonView/index.tsx +3 -2
- package/src/theme/DebugRegistry/index.tsx +1 -2
- package/src/theme/DebugRoutes/index.tsx +1 -2
- package/src/theme/DebugSiteMetadata/index.tsx +2 -3
package/lib/index.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
|
-
const utils_1 = require("@docusaurus/utils");
|
|
11
10
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
11
|
+
const utils_1 = require("@docusaurus/utils");
|
|
12
12
|
function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }) {
|
|
13
13
|
const pluginDataDirRoot = path_1.default.join(generatedFilesDir, 'docusaurus-plugin-debug');
|
|
14
14
|
const aliasedSource = (source) => `~debug/${(0, utils_1.posixPath)(path_1.default.relative(pluginDataDirRoot, source))}`;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
10
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
11
|
+
export default function DebugMetadata() {
|
|
12
|
+
const {siteConfig} = useDocusaurusContext();
|
|
13
|
+
return (
|
|
14
|
+
<DebugLayout>
|
|
15
|
+
<h2>Site config</h2>
|
|
16
|
+
<DebugJsonView src={siteConfig} collapseDepth={3} />
|
|
17
|
+
</DebugLayout>
|
|
18
|
+
);
|
|
19
19
|
}
|
|
20
|
-
exports.default = DebugMetadata;
|
|
@@ -1,34 +1,59 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
9
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
10
|
+
function PluginInstanceContent({pluginId, pluginInstanceContent}) {
|
|
11
|
+
return (
|
|
12
|
+
<section style={{marginBottom: 30}}>
|
|
13
|
+
<code>{pluginId}</code>
|
|
14
|
+
<DebugJsonView src={pluginInstanceContent} collapseDepth={2} />
|
|
15
|
+
</section>
|
|
16
|
+
);
|
|
17
17
|
}
|
|
18
|
-
function PluginContent({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
function PluginContent({pluginName, pluginContent}) {
|
|
19
|
+
return (
|
|
20
|
+
<section style={{marginBottom: 60}}>
|
|
21
|
+
<h3>{pluginName}</h3>
|
|
22
|
+
<div>
|
|
23
|
+
{Object.entries(pluginContent)
|
|
24
|
+
// Filter plugin instances with no content
|
|
25
|
+
.filter(([, pluginInstanceContent]) => !!pluginInstanceContent)
|
|
26
|
+
.map(([pluginId, pluginInstanceContent]) => (
|
|
27
|
+
<PluginInstanceContent
|
|
28
|
+
key={pluginId}
|
|
29
|
+
pluginId={pluginId}
|
|
30
|
+
pluginInstanceContent={pluginInstanceContent}
|
|
31
|
+
/>
|
|
32
|
+
))}
|
|
33
|
+
</div>
|
|
34
|
+
</section>
|
|
35
|
+
);
|
|
25
36
|
}
|
|
26
|
-
function DebugContent({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
export default function DebugContent({allContent}) {
|
|
38
|
+
return (
|
|
39
|
+
<DebugLayout>
|
|
40
|
+
<h2>Plugin content</h2>
|
|
41
|
+
<div>
|
|
42
|
+
{Object.entries(allContent)
|
|
43
|
+
// Filter plugins with no content
|
|
44
|
+
.filter(([, pluginContent]) =>
|
|
45
|
+
Object.values(pluginContent).some(
|
|
46
|
+
(instanceContent) => !!instanceContent,
|
|
47
|
+
),
|
|
48
|
+
)
|
|
49
|
+
.map(([pluginName, pluginContent]) => (
|
|
50
|
+
<PluginContent
|
|
51
|
+
key={pluginName}
|
|
52
|
+
pluginName={pluginName}
|
|
53
|
+
pluginContent={pluginContent}
|
|
54
|
+
/>
|
|
55
|
+
))}
|
|
56
|
+
</div>
|
|
57
|
+
</DebugLayout>
|
|
58
|
+
);
|
|
33
59
|
}
|
|
34
|
-
exports.default = DebugContent;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import useGlobalData from '@docusaurus/useGlobalData';
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
10
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
11
|
+
export default function DebugMetadata() {
|
|
12
|
+
const globalData = useGlobalData();
|
|
13
|
+
return (
|
|
14
|
+
<DebugLayout>
|
|
15
|
+
<h2>Global data</h2>
|
|
16
|
+
<DebugJsonView src={globalData} collapseDepth={3} />
|
|
17
|
+
</DebugLayout>
|
|
18
|
+
);
|
|
19
19
|
}
|
|
20
|
-
exports.default = DebugMetadata;
|
|
@@ -1,35 +1,49 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
11
|
-
const BrowserOnly_1 = tslib_1.__importDefault(require("@docusaurus/BrowserOnly"));
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import BrowserOnly from '@docusaurus/BrowserOnly';
|
|
12
9
|
// Avoids "react-json-view" displaying "root"
|
|
13
10
|
const RootName = null;
|
|
14
11
|
// Seems ReactJson does not work with SSR
|
|
15
12
|
// https://github.com/mac-s-g/react-json-view/issues/121
|
|
16
13
|
function BrowserOnlyReactJson(props) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
return (
|
|
15
|
+
<BrowserOnly>
|
|
16
|
+
{() => {
|
|
17
|
+
const {default: ReactJson} =
|
|
18
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
19
|
+
require('react-json-view');
|
|
20
|
+
return <ReactJson {...props} />;
|
|
21
|
+
}}
|
|
22
|
+
</BrowserOnly>
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
|
-
function DebugJsonView({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
export default function DebugJsonView({src, collapseDepth}) {
|
|
26
|
+
return (
|
|
27
|
+
<BrowserOnlyReactJson
|
|
28
|
+
src={src}
|
|
29
|
+
style={{
|
|
30
|
+
marginTop: '10px',
|
|
31
|
+
padding: '10px',
|
|
32
|
+
borderRadius: '4px',
|
|
33
|
+
backgroundColor: '#292a2b',
|
|
34
|
+
}}
|
|
35
|
+
name={RootName}
|
|
36
|
+
theme="paraiso"
|
|
37
|
+
shouldCollapse={(field) =>
|
|
30
38
|
// By default, we collapse the json for performance reasons
|
|
31
39
|
// See https://github.com/mac-s-g/react-json-view/issues/235
|
|
32
40
|
// Non-root elements that are larger than 50 fields are collapsed
|
|
33
|
-
field.name !== RootName && Object.keys(field.src).length > 50
|
|
41
|
+
field.name !== RootName && Object.keys(field.src).length > 50
|
|
42
|
+
}
|
|
43
|
+
collapsed={collapseDepth}
|
|
44
|
+
groupArraysAfterLength={5}
|
|
45
|
+
enableClipboard={false}
|
|
46
|
+
displayDataTypes={false}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
34
49
|
}
|
|
35
|
-
exports.default = DebugJsonView;
|
|
@@ -1,35 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Head from '@docusaurus/Head';
|
|
9
|
+
import Link from '@docusaurus/Link';
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
function DebugNavLink({to, children}) {
|
|
12
|
+
return (
|
|
13
|
+
<Link
|
|
14
|
+
className={styles.navlink}
|
|
15
|
+
isNavLink
|
|
16
|
+
to={to}
|
|
17
|
+
exact
|
|
18
|
+
activeStyle={{
|
|
19
|
+
backgroundColor: '#363739',
|
|
20
|
+
}}>
|
|
21
|
+
{children}
|
|
22
|
+
</Link>
|
|
23
|
+
);
|
|
18
24
|
}
|
|
19
|
-
function DebugLayout({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
export default function DebugLayout({children}) {
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<Head>
|
|
29
|
+
<html lang="en" />
|
|
30
|
+
<title>Docusaurus debug panel</title>
|
|
31
|
+
<meta name="robots" content="noindex" />
|
|
32
|
+
</Head>
|
|
33
|
+
|
|
34
|
+
<div>
|
|
35
|
+
<nav className={styles.nav}>
|
|
36
|
+
<DebugNavLink to="/__docusaurus/debug">Config</DebugNavLink>
|
|
37
|
+
<DebugNavLink to="/__docusaurus/debug/metadata">
|
|
38
|
+
Metadata
|
|
39
|
+
</DebugNavLink>
|
|
40
|
+
<DebugNavLink to="/__docusaurus/debug/registry">
|
|
41
|
+
Registry
|
|
42
|
+
</DebugNavLink>
|
|
43
|
+
<DebugNavLink to="/__docusaurus/debug/routes">Routes</DebugNavLink>
|
|
44
|
+
<DebugNavLink to="/__docusaurus/debug/content">Content</DebugNavLink>
|
|
45
|
+
<DebugNavLink to="/__docusaurus/debug/globalData">
|
|
46
|
+
Global data
|
|
47
|
+
</DebugNavLink>
|
|
48
|
+
</nav>
|
|
49
|
+
<main className={styles.container}>{children}</main>
|
|
50
|
+
</div>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
34
53
|
}
|
|
35
|
-
exports.default = DebugLayout;
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import registry from '@generated/registry';
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
export default function DebugRegistry() {
|
|
12
|
+
return (
|
|
13
|
+
<DebugLayout>
|
|
14
|
+
<h2>Registry</h2>
|
|
15
|
+
<ul className="clean-list">
|
|
16
|
+
{Object.values(registry).map(([, aliasedPath, resolved]) => (
|
|
17
|
+
<li key={aliasedPath} className={styles.listItem}>
|
|
18
|
+
<div style={{marginBottom: '10px'}}>
|
|
19
|
+
Aliased Path: <code>{aliasedPath}</code>
|
|
20
|
+
</div>
|
|
21
|
+
<div>
|
|
22
|
+
Resolved Path: <code>{resolved}</code>
|
|
23
|
+
</div>
|
|
24
|
+
</li>
|
|
25
|
+
))}
|
|
26
|
+
</ul>
|
|
27
|
+
</DebugLayout>
|
|
28
|
+
);
|
|
24
29
|
}
|
|
25
|
-
exports.default = DebugRegistry;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import routes from '@generated/routes';
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
10
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
11
|
+
import styles from './styles.module.css';
|
|
12
|
+
export default function DebugRoutes() {
|
|
13
|
+
return (
|
|
14
|
+
<DebugLayout>
|
|
15
|
+
<h2>Routes</h2>
|
|
16
|
+
<ul className="clean-list">
|
|
17
|
+
{routes.map(({path, exact, routes: childRoutes}) => (
|
|
18
|
+
<li key={path} className={styles.listItem}>
|
|
19
|
+
<div className={styles.route}>
|
|
20
|
+
<code className={styles.routeName}>{path}</code>
|
|
21
|
+
</div>
|
|
22
|
+
<div>
|
|
23
|
+
Is exact: <code>{String(Boolean(exact))}</code>
|
|
24
|
+
</div>
|
|
25
|
+
{childRoutes && (
|
|
26
|
+
<div>
|
|
27
|
+
Child Routes:
|
|
28
|
+
<DebugJsonView src={childRoutes} />
|
|
29
|
+
</div>
|
|
30
|
+
)}
|
|
31
|
+
</li>
|
|
32
|
+
))}
|
|
33
|
+
</ul>
|
|
34
|
+
</DebugLayout>
|
|
35
|
+
);
|
|
27
36
|
}
|
|
28
|
-
exports.default = DebugRoutes;
|
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
3
|
*
|
|
5
4
|
* This source code is licensed under the MIT license found in the
|
|
6
5
|
* LICENSE file in the root directory of this source tree.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
10
|
+
import styles from './styles.module.css';
|
|
11
|
+
export default function DebugMetadata() {
|
|
12
|
+
const {siteMetadata} = useDocusaurusContext();
|
|
13
|
+
return (
|
|
14
|
+
<DebugLayout>
|
|
15
|
+
<h2>Site Metadata</h2>
|
|
16
|
+
<div>
|
|
17
|
+
Docusaurus Version: <code>{siteMetadata.docusaurusVersion}</code>
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
Site Version:{' '}
|
|
21
|
+
<code>{siteMetadata.siteVersion ?? 'No version specified'}</code>
|
|
22
|
+
</div>
|
|
23
|
+
<h3 className={styles.sectionTitle}>Plugins and themes</h3>
|
|
24
|
+
<ul className="clean-list">
|
|
25
|
+
{Object.entries(siteMetadata.pluginVersions).map(
|
|
26
|
+
([name, versionInformation]) => (
|
|
27
|
+
<li key={name} className={styles.listItem}>
|
|
28
|
+
{versionInformation.type === 'package' &&
|
|
29
|
+
versionInformation.version && (
|
|
30
|
+
<div className={styles.version}>
|
|
31
|
+
<code>{versionInformation.version}</code>
|
|
32
|
+
</div>
|
|
33
|
+
)}
|
|
34
|
+
<div className={styles.name}>{name}</div>
|
|
35
|
+
<div>Type: {versionInformation.type}</div>
|
|
36
|
+
</li>
|
|
37
|
+
),
|
|
38
|
+
)}
|
|
39
|
+
</ul>
|
|
40
|
+
</DebugLayout>
|
|
41
|
+
);
|
|
34
42
|
}
|
|
35
|
-
exports.default = DebugMetadata;
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-debug",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.21",
|
|
4
4
|
"description": "Debug plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-debug.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc && node copyUntypedFiles.
|
|
9
|
-
"watch": "
|
|
8
|
+
"build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"",
|
|
9
|
+
"watch": "run-p -c copy:watch build:watch",
|
|
10
|
+
"build:watch": "tsc --build --watch",
|
|
11
|
+
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
10
12
|
},
|
|
11
13
|
"publishConfig": {
|
|
12
14
|
"access": "public"
|
|
@@ -18,21 +20,21 @@
|
|
|
18
20
|
},
|
|
19
21
|
"license": "MIT",
|
|
20
22
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "2.0.0-beta.
|
|
22
|
-
"@docusaurus/utils": "2.0.0-beta.
|
|
23
|
+
"@docusaurus/core": "2.0.0-beta.21",
|
|
24
|
+
"@docusaurus/utils": "2.0.0-beta.21",
|
|
23
25
|
"fs-extra": "^10.1.0",
|
|
24
26
|
"react-json-view": "^1.21.3",
|
|
25
27
|
"tslib": "^2.4.0"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
|
-
"@docusaurus/types": "2.0.0-beta.
|
|
30
|
+
"@docusaurus/types": "2.0.0-beta.21"
|
|
29
31
|
},
|
|
30
32
|
"peerDependencies": {
|
|
31
33
|
"react": "^16.8.4 || ^17.0.0",
|
|
32
34
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
33
35
|
},
|
|
34
36
|
"engines": {
|
|
35
|
-
"node": ">=14"
|
|
37
|
+
"node": ">=16.14"
|
|
36
38
|
},
|
|
37
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "69ac49fc6909517f13615ee40290c4bd00c39df4"
|
|
38
40
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
9
|
-
import {docuHash, normalizeUrl, posixPath} from '@docusaurus/utils';
|
|
10
8
|
import path from 'path';
|
|
9
|
+
import {docuHash, normalizeUrl, posixPath} from '@docusaurus/utils';
|
|
10
|
+
import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
11
11
|
|
|
12
12
|
export default function pluginDebug({
|
|
13
13
|
siteConfig: {baseUrl},
|
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
|
|
9
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
10
10
|
import DebugLayout from '@theme/DebugLayout';
|
|
11
11
|
import DebugJsonView from '@theme/DebugJsonView';
|
|
12
12
|
|
|
13
|
-
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
14
|
-
|
|
15
13
|
export default function DebugMetadata(): JSX.Element {
|
|
16
14
|
const {siteConfig} = useDocusaurusContext();
|
|
17
15
|
return (
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
|
|
9
|
+
import useGlobalData from '@docusaurus/useGlobalData';
|
|
10
10
|
import DebugLayout from '@theme/DebugLayout';
|
|
11
11
|
import DebugJsonView from '@theme/DebugJsonView';
|
|
12
|
-
import useGlobalData from '@docusaurus/useGlobalData';
|
|
13
12
|
|
|
14
13
|
export default function DebugMetadata(): JSX.Element {
|
|
15
14
|
const globalData = useGlobalData();
|
|
@@ -19,8 +19,9 @@ function BrowserOnlyReactJson(props: ReactJsonViewProps) {
|
|
|
19
19
|
return (
|
|
20
20
|
<BrowserOnly>
|
|
21
21
|
{() => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const {default: ReactJson} =
|
|
23
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
24
|
+
require('react-json-view') as typeof import('react-json-view');
|
|
24
25
|
return <ReactJson {...props} />;
|
|
25
26
|
}}
|
|
26
27
|
</BrowserOnly>
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import DebugLayout from '@theme/DebugLayout';
|
|
11
9
|
import registry from '@generated/registry';
|
|
10
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
12
11
|
import styles from './styles.module.css';
|
|
13
12
|
|
|
14
13
|
export default function DebugRegistry(): JSX.Element {
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
|
|
9
|
+
import routes from '@generated/routes';
|
|
10
10
|
import DebugLayout from '@theme/DebugLayout';
|
|
11
11
|
import DebugJsonView from '@theme/DebugJsonView';
|
|
12
|
-
import routes from '@generated/routes';
|
|
13
12
|
import styles from './styles.module.css';
|
|
14
13
|
|
|
15
14
|
export default function DebugRoutes(): JSX.Element {
|
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import DebugLayout from '@theme/DebugLayout';
|
|
11
9
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
10
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
12
11
|
import styles from './styles.module.css';
|
|
13
12
|
|
|
14
13
|
export default function DebugMetadata(): JSX.Element {
|
|
@@ -21,7 +20,7 @@ export default function DebugMetadata(): JSX.Element {
|
|
|
21
20
|
</div>
|
|
22
21
|
<div>
|
|
23
22
|
Site Version:{' '}
|
|
24
|
-
<code>{siteMetadata.siteVersion
|
|
23
|
+
<code>{siteMetadata.siteVersion ?? 'No version specified'}</code>
|
|
25
24
|
</div>
|
|
26
25
|
<h3 className={styles.sectionTitle}>Plugins and themes</h3>
|
|
27
26
|
<ul className="clean-list">
|