From cacdd45d59a1e9926f89aab3e49d5de899163c6c Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 01:44:29 +0800 Subject: [PATCH 01/24] Add json styling to config debug --- .../docusaurus-plugin-debug/src/theme/DebugConfig/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js index 99a4191bc8ea..1cad51d4a0e5 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js @@ -8,6 +8,8 @@ import React from 'react'; import DebugLayout from '../DebugLayout'; +import DebugJsonView from '../DebugJsonView'; + import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; function DebugMetadata() { @@ -15,7 +17,7 @@ function DebugMetadata() { return (

Site config

-
{JSON.stringify(siteConfig, null, 2)}
+
); } From 26302d70cdeb3183e0de48ec9e34e2aa3ab54b6a Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 01:45:01 +0800 Subject: [PATCH 02/24] Style debug content page --- .../src/theme/DebugContent/index.js | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js index c79f7899c4ed..f3f85745ff5a 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js @@ -5,35 +5,24 @@ * LICENSE file in the root directory of this source tree. */ -import React, {useState} from 'react'; +import React from 'react'; import DebugLayout from '../DebugLayout'; import DebugJsonView from '../DebugJsonView'; const PluginInstanceContent = ({pluginId, pluginInstanceContent}) => (
-

{`>> ${pluginId}`}

-
- -
+ {pluginId} +
); const PluginContent = ({pluginName, pluginContent}) => { - const [visible, setVisible] = useState(true); return (
-

setVisible((v) => !v)} style={{cursor: 'pointer'}}> +

{pluginName}

- {visible && (
{Object.entries(pluginContent) // filter plugin instances with no content @@ -50,7 +39,6 @@ const PluginContent = ({pluginName, pluginContent}) => { ); })}
- )}
); }; From 4144cb4e170681c3a0ac67e1d51b107d2f9094e2 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 01:45:39 +0800 Subject: [PATCH 03/24] Add style and collapse depth to json viewer --- .../src/theme/DebugJsonView/index.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js index 558b31c71c50..c8be0319ccae 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js @@ -8,6 +8,7 @@ import React from 'react'; import BrowserOnly from '@docusaurus/BrowserOnly'; +// import styles from './styles.module.css' // avoids "react-json-view" to display "root" const RootName = false; @@ -25,17 +26,28 @@ const BrowserOnlyReactJson = (props) => { ); }; -function DebugJsonView({src}) { +function DebugJsonView({src, collapseDepth}) { return ( { // By default, we collapse the json for performance reasons // See https://github.com/mac-s-g/react-json-view/issues/235 - // only the "root" is not collapsed - return field.name !== RootName; + // Non-root elements that are larger than 50 fields are collapsed + return field.name !== RootName && Object.keys(field.src).length > 50; }} + collapsed={collapseDepth} + groupArraysAfterLength="5" + enableClipboard={false} + displayDataTypes={false} /> ); } From dd99e4241ed5a45e1b0d8b78bd14f8fe5ec88a1b Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 01:45:53 +0800 Subject: [PATCH 04/24] Add style to debug layout --- .../src/theme/DebugLayout/index.js | 10 ++-- .../src/theme/DebugLayout/styles.module.css | 56 +++++++++++++++++++ 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js index 02c2eb7f869b..68fd81fda95e 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js @@ -7,14 +7,12 @@ import React from 'react'; import Link from '@docusaurus/Link'; -// import styles from './styles.module.css'; +import styles from './styles.module.css'; const DebugNavLink = ({to, children}) => ( {children} @@ -24,14 +22,14 @@ const DebugNavLink = ({to, children}) => ( function DebugLayout({children}) { return (
-
); } diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css index b5c0e33b4a5b..10827c9c3b44 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css @@ -4,3 +4,59 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ + +.container { + padding: 20px; + padding-top: 80px; +} + + .nav { + position: fixed; + display: flex; + justify-content: space-evenly; + align-items: center; + height: 3.75rem; + background-color: #242526; + width: 100%; + } + + .navlink { + color: white; + font-weight: 500; + text-align: center; + border-radius: 4px; + padding: 6px 16px; + } + + .navlink:hover { + text-decoration: none; + background-color: #292a2b; + } + + .active { + background-color: #363739; + } + + @media screen and (min-width: 800px) { + .nav { + flex-direction: column; + justify-content: flex-start; + align-items: center; + height: 100vh; + width: 200px; + float: left; + border-right: 1px solid #606770; + } + + .navlink { + width: 80%; + margin-top: 20px; + text-align: left; + } + + .container { + padding-top: 40px; + float: right; + width: calc(100% - 200px); + } +} \ No newline at end of file From e95703d70dda7f1016146272a3b77629f9ab09d8 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 01:46:16 +0800 Subject: [PATCH 05/24] Add style to metadata debug --- .../src/theme/DebugMetadata/index.js | 19 ++++++++------- .../src/theme/DebugMetadata/styles.module.css | 24 +++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js index 9cb98a2e1e73..d1cf2e55b599 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js @@ -9,26 +9,29 @@ import React from 'react'; import DebugLayout from '../DebugLayout'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import styles from './styles.module.css'; function DebugMetadata() { const {siteMetadata} = useDocusaurusContext(); return (

Site Metadata

-
Docusaurus Version: {siteMetadata.docusaurusVersion}
+
Docusaurus Version: {siteMetadata.docusaurusVersion}
- Site Version: {siteMetadata.siteVersion || 'No version specified'} + Site Version: {siteMetadata.siteVersion || 'No version specified'}
-

Plugins and themes:

-
    +

    Plugins and themes

    +
      {Object.entries(siteMetadata.pluginVersions).map( ([name, versionInformation]) => ( -
    • -
      Name: {name}
      -
      Type: {versionInformation.type}
      +
    • {versionInformation.version && ( -
      Version: {versionInformation.version}
      +
      + {versionInformation.version} +
      )} +
      {name}
      +
      Type: {versionInformation.type}
    • ), )} diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css index 99ba01cb7753..2ecbc4e324bf 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css @@ -5,3 +5,27 @@ * LICENSE file in the root directory of this source tree. */ +.sectionTitle { + margin-top: 20px; +} + +.list { + padding: 0; +} + +.listItem { + list-style: none; + background-color: #242526; + padding: 10px; + border-radius: 4px; + margin-bottom: 20px; +} + +.version { + float: right; +} + +.name { + font-weight: 800; + color: #e06b6b; +} \ No newline at end of file From 681089b879011996060a1a0eb8a514d1e2e43cc1 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 01:47:08 +0800 Subject: [PATCH 06/24] Add style support to registry debugger --- .../src/theme/DebugRegistry/index.js | 6 +++--- .../src/theme/DebugRegistry/styles.module.css | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js index f10a53a8a6f2..45966db5d50d 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js @@ -9,15 +9,15 @@ import React from 'react'; import DebugLayout from '../DebugLayout'; import registry from '@generated/registry'; +import styles from './styles.module.css'; function DebugRegistry() { return ( - {' '}

      Registry

      -
        +
          {Object.values(registry).map(([, aliasedPath, resolved]) => ( -
        • +
        • Aliased Path: {aliasedPath}
          Resolved Path: {resolved}
        • diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css index 99ba01cb7753..776aace21d82 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css @@ -5,3 +5,14 @@ * LICENSE file in the root directory of this source tree. */ +.list { + padding: 0; +} + +.listItem { + list-style: none; + background-color: #242526; + padding: 10px; + border-radius: 4px; + margin-bottom: 20px; +} \ No newline at end of file From 9865f921ca6c8f190f6a3166abf8a3c4e3eaed53 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:04:52 +0800 Subject: [PATCH 07/24] Remove default content if other instances are present --- .../docusaurus-plugin-debug/src/theme/DebugContent/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js index f3f85745ff5a..6bafa9c3a5ed 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js @@ -27,7 +27,9 @@ const PluginContent = ({pluginName, pluginContent}) => { {Object.entries(pluginContent) // filter plugin instances with no content .filter( - ([_pluginId, pluginInstanceContent]) => !!pluginInstanceContent, + ([pluginId, pluginInstanceContent], _index, instances) => + !!pluginInstanceContent + && instances.length > 1 ? pluginId !== 'default' : true ) .map(([pluginId, pluginInstanceContent]) => { return ( From 5d1687292bc7074d2ca04a41b7bab1d913de861f Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:05:17 +0800 Subject: [PATCH 08/24] Change colors for more contrast --- .../docusaurus-plugin-debug/src/theme/DebugJsonView/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js index c8be0319ccae..19c9e1202b5e 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js @@ -34,7 +34,7 @@ function DebugJsonView({src, collapseDepth}) { marginTop: '10px', padding: '10px', borderRadius: '4px', - backgroundColor: '#242526' + backgroundColor: '#292a2b', }} name={RootName} theme="paraiso" From 68ed1bc668cf84639a0f1b8fae8376f4fcbe73d7 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:05:41 +0800 Subject: [PATCH 09/24] Add debug routes styles --- .../src/theme/DebugRoutes/index.js | 11 +++++++---- .../src/theme/DebugRoutes/styles.module.css | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js index 5eedd036f41a..507e0e8678c3 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js @@ -9,16 +9,19 @@ import React from 'react'; import DebugLayout from '../DebugLayout'; import routes from '@generated/routes'; +import styles from './styles.module.css'; function DebugRoutes() { return (

          Routes

          -
            +
              {routes.map(({path, exact}) => ( -
            • -
              Route: {path}
              -
              Is exact: {String(Boolean(exact))}
              +
            • +
              + {path} +
              +
              Is exact: {String(Boolean(exact))}
            • ))}
            diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css index 99ba01cb7753..f4765fa2584c 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css @@ -5,3 +5,22 @@ * LICENSE file in the root directory of this source tree. */ + .list { + padding: 0; +} + +.listItem { + list-style: none; + background-color: #242526; + padding: 10px; + border-radius: 4px; + margin-bottom: 20px; +} + +.route { + margin-bottom: 10px; +} + +.routeName { + color: #e06b6b; +} \ No newline at end of file From d1bfe1cf8c2d5133730252fb05fd52d1039bac3a Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:05:55 +0800 Subject: [PATCH 10/24] Add active link style --- .../docusaurus-plugin-debug/src/theme/DebugLayout/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js index 68fd81fda95e..47ebedbfdce9 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js @@ -14,7 +14,10 @@ const DebugNavLink = ({to, children}) => ( className={styles.navlink} isNavLink to={to} - exact> + exact + activeStyle={{ + backgroundColor: '#363739' + }}> {children} ); From fae01ffd198eba09395db287b32826c29a960a00 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:06:18 +0800 Subject: [PATCH 11/24] Fix container css issues --- .../src/theme/DebugLayout/styles.module.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css index 10827c9c3b44..8b9e7c99132e 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css @@ -8,6 +8,7 @@ .container { padding: 20px; padding-top: 80px; + overflow-x: hidden; } .nav { @@ -18,6 +19,7 @@ height: 3.75rem; background-color: #242526; width: 100%; + z-index: 1; } .navlink { @@ -25,7 +27,7 @@ font-weight: 500; text-align: center; border-radius: 4px; - padding: 6px 16px; + padding: 6px 6px; } .navlink:hover { @@ -45,7 +47,9 @@ height: 100vh; width: 200px; float: left; + background-color: #18191a; border-right: 1px solid #606770; + padding-top: 20px; } .navlink { From 025db33ef62149b5cfd6f74085a42108f66476fb Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:06:32 +0800 Subject: [PATCH 12/24] Style registry debug page --- .../docusaurus-plugin-debug/src/theme/DebugRegistry/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js index 45966db5d50d..c83c21c9eb10 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js @@ -18,8 +18,8 @@ function DebugRegistry() {
              {Object.values(registry).map(([, aliasedPath, resolved]) => (
            • -
              Aliased Path: {aliasedPath}
              -
              Resolved Path: {resolved}
              +
              Aliased Path: {aliasedPath}
              +
              Resolved Path: {resolved}
            • ))}
            From 7f90587979f4e367d1b54cdf92b42d3de5c9fe2b Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:19:09 +0800 Subject: [PATCH 13/24] Remove unused style modules --- .../src/theme/DebugConfig/styles.module.css | 7 ------- .../src/theme/DebugContent/styles.module.css | 7 ------- .../src/theme/DebugJsonView/index.js | 1 - .../src/theme/DebugJsonView/styles.module.css | 7 ------- 4 files changed, 22 deletions(-) delete mode 100644 packages/docusaurus-plugin-debug/src/theme/DebugConfig/styles.module.css delete mode 100644 packages/docusaurus-plugin-debug/src/theme/DebugContent/styles.module.css delete mode 100644 packages/docusaurus-plugin-debug/src/theme/DebugJsonView/styles.module.css diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugConfig/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugConfig/styles.module.css deleted file mode 100644 index 99ba01cb7753..000000000000 --- a/packages/docusaurus-plugin-debug/src/theme/DebugConfig/styles.module.css +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugContent/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugContent/styles.module.css deleted file mode 100644 index 99ba01cb7753..000000000000 --- a/packages/docusaurus-plugin-debug/src/theme/DebugContent/styles.module.css +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js index 19c9e1202b5e..f8ec854d97cc 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/index.js @@ -8,7 +8,6 @@ import React from 'react'; import BrowserOnly from '@docusaurus/BrowserOnly'; -// import styles from './styles.module.css' // avoids "react-json-view" to display "root" const RootName = false; diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/styles.module.css deleted file mode 100644 index 99ba01cb7753..000000000000 --- a/packages/docusaurus-plugin-debug/src/theme/DebugJsonView/styles.module.css +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - From 8f93b43bc1d0f9cec26628058317c3c069de6e97 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:20:08 +0800 Subject: [PATCH 14/24] Add white space to style files --- .../src/theme/DebugLayout/styles.module.css | 2 +- .../src/theme/DebugMetadata/styles.module.css | 2 +- .../src/theme/DebugRegistry/styles.module.css | 2 +- .../src/theme/DebugRoutes/styles.module.css | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css index 8b9e7c99132e..3c0ff64f2d6e 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css @@ -63,4 +63,4 @@ float: right; width: calc(100% - 200px); } -} \ No newline at end of file +} diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css index 2ecbc4e324bf..37f3e666f6a2 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css @@ -28,4 +28,4 @@ .name { font-weight: 800; color: #e06b6b; -} \ No newline at end of file +} diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css index 776aace21d82..590719949918 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/styles.module.css @@ -15,4 +15,4 @@ padding: 10px; border-radius: 4px; margin-bottom: 20px; -} \ No newline at end of file +} diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css index f4765fa2584c..2c0ff2f03883 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/styles.module.css @@ -23,4 +23,4 @@ .routeName { color: #e06b6b; -} \ No newline at end of file +} From ba9af399d38e8a30d2f0554cb7a618650700cae2 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 16:32:38 +0800 Subject: [PATCH 15/24] Add font scaling --- .../src/theme/DebugLayout/styles.module.css | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css index 3c0ff64f2d6e..767c4e016de1 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css @@ -25,6 +25,7 @@ .navlink { color: white; font-weight: 500; + font-size: clamp(12px, 4vw, 16px); text-align: center; border-radius: 4px; padding: 6px 6px; From d30e092f3c2d358f577d1815fc95bd36f37350bc Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 17:04:57 +0800 Subject: [PATCH 16/24] Fix prettier errors --- .../src/theme/DebugConfig/index.js | 2 +- .../src/theme/DebugContent/index.js | 42 +++++++++---------- .../src/theme/DebugLayout/index.js | 2 +- .../src/theme/DebugMetadata/index.js | 7 +++- .../src/theme/DebugRegistry/index.js | 8 +++- .../src/theme/DebugRoutes/index.js | 4 +- 6 files changed, 36 insertions(+), 29 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js index 1cad51d4a0e5..83ec1e386f8a 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugConfig/index.js @@ -17,7 +17,7 @@ function DebugMetadata() { return (

            Site config

            - +
            ); } diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js index 6bafa9c3a5ed..6d48b66af2c7 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js @@ -13,34 +13,32 @@ import DebugJsonView from '../DebugJsonView'; const PluginInstanceContent = ({pluginId, pluginInstanceContent}) => (
            {pluginId} - +
            ); const PluginContent = ({pluginName, pluginContent}) => { return (
            -

            - {pluginName} -

            -
            - {Object.entries(pluginContent) - // filter plugin instances with no content - .filter( - ([pluginId, pluginInstanceContent], _index, instances) => - !!pluginInstanceContent - && instances.length > 1 ? pluginId !== 'default' : true - ) - .map(([pluginId, pluginInstanceContent]) => { - return ( - - ); - })} -
            +

            {pluginName}

            +
            + {Object.entries(pluginContent) + // filter plugin instances with no content + .filter(([pluginId, pluginInstanceContent], _index, instances) => + !!pluginInstanceContent && instances.length > 1 + ? pluginId !== 'default' + : true, + ) + .map(([pluginId, pluginInstanceContent]) => { + return ( + + ); + })} +
            ); }; diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js index 47ebedbfdce9..25a601bfb097 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js @@ -16,7 +16,7 @@ const DebugNavLink = ({to, children}) => ( to={to} exact activeStyle={{ - backgroundColor: '#363739' + backgroundColor: '#363739', }}> {children} diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js index d1cf2e55b599..c78e03a1472e 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js @@ -16,9 +16,12 @@ function DebugMetadata() { return (

            Site Metadata

            -
            Docusaurus Version: {siteMetadata.docusaurusVersion}
            - Site Version: {siteMetadata.siteVersion || 'No version specified'} + Docusaurus Version: {siteMetadata.docusaurusVersion} +
            +
            + Site Version:{' '} + {siteMetadata.siteVersion || 'No version specified'}

            Plugins and themes

              diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js index c83c21c9eb10..5df4c763fc58 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRegistry/index.js @@ -18,8 +18,12 @@ function DebugRegistry() {
                {Object.values(registry).map(([, aliasedPath, resolved]) => (
              • -
                Aliased Path: {aliasedPath}
                -
                Resolved Path: {resolved}
                +
                + Aliased Path: {aliasedPath} +
                +
                + Resolved Path: {resolved} +
              • ))}
              diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js index 507e0e8678c3..27325d2e3c3f 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js @@ -21,7 +21,9 @@ function DebugRoutes() {
              {path}
              -
              Is exact: {String(Boolean(exact))}
              +
              + Is exact: {String(Boolean(exact))} +
              ))}
            From 0add1cc8ce6e1de602de7d8fc840b699a2643b2f Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 20:59:47 +0800 Subject: [PATCH 17/24] Add child routes to route debug --- .../src/theme/DebugRoutes/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js index 27325d2e3c3f..22de4175fa07 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugRoutes/index.js @@ -8,6 +8,7 @@ import React from 'react'; import DebugLayout from '../DebugLayout'; +import DebugJsonView from '../DebugJsonView'; import routes from '@generated/routes'; import styles from './styles.module.css'; @@ -16,7 +17,7 @@ function DebugRoutes() {

            Routes

              - {routes.map(({path, exact}) => ( + {routes.map(({path, exact, routes: childRoutes}) => (
            • {path} @@ -24,6 +25,11 @@ function DebugRoutes() {
              Is exact: {String(Boolean(exact))}
              + {childRoutes && +
              Child Routes: + +
              + }
            • ))}
            From 2b660aa5c6e1f8eb45c38ddb64aa6c6b2a57400d Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 21:00:07 +0800 Subject: [PATCH 18/24] Readd default content plugin json --- .../docusaurus-plugin-debug/src/theme/DebugContent/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js index 6d48b66af2c7..c2646fdc0fef 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugContent/index.js @@ -24,10 +24,8 @@ const PluginContent = ({pluginName, pluginContent}) => {
            {Object.entries(pluginContent) // filter plugin instances with no content - .filter(([pluginId, pluginInstanceContent], _index, instances) => - !!pluginInstanceContent && instances.length > 1 - ? pluginId !== 'default' - : true, + .filter(([_pluginId, pluginInstanceContent]) => + !!pluginInstanceContent, ) .map(([pluginId, pluginInstanceContent]) => { return ( From 9c43c9f7fbf1c51a228a495dcc081e1ad383e51d Mon Sep 17 00:00:00 2001 From: Drewbi Date: Mon, 17 Aug 2020 21:00:22 +0800 Subject: [PATCH 19/24] Add empty home page to debug --- packages/docusaurus-plugin-debug/src/index.ts | 2 +- .../src/theme/DebugHome/index.js | 27 +++++++++++++++++++ .../src/theme/DebugHome/styles.module.css | 6 +++++ .../src/theme/DebugLayout/index.js | 3 ++- 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js create mode 100644 packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css diff --git a/packages/docusaurus-plugin-debug/src/index.ts b/packages/docusaurus-plugin-debug/src/index.ts index 1ca9d6f0e1af..896f08698ab4 100644 --- a/packages/docusaurus-plugin-debug/src/index.ts +++ b/packages/docusaurus-plugin-debug/src/index.ts @@ -38,7 +38,7 @@ export default function pluginContentPages({ // Home is config (duplicate for now) addRoute({ path: normalizeUrl([baseUrl, '__docusaurus/debug']), - component: '@theme/DebugConfig', + component: '@theme/DebugHome', exact: true, }); diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js new file mode 100644 index 000000000000..f6cf99e3c2c3 --- /dev/null +++ b/packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js @@ -0,0 +1,27 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React from 'react'; + +import DebugLayout from '../DebugLayout'; + +// import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; + +function DebugMetadata() { + return ( + +

            Docusaurus Debug

            +
            Config:
            +
            Metadata:
            +
            Registry:
            +
            Route:
            +
            Content:
            +
            + ); +} + +export default DebugMetadata; diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css new file mode 100644 index 000000000000..c1c552714e35 --- /dev/null +++ b/packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css @@ -0,0 +1,6 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ \ No newline at end of file diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js index 25a601bfb097..4e6c9700664a 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js @@ -26,7 +26,8 @@ function DebugLayout({children}) { return (
          From 78359c3eb40988a92affdea30cf07540b7c27ab5 Mon Sep 17 00:00:00 2001 From: Drewbi Date: Tue, 18 Aug 2020 12:11:17 +0800 Subject: [PATCH 21/24] Revert "Add empty home page to debug" This should be included in a separate PR This reverts commit 9c43c9f7fbf1c51a228a495dcc081e1ad383e51d. --- packages/docusaurus-plugin-debug/src/index.ts | 2 +- .../src/theme/DebugHome/index.js | 27 ------------------- .../src/theme/DebugHome/styles.module.css | 6 ----- .../src/theme/DebugLayout/index.js | 3 +-- 4 files changed, 2 insertions(+), 36 deletions(-) delete mode 100644 packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js delete mode 100644 packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css diff --git a/packages/docusaurus-plugin-debug/src/index.ts b/packages/docusaurus-plugin-debug/src/index.ts index 896f08698ab4..1ca9d6f0e1af 100644 --- a/packages/docusaurus-plugin-debug/src/index.ts +++ b/packages/docusaurus-plugin-debug/src/index.ts @@ -38,7 +38,7 @@ export default function pluginContentPages({ // Home is config (duplicate for now) addRoute({ path: normalizeUrl([baseUrl, '__docusaurus/debug']), - component: '@theme/DebugHome', + component: '@theme/DebugConfig', exact: true, }); diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js deleted file mode 100644 index f6cf99e3c2c3..000000000000 --- a/packages/docusaurus-plugin-debug/src/theme/DebugHome/index.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import React from 'react'; - -import DebugLayout from '../DebugLayout'; - -// import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; - -function DebugMetadata() { - return ( - -

          Docusaurus Debug

          -
          Config:
          -
          Metadata:
          -
          Registry:
          -
          Route:
          -
          Content:
          -
          - ); -} - -export default DebugMetadata; diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css deleted file mode 100644 index c1c552714e35..000000000000 --- a/packages/docusaurus-plugin-debug/src/theme/DebugHome/styles.module.css +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ \ No newline at end of file diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js index 4e6c9700664a..25a601bfb097 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/index.js @@ -26,8 +26,7 @@ function DebugLayout({children}) { return (
          {children}
          diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css index fd2fddabe233..cd076b67a13d 100644 --- a/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css +++ b/packages/docusaurus-plugin-debug/src/theme/DebugLayout/styles.module.css @@ -11,43 +11,44 @@ overflow-x: hidden; background-color: #18191a; color: white; + min-height: 100vh; } - .nav { - position: fixed; - display: flex; - justify-content: space-evenly; - align-items: center; - height: 3.75rem; - background-color: #242526; - width: 100%; - z-index: 1; - } +.nav { + position: fixed; + display: flex; + justify-content: space-evenly; + align-items: center; + height: 3.75rem; + background-color: #242526; + width: 100%; + z-index: 1; +} - .navlink { - color: white; - font-weight: 500; - font-size: clamp(12px, 4vw, 16px); - text-align: center; - border-radius: 4px; - padding: 6px 6px; - } - - .navlink:hover { - text-decoration: none; - background-color: #292a2b; - } +.navlink { + color: white; + font-weight: 500; + font-size: clamp(12px, 4vw, 16px); + text-align: center; + border-radius: 4px; + padding: 6px 6px; +} - code { +.navlink:hover { + text-decoration: none; + background-color: #292a2b; +} + +code { color: white; background-color: #444950; - } +} - .active { - background-color: #363739; - } +.active { + background-color: #363739; +} - @media screen and (min-width: 800px) { +@media screen and (min-width: 800px) { .nav { flex-direction: column; justify-content: flex-start; @@ -61,7 +62,7 @@ } .navlink { - width: 80%; + width: 80%; margin-top: 20px; text-align: left; } diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js b/packages/docusaurus-plugin-debug/src/theme/DebugSiteMetadata/index.js similarity index 100% rename from packages/docusaurus-plugin-debug/src/theme/DebugMetadata/index.js rename to packages/docusaurus-plugin-debug/src/theme/DebugSiteMetadata/index.js diff --git a/packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css b/packages/docusaurus-plugin-debug/src/theme/DebugSiteMetadata/styles.module.css similarity index 100% rename from packages/docusaurus-plugin-debug/src/theme/DebugMetadata/styles.module.css rename to packages/docusaurus-plugin-debug/src/theme/DebugSiteMetadata/styles.module.css diff --git a/website/docs/presets.md b/website/docs/presets.md index 23e9129bd4f4..80531f71f2b1 100644 --- a/website/docs/presets.md +++ b/website/docs/presets.md @@ -80,6 +80,7 @@ The classic preset that is usually shipped by default to new docusaurus website. | `@docusaurus/theme-classic` | `@docusaurus/plugin-content-docs` | | `@docusaurus/theme-search-algolia` | `@docusaurus/plugin-content-blog` | | | `@docusaurus/plugin-content-pages` | +| | `@docusaurus/plugin-debug` | | | `@docusaurus/plugin-google-analytics` | | | `@docusaurus/plugin-google-gtag` | | | `@docusaurus/plugin-sitemap` | @@ -92,17 +93,19 @@ module.exports = { [ '@docusaurus/preset-classic', { + // Debug defaults to true in dev, false in prod + debug: undefined, // Will be passed to @docusaurus/theme-classic. theme: { customCss: require.resolve('./src/css/custom.css'), }, - // Will be passed to @docusaurus/plugin-content-docs + // Will be passed to @docusaurus/plugin-content-docs (false to disable) docs: {}, - // Will be passed to @docusaurus/plugin-content-blog + // Will be passed to @docusaurus/plugin-content-blog (false to disable) blog: {}, - // Will be passed to @docusaurus/plugin-content-pages + // Will be passed to @docusaurus/plugin-content-pages (false to disable) pages: {}, - // Will be passed to @docusaurus/plugin-content-sitemap + // Will be passed to @docusaurus/plugin-content-sitemap (false to disable) sitemap: {}, }, ], @@ -134,12 +137,12 @@ module.exports = { The classic preset that is usually shipped by default to new docusaurus website. It is a set of plugins and themes. -| Themes | Plugins | -| ---------------------------------- | ------------------------------------- | -| `@docusaurus/theme-bootstrap` | `@docusaurus/plugin-content-docs` | -| | `@docusaurus/plugin-content-blog` | -| | `@docusaurus/plugin-content-pages` | - +| Themes | Plugins | +| ----------------------------- | ---------------------------------- | +| `@docusaurus/theme-bootstrap` | `@docusaurus/plugin-content-docs` | +| | `@docusaurus/plugin-content-blog` | +| | `@docusaurus/plugin-content-pages` | +| | `@docusaurus/plugin-debug` | To specify plugin options individually, you can provide the necessary fields to certain plugins, i.e. `docs` for `@docusaurus/theme-bootstrap`, pass them in the preset field, like this: @@ -149,15 +152,18 @@ module.exports = { [ '@docusaurus/preset-bootstrap', { - // Will be passed to @docusaurus/plugin-content-docs + // Debug defaults to true in dev, false in prod + debug: undefined, + // Will be passed to @docusaurus/plugin-content-docs (false to disable) docs: {}, - // Will be passed to @docusaurus/plugin-content-blog + // Will be passed to @docusaurus/plugin-content-blog (false to disable) blog: {}, }, ], ], }; ``` + :::caution This preset is work in progress diff --git a/website/docs/using-plugins.md b/website/docs/using-plugins.md index d01a9992782c..8cd4d83e9fd9 100644 --- a/website/docs/using-plugins.md +++ b/website/docs/using-plugins.md @@ -966,3 +966,29 @@ The module should have a `default` function export, and receives some params. Adds an entry before the Docusaurus app so that registration can happen before the app runs. The default `registerSW.js` file is enough for simple registration. Passing `false` will disable registration entirely. + +### `@docusaurus/plugin-debug` + +Will display useful debug informations at [http://localhost:3000/\_\_docusaurus/debug](http://localhost:3000/__docusaurus/debug). + +It is mostly useful for plugin authors, that will be able to inspect more easily the content of the `.docusaurus` folder (like the creates routes), but also be able to inspect data structures that are never written to disk, like the plugin data loaded through the `contentLoaded` lifecycle. + +**Installation** + +```bash npm2yarn +npm install --save @docusaurus/plugin-debug +``` + +:::tip + +If you have installed `@docusaurus/preset-classic`, you don't need to install it as a dependency. You can also configure it through the [classic preset options](presets.md#docusauruspreset-classic) instead of doing it like below. + +By default, it's enabled in dev, and disabled in prod, to avoid exposing potentially sensitive informations. + +::: + +```js title="docusaurus.config.js" +module.exports = { + plugins: ['@docusaurus/plugin-debug'], +}; +``` From 4aafb18d9c4f3493dd8aa2544cd66b9b7d9d685e Mon Sep 17 00:00:00 2001 From: slorber Date: Wed, 2 Sep 2020 15:23:07 +0200 Subject: [PATCH 24/24] more debug plugin doc --- website/docs/using-plugins.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/website/docs/using-plugins.md b/website/docs/using-plugins.md index 8cd4d83e9fd9..560f7e64fbe4 100644 --- a/website/docs/using-plugins.md +++ b/website/docs/using-plugins.md @@ -969,10 +969,18 @@ Passing `false` will disable registration entirely. ### `@docusaurus/plugin-debug` -Will display useful debug informations at [http://localhost:3000/\_\_docusaurus/debug](http://localhost:3000/__docusaurus/debug). +The debug plugin will display useful debug informations at [http://localhost:3000/\_\_docusaurus/debug](http://localhost:3000/__docusaurus/debug). It is mostly useful for plugin authors, that will be able to inspect more easily the content of the `.docusaurus` folder (like the creates routes), but also be able to inspect data structures that are never written to disk, like the plugin data loaded through the `contentLoaded` lifecycle. +:::note + +If you report a bug, we will probably ask you to have this plugin turned on in the production, so that we can inspect your deployment config more easily. + +If you don't have any sensitive information, you can keep it on in production [like we do](http://v2.docusaurus.io/__docusaurus/debug). + +::: + **Installation** ```bash npm2yarn