@docusaurus/plugin-debug 2.0.0-beta.1 → 2.0.0-beta.10
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/copyUntypedFiles.js +20 -0
- package/lib/.tsbuildinfo +1 -1
- package/lib/index.js +11 -11
- package/lib/theme/DebugConfig/index.d.ts +9 -0
- package/lib/theme/DebugConfig/index.js +20 -0
- package/lib/theme/DebugContent/index.d.ts +10 -0
- package/lib/theme/DebugContent/index.js +34 -0
- package/lib/theme/DebugGlobalData/index.d.ts +9 -0
- package/lib/theme/DebugGlobalData/index.js +20 -0
- package/lib/theme/DebugJsonView/index.d.ts +10 -0
- package/lib/theme/DebugJsonView/index.js +35 -0
- package/lib/theme/DebugLayout/index.d.ts +11 -0
- package/lib/theme/DebugLayout/index.js +34 -0
- package/lib/theme/DebugLayout/styles.module.css +75 -0
- package/lib/theme/DebugRegistry/index.d.ts +9 -0
- package/lib/theme/DebugRegistry/index.js +25 -0
- package/lib/theme/DebugRegistry/styles.module.css +18 -0
- package/lib/theme/DebugRoutes/index.d.ts +9 -0
- package/lib/theme/DebugRoutes/index.js +28 -0
- package/lib/theme/DebugRoutes/styles.module.css +26 -0
- package/lib/theme/DebugSiteMetadata/index.d.ts +9 -0
- package/lib/theme/DebugSiteMetadata/index.js +35 -0
- package/lib/theme/DebugSiteMetadata/styles.module.css +31 -0
- package/package.json +14 -9
- package/src/index.ts +1 -1
- package/src/plugin-debug.d.ts +51 -0
- package/src/theme/DebugConfig/{index.js → index.tsx} +4 -4
- package/src/theme/DebugContent/index.tsx +81 -0
- package/src/theme/DebugGlobalData/{index.js → index.tsx} +4 -4
- package/src/theme/DebugJsonView/{index.js → index.tsx} +12 -11
- package/src/theme/DebugLayout/{index.js → index.tsx} +16 -14
- package/src/theme/DebugRegistry/{index.js → index.tsx} +2 -2
- package/src/theme/DebugRoutes/{index.js → index.tsx} +3 -3
- package/src/theme/DebugSiteMetadata/{index.js → index.tsx} +8 -7
- package/src/theme/DebugContent/index.js +0 -70
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import DebugLayout from '
|
|
10
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
11
11
|
import registry from '@generated/registry';
|
|
12
12
|
import styles from './styles.module.css';
|
|
13
13
|
|
|
14
|
-
function DebugRegistry() {
|
|
14
|
+
function DebugRegistry(): JSX.Element {
|
|
15
15
|
return (
|
|
16
16
|
<DebugLayout>
|
|
17
17
|
<h2>Registry</h2>
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import DebugLayout from '
|
|
11
|
-
import DebugJsonView from '
|
|
10
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
11
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
12
12
|
import routes from '@generated/routes';
|
|
13
13
|
import styles from './styles.module.css';
|
|
14
14
|
|
|
15
|
-
function DebugRoutes() {
|
|
15
|
+
function DebugRoutes(): JSX.Element {
|
|
16
16
|
return (
|
|
17
17
|
<DebugLayout>
|
|
18
18
|
<h2>Routes</h2>
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import DebugLayout from '
|
|
10
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
11
11
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
12
12
|
import styles from './styles.module.css';
|
|
13
13
|
|
|
14
|
-
function DebugMetadata() {
|
|
14
|
+
function DebugMetadata(): JSX.Element {
|
|
15
15
|
const {siteMetadata} = useDocusaurusContext();
|
|
16
16
|
return (
|
|
17
17
|
<DebugLayout>
|
|
@@ -28,11 +28,12 @@ function DebugMetadata() {
|
|
|
28
28
|
{Object.entries(siteMetadata.pluginVersions).map(
|
|
29
29
|
([name, versionInformation]) => (
|
|
30
30
|
<li key={name} className={styles.listItem}>
|
|
31
|
-
{versionInformation.
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
{versionInformation.type === 'package' &&
|
|
32
|
+
versionInformation.version && (
|
|
33
|
+
<div className={styles.version}>
|
|
34
|
+
<code>{versionInformation.version}</code>
|
|
35
|
+
</div>
|
|
36
|
+
)}
|
|
36
37
|
<div className={styles.name}>{name}</div>
|
|
37
38
|
<div>Type: {versionInformation.type}</div>
|
|
38
39
|
</li>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import DebugLayout from '../DebugLayout';
|
|
11
|
-
import DebugJsonView from '../DebugJsonView';
|
|
12
|
-
|
|
13
|
-
const PluginInstanceContent = ({pluginId, pluginInstanceContent}) => (
|
|
14
|
-
<section style={{marginBottom: 30}}>
|
|
15
|
-
<code>{pluginId}</code>
|
|
16
|
-
<DebugJsonView src={pluginInstanceContent} collapseDepth="2" />
|
|
17
|
-
</section>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const PluginContent = ({pluginName, pluginContent}) => {
|
|
21
|
-
return (
|
|
22
|
-
<section style={{marginBottom: 60}}>
|
|
23
|
-
<h3>{pluginName}</h3>
|
|
24
|
-
<div>
|
|
25
|
-
{Object.entries(pluginContent)
|
|
26
|
-
// filter plugin instances with no content
|
|
27
|
-
.filter(
|
|
28
|
-
([_pluginId, pluginInstanceContent]) => !!pluginInstanceContent,
|
|
29
|
-
)
|
|
30
|
-
.map(([pluginId, pluginInstanceContent]) => {
|
|
31
|
-
return (
|
|
32
|
-
<PluginInstanceContent
|
|
33
|
-
key={pluginId}
|
|
34
|
-
pluginId={pluginId}
|
|
35
|
-
pluginInstanceContent={pluginInstanceContent}
|
|
36
|
-
/>
|
|
37
|
-
);
|
|
38
|
-
})}
|
|
39
|
-
</div>
|
|
40
|
-
</section>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function DebugContent({allContent}) {
|
|
45
|
-
return (
|
|
46
|
-
<DebugLayout>
|
|
47
|
-
<h2>Plugin content</h2>
|
|
48
|
-
<div>
|
|
49
|
-
{Object.entries(allContent)
|
|
50
|
-
// filter plugins with no content
|
|
51
|
-
.filter(([_pluginName, pluginContent]) =>
|
|
52
|
-
Object.values(pluginContent).some(
|
|
53
|
-
(instanceContent) => !!instanceContent,
|
|
54
|
-
),
|
|
55
|
-
)
|
|
56
|
-
.map(([pluginName, pluginContent]) => {
|
|
57
|
-
return (
|
|
58
|
-
<PluginContent
|
|
59
|
-
key={pluginName}
|
|
60
|
-
pluginName={pluginName}
|
|
61
|
-
pluginContent={pluginContent}
|
|
62
|
-
/>
|
|
63
|
-
);
|
|
64
|
-
})}
|
|
65
|
-
</div>
|
|
66
|
-
</DebugLayout>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default DebugContent;
|