@azerion/bunosaurus-plugin-debug 0.0.0-stage → 4.0.0

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.
Files changed (40) hide show
  1. package/README.md +6 -2
  2. package/lib/index.d.ts +8 -0
  3. package/lib/index.js +62 -0
  4. package/lib/theme/DebugConfig/index.d.ts +8 -0
  5. package/lib/theme/DebugConfig/index.js +18 -0
  6. package/lib/theme/DebugContent/index.d.ts +9 -0
  7. package/lib/theme/DebugContent/index.js +58 -0
  8. package/lib/theme/DebugGlobalData/index.d.ts +8 -0
  9. package/lib/theme/DebugGlobalData/index.js +18 -0
  10. package/lib/theme/DebugJsonView/index.d.ts +9 -0
  11. package/lib/theme/DebugJsonView/index.js +40 -0
  12. package/lib/theme/DebugJsonView/styles.module.css +110 -0
  13. package/lib/theme/DebugLayout/index.d.ts +10 -0
  14. package/lib/theme/DebugLayout/index.js +52 -0
  15. package/lib/theme/DebugLayout/styles.module.css +75 -0
  16. package/lib/theme/DebugRegistry/index.d.ts +8 -0
  17. package/lib/theme/DebugRegistry/index.js +28 -0
  18. package/lib/theme/DebugRegistry/styles.module.css +13 -0
  19. package/lib/theme/DebugRoutes/index.d.ts +8 -0
  20. package/lib/theme/DebugRoutes/index.js +35 -0
  21. package/lib/theme/DebugRoutes/styles.module.css +21 -0
  22. package/lib/theme/DebugSiteMetadata/index.d.ts +8 -0
  23. package/lib/theme/DebugSiteMetadata/index.js +41 -0
  24. package/lib/theme/DebugSiteMetadata/styles.module.css +26 -0
  25. package/package.json +35 -4
  26. package/src/index.ts +72 -0
  27. package/src/plugin-debug.d.ts +70 -0
  28. package/src/theme/DebugConfig/index.tsx +21 -0
  29. package/src/theme/DebugContent/index.tsx +77 -0
  30. package/src/theme/DebugGlobalData/index.tsx +21 -0
  31. package/src/theme/DebugJsonView/index.tsx +50 -0
  32. package/src/theme/DebugJsonView/styles.module.css +110 -0
  33. package/src/theme/DebugLayout/index.tsx +60 -0
  34. package/src/theme/DebugLayout/styles.module.css +75 -0
  35. package/src/theme/DebugRegistry/index.tsx +31 -0
  36. package/src/theme/DebugRegistry/styles.module.css +13 -0
  37. package/src/theme/DebugRoutes/index.tsx +38 -0
  38. package/src/theme/DebugRoutes/styles.module.css +21 -0
  39. package/src/theme/DebugSiteMetadata/index.tsx +44 -0
  40. package/src/theme/DebugSiteMetadata/styles.module.css +26 -0
@@ -0,0 +1,38 @@
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 type {ReactNode} from 'react';
9
+ import routes from '@generated/routes';
10
+ import DebugLayout from '@theme/DebugLayout';
11
+ import DebugJsonView from '@theme/DebugJsonView';
12
+ import styles from './styles.module.css';
13
+
14
+ export default function DebugRoutes(): ReactNode {
15
+ return (
16
+ <DebugLayout>
17
+ <h2>Routes</h2>
18
+ <ul className="clean-list">
19
+ {routes.map(({path, exact, routes: childRoutes}) => (
20
+ <li key={path} className={styles.listItem}>
21
+ <div className={styles.route}>
22
+ <code className={styles.routeName}>{path}</code>
23
+ </div>
24
+ <div>
25
+ Is exact: <code>{String(Boolean(exact))}</code>
26
+ </div>
27
+ {childRoutes && (
28
+ <div>
29
+ Child Routes:
30
+ <DebugJsonView src={childRoutes} />
31
+ </div>
32
+ )}
33
+ </li>
34
+ ))}
35
+ </ul>
36
+ </DebugLayout>
37
+ );
38
+ }
@@ -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,44 @@
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 type {ReactNode} from 'react';
9
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
10
+ import DebugLayout from '@theme/DebugLayout';
11
+ import styles from './styles.module.css';
12
+
13
+ export default function DebugMetadata(): ReactNode {
14
+ const {siteMetadata} = useDocusaurusContext();
15
+ return (
16
+ <DebugLayout>
17
+ <h2>Site Metadata</h2>
18
+ <div>
19
+ Docusaurus Version: <code>{siteMetadata.docusaurusVersion}</code>
20
+ </div>
21
+ <div>
22
+ Site Version:{' '}
23
+ <code>{siteMetadata.siteVersion ?? 'No version specified'}</code>
24
+ </div>
25
+ <h3 className={styles.sectionTitle}>Plugins and themes</h3>
26
+ <ul className="clean-list">
27
+ {Object.entries(siteMetadata.pluginVersions).map(
28
+ ([name, versionInformation]) => (
29
+ <li key={name} className={styles.listItem}>
30
+ {versionInformation.type === 'package' &&
31
+ versionInformation.version && (
32
+ <div className={styles.version}>
33
+ <code>{versionInformation.version}</code>
34
+ </div>
35
+ )}
36
+ <div className={styles.name}>{name}</div>
37
+ <div>Type: {versionInformation.type}</div>
38
+ </li>
39
+ ),
40
+ )}
41
+ </ul>
42
+ </DebugLayout>
43
+ );
44
+ }
@@ -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
+ }