@docusaurus/plugin-debug 2.0.0-beta.ff31de0ff → 2.0.1
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.d.ts +2 -2
- package/lib/index.js +14 -11
- package/lib/theme/DebugConfig/index.d.ts +8 -0
- package/lib/theme/DebugConfig/index.js +19 -0
- package/lib/theme/DebugContent/index.d.ts +9 -0
- package/lib/theme/DebugContent/index.js +59 -0
- package/lib/theme/DebugGlobalData/index.d.ts +8 -0
- package/{src → lib}/theme/DebugGlobalData/index.js +4 -9
- package/lib/theme/DebugJsonView/index.d.ts +9 -0
- package/{src → lib}/theme/DebugJsonView/index.js +12 -18
- package/lib/theme/DebugLayout/index.d.ts +10 -0
- package/{src → lib}/theme/DebugLayout/index.js +16 -18
- package/lib/theme/DebugLayout/styles.module.css +75 -0
- package/lib/theme/DebugRegistry/index.d.ts +8 -0
- package/lib/theme/DebugRegistry/index.js +29 -0
- package/lib/theme/DebugRegistry/styles.module.css +13 -0
- package/lib/theme/DebugRoutes/index.d.ts +8 -0
- package/{src → lib}/theme/DebugRoutes/index.js +4 -9
- package/lib/theme/DebugRoutes/styles.module.css +21 -0
- package/lib/theme/DebugSiteMetadata/index.d.ts +8 -0
- package/{src → lib}/theme/DebugSiteMetadata/index.js +10 -14
- package/lib/theme/DebugSiteMetadata/styles.module.css +26 -0
- package/package.json +16 -9
- package/src/index.ts +7 -4
- package/src/plugin-debug.d.ts +59 -0
- package/src/theme/DebugConfig/{index.js → index.tsx} +4 -8
- package/src/theme/DebugContent/index.tsx +77 -0
- package/src/theme/DebugGlobalData/index.tsx +21 -0
- package/src/theme/DebugJsonView/index.tsx +58 -0
- package/src/theme/DebugLayout/index.tsx +60 -0
- package/src/theme/DebugLayout/styles.module.css +1 -1
- package/src/theme/DebugRegistry/{index.js → index.tsx} +3 -6
- package/src/theme/DebugRegistry/styles.module.css +0 -5
- package/src/theme/DebugRoutes/index.tsx +38 -0
- package/src/theme/DebugRoutes/styles.module.css +0 -5
- package/src/theme/DebugSiteMetadata/index.tsx +44 -0
- package/src/theme/DebugSiteMetadata/styles.module.css +0 -5
- package/lib/.tsbuildinfo +0 -3895
- package/src/theme/DebugContent/index.js +0 -70
- package/tsconfig.json +0 -9
package/lib/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
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 { LoadContext, Plugin } from '@docusaurus/types';
|
|
8
|
-
export default function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }: LoadContext): Plugin<
|
|
7
|
+
import type { LoadContext, Plugin } from '@docusaurus/types';
|
|
8
|
+
export default function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }: LoadContext): Plugin<undefined>;
|
package/lib/index.js
CHANGED
|
@@ -7,49 +7,52 @@
|
|
|
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
|
-
const aliasedSource = (source) => `~debug/${utils_1.posixPath(path_1.default.relative(pluginDataDirRoot, source))}`;
|
|
14
|
+
const aliasedSource = (source) => `~debug/${(0, utils_1.posixPath)(path_1.default.relative(pluginDataDirRoot, source))}`;
|
|
15
15
|
return {
|
|
16
16
|
name: 'docusaurus-plugin-debug',
|
|
17
17
|
getThemePath() {
|
|
18
|
-
return
|
|
18
|
+
return '../lib/theme';
|
|
19
|
+
},
|
|
20
|
+
getTypeScriptThemePath() {
|
|
21
|
+
return '../src/theme';
|
|
19
22
|
},
|
|
20
23
|
async contentLoaded({ actions: { createData, addRoute }, allContent }) {
|
|
21
24
|
const allContentPath = await createData(
|
|
22
25
|
// Note that this created data path must be in sync with
|
|
23
26
|
// metadataPath provided to mdx-loader.
|
|
24
|
-
`${utils_1.docuHash('docusaurus-debug-allContent')}.json`, JSON.stringify(allContent, null, 2));
|
|
27
|
+
`${(0, utils_1.docuHash)('docusaurus-debug-allContent')}.json`, JSON.stringify(allContent, null, 2));
|
|
25
28
|
// Home is config (duplicate for now)
|
|
26
29
|
addRoute({
|
|
27
|
-
path: utils_1.normalizeUrl([baseUrl, '__docusaurus/debug']),
|
|
30
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug']),
|
|
28
31
|
component: '@theme/DebugConfig',
|
|
29
32
|
exact: true,
|
|
30
33
|
});
|
|
31
34
|
addRoute({
|
|
32
|
-
path: utils_1.normalizeUrl([baseUrl, '__docusaurus/debug/config']),
|
|
35
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/config']),
|
|
33
36
|
component: '@theme/DebugConfig',
|
|
34
37
|
exact: true,
|
|
35
38
|
});
|
|
36
39
|
addRoute({
|
|
37
|
-
path: utils_1.normalizeUrl([baseUrl, '__docusaurus/debug/metadata']),
|
|
40
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/metadata']),
|
|
38
41
|
component: '@theme/DebugSiteMetadata',
|
|
39
42
|
exact: true,
|
|
40
43
|
});
|
|
41
44
|
addRoute({
|
|
42
|
-
path: utils_1.normalizeUrl([baseUrl, '__docusaurus/debug/registry']),
|
|
45
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/registry']),
|
|
43
46
|
component: '@theme/DebugRegistry',
|
|
44
47
|
exact: true,
|
|
45
48
|
});
|
|
46
49
|
addRoute({
|
|
47
|
-
path: utils_1.normalizeUrl([baseUrl, '__docusaurus/debug/routes']),
|
|
50
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/routes']),
|
|
48
51
|
component: '@theme/DebugRoutes',
|
|
49
52
|
exact: true,
|
|
50
53
|
});
|
|
51
54
|
addRoute({
|
|
52
|
-
path: utils_1.normalizeUrl([baseUrl, '__docusaurus/debug/content']),
|
|
55
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/content']),
|
|
53
56
|
component: '@theme/DebugContent',
|
|
54
57
|
exact: true,
|
|
55
58
|
modules: {
|
|
@@ -57,7 +60,7 @@ function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }) {
|
|
|
57
60
|
},
|
|
58
61
|
});
|
|
59
62
|
addRoute({
|
|
60
|
-
path: utils_1.normalizeUrl([baseUrl, '__docusaurus/debug/globalData']),
|
|
63
|
+
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/globalData']),
|
|
61
64
|
component: '@theme/DebugGlobalData',
|
|
62
65
|
exact: true,
|
|
63
66
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
export default function DebugMetadata(): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
import type { Props } from '@theme/DebugContent';
|
|
9
|
+
export default function DebugContent({ allContent }: Props): JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
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
|
+
}
|
|
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
|
+
);
|
|
36
|
+
}
|
|
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
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
export default function DebugMetadata(): JSX.Element;
|
|
@@ -4,21 +4,16 @@
|
|
|
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
7
|
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import DebugLayout from '../DebugLayout';
|
|
11
|
-
import DebugJsonView from '../DebugJsonView';
|
|
12
8
|
import useGlobalData from '@docusaurus/useGlobalData';
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
10
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
11
|
+
export default function DebugMetadata() {
|
|
15
12
|
const globalData = useGlobalData();
|
|
16
13
|
return (
|
|
17
14
|
<DebugLayout>
|
|
18
15
|
<h2>Global data</h2>
|
|
19
|
-
<DebugJsonView src={globalData} collapseDepth=
|
|
16
|
+
<DebugJsonView src={globalData} collapseDepth={3} />
|
|
20
17
|
</DebugLayout>
|
|
21
18
|
);
|
|
22
19
|
}
|
|
23
|
-
|
|
24
|
-
export default DebugMetadata;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
import type { Props } from '@theme/DebugJsonView';
|
|
9
|
+
export default function DebugJsonView({ src, collapseDepth, }: Props): JSX.Element;
|
|
@@ -4,29 +4,25 @@
|
|
|
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
7
|
import React from 'react';
|
|
9
|
-
|
|
10
8
|
import BrowserOnly from '@docusaurus/BrowserOnly';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const RootName = false;
|
|
14
|
-
|
|
9
|
+
// Avoids "react-json-view" displaying "root"
|
|
10
|
+
const RootName = null;
|
|
15
11
|
// Seems ReactJson does not work with SSR
|
|
16
12
|
// https://github.com/mac-s-g/react-json-view/issues/121
|
|
17
|
-
|
|
13
|
+
function BrowserOnlyReactJson(props) {
|
|
18
14
|
return (
|
|
19
15
|
<BrowserOnly>
|
|
20
16
|
{() => {
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const {default: ReactJson} =
|
|
18
|
+
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
|
|
19
|
+
require('react-json-view');
|
|
23
20
|
return <ReactJson {...props} />;
|
|
24
21
|
}}
|
|
25
22
|
</BrowserOnly>
|
|
26
23
|
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function DebugJsonView({src, collapseDepth}) {
|
|
24
|
+
}
|
|
25
|
+
export default function DebugJsonView({src, collapseDepth}) {
|
|
30
26
|
return (
|
|
31
27
|
<BrowserOnlyReactJson
|
|
32
28
|
src={src}
|
|
@@ -38,18 +34,16 @@ function DebugJsonView({src, collapseDepth}) {
|
|
|
38
34
|
}}
|
|
39
35
|
name={RootName}
|
|
40
36
|
theme="paraiso"
|
|
41
|
-
shouldCollapse={(field) =>
|
|
37
|
+
shouldCollapse={(field) =>
|
|
42
38
|
// By default, we collapse the json for performance reasons
|
|
43
39
|
// See https://github.com/mac-s-g/react-json-view/issues/235
|
|
44
40
|
// Non-root elements that are larger than 50 fields are collapsed
|
|
45
|
-
|
|
46
|
-
}
|
|
41
|
+
field.name !== RootName && Object.keys(field.src).length > 50
|
|
42
|
+
}
|
|
47
43
|
collapsed={collapseDepth}
|
|
48
|
-
groupArraysAfterLength=
|
|
44
|
+
groupArraysAfterLength={5}
|
|
49
45
|
enableClipboard={false}
|
|
50
46
|
displayDataTypes={false}
|
|
51
47
|
/>
|
|
52
48
|
);
|
|
53
49
|
}
|
|
54
|
-
|
|
55
|
-
export default DebugJsonView;
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
import { type ReactNode } from 'react';
|
|
8
|
+
export default function DebugLayout({ children, }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}): JSX.Element;
|
|
@@ -4,31 +4,31 @@
|
|
|
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
7
|
import React from 'react';
|
|
9
8
|
import Head from '@docusaurus/Head';
|
|
10
9
|
import Link from '@docusaurus/Link';
|
|
11
10
|
import styles from './styles.module.css';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
function DebugLayout({children}) {
|
|
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
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export default function DebugLayout({children}) {
|
|
27
26
|
return (
|
|
28
27
|
<>
|
|
29
28
|
<Head>
|
|
30
29
|
<html lang="en" />
|
|
31
30
|
<title>Docusaurus debug panel</title>
|
|
31
|
+
<meta name="robots" content="noindex" />
|
|
32
32
|
</Head>
|
|
33
33
|
|
|
34
34
|
<div>
|
|
@@ -51,5 +51,3 @@ function DebugLayout({children}) {
|
|
|
51
51
|
</>
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
export default DebugLayout;
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
.container {
|
|
9
|
+
padding: 20px;
|
|
10
|
+
padding-top: 80px;
|
|
11
|
+
overflow-x: hidden;
|
|
12
|
+
background-color: #18191a;
|
|
13
|
+
color: white;
|
|
14
|
+
min-height: 100vh;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.container code {
|
|
18
|
+
color: white;
|
|
19
|
+
background-color: #444950;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.nav {
|
|
23
|
+
position: fixed;
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: space-evenly;
|
|
26
|
+
align-items: center;
|
|
27
|
+
height: 3.75rem;
|
|
28
|
+
background-color: #242526;
|
|
29
|
+
width: 100%;
|
|
30
|
+
z-index: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.navlink {
|
|
34
|
+
color: white;
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
font-size: clamp(12px, 4vw, 16px);
|
|
37
|
+
text-align: center;
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
padding: 6px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.navlink:hover {
|
|
43
|
+
text-decoration: none;
|
|
44
|
+
background-color: #292a2b;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.active {
|
|
48
|
+
background-color: #363739;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media screen and (min-width: 800px) {
|
|
52
|
+
.nav {
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
justify-content: flex-start;
|
|
55
|
+
align-items: center;
|
|
56
|
+
height: 100vh;
|
|
57
|
+
width: 200px;
|
|
58
|
+
float: left;
|
|
59
|
+
background-color: #18191a;
|
|
60
|
+
border-right: 1px solid #606770;
|
|
61
|
+
padding-top: 20px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.navlink {
|
|
65
|
+
width: 80%;
|
|
66
|
+
margin-top: 20px;
|
|
67
|
+
text-align: left;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.container {
|
|
71
|
+
padding-top: 40px;
|
|
72
|
+
float: right;
|
|
73
|
+
width: calc(100% - 200px);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
export default function DebugRegistry(): JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
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
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
.listItem {
|
|
9
|
+
background-color: #242526;
|
|
10
|
+
padding: 10px;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
margin-bottom: 20px;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
export default function DebugRoutes(): JSX.Element;
|
|
@@ -4,19 +4,16 @@
|
|
|
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
7
|
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import DebugLayout from '../DebugLayout';
|
|
11
|
-
import DebugJsonView from '../DebugJsonView';
|
|
12
8
|
import routes from '@generated/routes';
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
10
|
+
import DebugJsonView from '@theme/DebugJsonView';
|
|
13
11
|
import styles from './styles.module.css';
|
|
14
|
-
|
|
15
|
-
function DebugRoutes() {
|
|
12
|
+
export default function DebugRoutes() {
|
|
16
13
|
return (
|
|
17
14
|
<DebugLayout>
|
|
18
15
|
<h2>Routes</h2>
|
|
19
|
-
<ul className=
|
|
16
|
+
<ul className="clean-list">
|
|
20
17
|
{routes.map(({path, exact, routes: childRoutes}) => (
|
|
21
18
|
<li key={path} className={styles.listItem}>
|
|
22
19
|
<div className={styles.route}>
|
|
@@ -37,5 +34,3 @@ function DebugRoutes() {
|
|
|
37
34
|
</DebugLayout>
|
|
38
35
|
);
|
|
39
36
|
}
|
|
40
|
-
|
|
41
|
-
export default DebugRoutes;
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
.listItem {
|
|
9
|
+
background-color: #242526;
|
|
10
|
+
padding: 10px;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
margin-bottom: 20px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.route {
|
|
16
|
+
margin-bottom: 10px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.routeName {
|
|
20
|
+
color: #e06b6b;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
8
|
+
export default function DebugMetadata(): JSX.Element;
|
|
@@ -4,14 +4,11 @@
|
|
|
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
7
|
import React from 'react';
|
|
9
|
-
|
|
10
|
-
import DebugLayout from '../DebugLayout';
|
|
11
8
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
9
|
+
import DebugLayout from '@theme/DebugLayout';
|
|
12
10
|
import styles from './styles.module.css';
|
|
13
|
-
|
|
14
|
-
function DebugMetadata() {
|
|
11
|
+
export default function DebugMetadata() {
|
|
15
12
|
const {siteMetadata} = useDocusaurusContext();
|
|
16
13
|
return (
|
|
17
14
|
<DebugLayout>
|
|
@@ -21,18 +18,19 @@ function DebugMetadata() {
|
|
|
21
18
|
</div>
|
|
22
19
|
<div>
|
|
23
20
|
Site Version:{' '}
|
|
24
|
-
<code>{siteMetadata.siteVersion
|
|
21
|
+
<code>{siteMetadata.siteVersion ?? 'No version specified'}</code>
|
|
25
22
|
</div>
|
|
26
23
|
<h3 className={styles.sectionTitle}>Plugins and themes</h3>
|
|
27
|
-
<ul className=
|
|
24
|
+
<ul className="clean-list">
|
|
28
25
|
{Object.entries(siteMetadata.pluginVersions).map(
|
|
29
26
|
([name, versionInformation]) => (
|
|
30
27
|
<li key={name} className={styles.listItem}>
|
|
31
|
-
{versionInformation.
|
|
32
|
-
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
{versionInformation.type === 'package' &&
|
|
29
|
+
versionInformation.version && (
|
|
30
|
+
<div className={styles.version}>
|
|
31
|
+
<code>{versionInformation.version}</code>
|
|
32
|
+
</div>
|
|
33
|
+
)}
|
|
36
34
|
<div className={styles.name}>{name}</div>
|
|
37
35
|
<div>Type: {versionInformation.type}</div>
|
|
38
36
|
</li>
|
|
@@ -42,5 +40,3 @@ function DebugMetadata() {
|
|
|
42
40
|
</DebugLayout>
|
|
43
41
|
);
|
|
44
42
|
}
|
|
45
|
-
|
|
46
|
-
export default DebugMetadata;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
.sectionTitle {
|
|
9
|
+
margin-top: 20px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.listItem {
|
|
13
|
+
background-color: #242526;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
border-radius: 4px;
|
|
16
|
+
margin-bottom: 20px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.version {
|
|
20
|
+
float: right;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.name {
|
|
24
|
+
font-weight: 800;
|
|
25
|
+
color: #e06b6b;
|
|
26
|
+
}
|