@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 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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const react_1 = tslib_1.__importDefault(require("react"));
11
- const DebugLayout_1 = tslib_1.__importDefault(require("@theme/DebugLayout"));
12
- const DebugJsonView_1 = tslib_1.__importDefault(require("@theme/DebugJsonView"));
13
- const useDocusaurusContext_1 = tslib_1.__importDefault(require("@docusaurus/useDocusaurusContext"));
14
- function DebugMetadata() {
15
- const { siteConfig } = (0, useDocusaurusContext_1.default)();
16
- return (react_1.default.createElement(DebugLayout_1.default, null,
17
- react_1.default.createElement("h2", null, "Site config"),
18
- react_1.default.createElement(DebugJsonView_1.default, { src: siteConfig, collapseDepth: 3 })));
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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const react_1 = tslib_1.__importDefault(require("react"));
11
- const DebugLayout_1 = tslib_1.__importDefault(require("@theme/DebugLayout"));
12
- const DebugJsonView_1 = tslib_1.__importDefault(require("@theme/DebugJsonView"));
13
- function PluginInstanceContent({ pluginId, pluginInstanceContent, }) {
14
- return (react_1.default.createElement("section", { style: { marginBottom: 30 } },
15
- react_1.default.createElement("code", null, pluginId),
16
- react_1.default.createElement(DebugJsonView_1.default, { src: pluginInstanceContent, collapseDepth: 2 })));
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({ pluginName, pluginContent, }) {
19
- return (react_1.default.createElement("section", { style: { marginBottom: 60 } },
20
- react_1.default.createElement("h3", null, pluginName),
21
- react_1.default.createElement("div", null, Object.entries(pluginContent)
22
- // Filter plugin instances with no content
23
- .filter(([, pluginInstanceContent]) => !!pluginInstanceContent)
24
- .map(([pluginId, pluginInstanceContent]) => (react_1.default.createElement(PluginInstanceContent, { key: pluginId, pluginId: pluginId, pluginInstanceContent: pluginInstanceContent }))))));
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({ allContent }) {
27
- return (react_1.default.createElement(DebugLayout_1.default, null,
28
- react_1.default.createElement("h2", null, "Plugin content"),
29
- react_1.default.createElement("div", null, Object.entries(allContent)
30
- // Filter plugins with no content
31
- .filter(([, pluginContent]) => Object.values(pluginContent).some((instanceContent) => !!instanceContent))
32
- .map(([pluginName, pluginContent]) => (react_1.default.createElement(PluginContent, { key: pluginName, pluginName: pluginName, pluginContent: pluginContent }))))));
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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const react_1 = tslib_1.__importDefault(require("react"));
11
- const DebugLayout_1 = tslib_1.__importDefault(require("@theme/DebugLayout"));
12
- const DebugJsonView_1 = tslib_1.__importDefault(require("@theme/DebugJsonView"));
13
- const useGlobalData_1 = tslib_1.__importDefault(require("@docusaurus/useGlobalData"));
14
- function DebugMetadata() {
15
- const globalData = (0, useGlobalData_1.default)();
16
- return (react_1.default.createElement(DebugLayout_1.default, null,
17
- react_1.default.createElement("h2", null, "Global data"),
18
- react_1.default.createElement(DebugJsonView_1.default, { src: globalData, collapseDepth: 3 })));
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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
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
- return (react_1.default.createElement(BrowserOnly_1.default, null, () => {
18
- // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
19
- const ReactJson = require('react-json-view').default;
20
- return react_1.default.createElement(ReactJson, { ...props });
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({ src, collapseDepth, }) {
24
- return (react_1.default.createElement(BrowserOnlyReactJson, { src: src, style: {
25
- marginTop: '10px',
26
- padding: '10px',
27
- borderRadius: '4px',
28
- backgroundColor: '#292a2b',
29
- }, name: RootName, theme: "paraiso", shouldCollapse: (field) =>
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, collapsed: collapseDepth, groupArraysAfterLength: 5, enableClipboard: false, displayDataTypes: false }));
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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const react_1 = tslib_1.__importDefault(require("react"));
11
- const Head_1 = tslib_1.__importDefault(require("@docusaurus/Head"));
12
- const Link_1 = tslib_1.__importDefault(require("@docusaurus/Link"));
13
- const styles_module_css_1 = tslib_1.__importDefault(require("./styles.module.css"));
14
- function DebugNavLink({ to, children }) {
15
- return (react_1.default.createElement(Link_1.default, { className: styles_module_css_1.default.navlink, isNavLink: true, to: to, exact: true, activeStyle: {
16
- backgroundColor: '#363739',
17
- } }, children));
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({ children, }) {
20
- return (react_1.default.createElement(react_1.default.Fragment, null,
21
- react_1.default.createElement(Head_1.default, null,
22
- react_1.default.createElement("html", { lang: "en" }),
23
- react_1.default.createElement("title", null, "Docusaurus debug panel"),
24
- react_1.default.createElement("meta", { name: "robots", content: "noindex" })),
25
- react_1.default.createElement("div", null,
26
- react_1.default.createElement("nav", { className: styles_module_css_1.default.nav },
27
- react_1.default.createElement(DebugNavLink, { to: "/__docusaurus/debug" }, "Config"),
28
- react_1.default.createElement(DebugNavLink, { to: "/__docusaurus/debug/metadata" }, "Metadata"),
29
- react_1.default.createElement(DebugNavLink, { to: "/__docusaurus/debug/registry" }, "Registry"),
30
- react_1.default.createElement(DebugNavLink, { to: "/__docusaurus/debug/routes" }, "Routes"),
31
- react_1.default.createElement(DebugNavLink, { to: "/__docusaurus/debug/content" }, "Content"),
32
- react_1.default.createElement(DebugNavLink, { to: "/__docusaurus/debug/globalData" }, "Global data")),
33
- react_1.default.createElement("main", { className: styles_module_css_1.default.container }, children))));
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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const react_1 = tslib_1.__importDefault(require("react"));
11
- const DebugLayout_1 = tslib_1.__importDefault(require("@theme/DebugLayout"));
12
- const registry_1 = tslib_1.__importDefault(require("@generated/registry"));
13
- const styles_module_css_1 = tslib_1.__importDefault(require("./styles.module.css"));
14
- function DebugRegistry() {
15
- return (react_1.default.createElement(DebugLayout_1.default, null,
16
- react_1.default.createElement("h2", null, "Registry"),
17
- react_1.default.createElement("ul", { className: "clean-list" }, Object.values(registry_1.default).map(([, aliasedPath, resolved]) => (react_1.default.createElement("li", { key: aliasedPath, className: styles_module_css_1.default.listItem },
18
- react_1.default.createElement("div", { style: { marginBottom: '10px' } },
19
- "Aliased Path: ",
20
- react_1.default.createElement("code", null, aliasedPath)),
21
- react_1.default.createElement("div", null,
22
- "Resolved Path: ",
23
- react_1.default.createElement("code", null, resolved))))))));
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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const react_1 = tslib_1.__importDefault(require("react"));
11
- const DebugLayout_1 = tslib_1.__importDefault(require("@theme/DebugLayout"));
12
- const DebugJsonView_1 = tslib_1.__importDefault(require("@theme/DebugJsonView"));
13
- const routes_1 = tslib_1.__importDefault(require("@generated/routes"));
14
- const styles_module_css_1 = tslib_1.__importDefault(require("./styles.module.css"));
15
- function DebugRoutes() {
16
- return (react_1.default.createElement(DebugLayout_1.default, null,
17
- react_1.default.createElement("h2", null, "Routes"),
18
- react_1.default.createElement("ul", { className: "clean-list" }, routes_1.default.map(({ path, exact, routes: childRoutes }) => (react_1.default.createElement("li", { key: path, className: styles_module_css_1.default.listItem },
19
- react_1.default.createElement("div", { className: styles_module_css_1.default.route },
20
- react_1.default.createElement("code", { className: styles_module_css_1.default.routeName }, path)),
21
- react_1.default.createElement("div", null,
22
- "Is exact: ",
23
- react_1.default.createElement("code", null, String(Boolean(exact)))),
24
- childRoutes && (react_1.default.createElement("div", null,
25
- "Child Routes:",
26
- react_1.default.createElement(DebugJsonView_1.default, { src: childRoutes })))))))));
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
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
- const react_1 = tslib_1.__importDefault(require("react"));
11
- const DebugLayout_1 = tslib_1.__importDefault(require("@theme/DebugLayout"));
12
- const useDocusaurusContext_1 = tslib_1.__importDefault(require("@docusaurus/useDocusaurusContext"));
13
- const styles_module_css_1 = tslib_1.__importDefault(require("./styles.module.css"));
14
- function DebugMetadata() {
15
- const { siteMetadata } = (0, useDocusaurusContext_1.default)();
16
- return (react_1.default.createElement(DebugLayout_1.default, null,
17
- react_1.default.createElement("h2", null, "Site Metadata"),
18
- react_1.default.createElement("div", null,
19
- "Docusaurus Version: ",
20
- react_1.default.createElement("code", null, siteMetadata.docusaurusVersion)),
21
- react_1.default.createElement("div", null,
22
- "Site Version:",
23
- ' ',
24
- react_1.default.createElement("code", null, siteMetadata.siteVersion || 'No version specified')),
25
- react_1.default.createElement("h3", { className: styles_module_css_1.default.sectionTitle }, "Plugins and themes"),
26
- react_1.default.createElement("ul", { className: "clean-list" }, Object.entries(siteMetadata.pluginVersions).map(([name, versionInformation]) => (react_1.default.createElement("li", { key: name, className: styles_module_css_1.default.listItem },
27
- versionInformation.type === 'package' &&
28
- versionInformation.version && (react_1.default.createElement("div", { className: styles_module_css_1.default.version },
29
- react_1.default.createElement("code", null, versionInformation.version))),
30
- react_1.default.createElement("div", { className: styles_module_css_1.default.name }, name),
31
- react_1.default.createElement("div", null,
32
- "Type: ",
33
- versionInformation.type)))))));
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.20",
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.mjs",
9
- "watch": "node copyUntypedFiles.mjs && tsc --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.20",
22
- "@docusaurus/utils": "2.0.0-beta.20",
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.20"
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": "ed5cdba401a5948e187e927039b142a0decc702d"
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
- // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
23
- const ReactJson = require('react-json-view').default;
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 || 'No version specified'}</code>
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">