@docusaurus/plugin-debug 3.2.1 → 3.3.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.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -21
- package/lib/theme/DebugContent/index.d.ts +1 -0
- package/lib/theme/DebugJsonView/index.d.ts +1 -0
- package/package.json +5 -5
- package/src/index.ts +4 -30
package/lib/index.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { LoadContext, Plugin } from '@docusaurus/types';
|
|
8
|
-
export default function pluginDebug({ siteConfig: { baseUrl },
|
|
8
|
+
export default function pluginDebug({ siteConfig: { baseUrl }, }: LoadContext): Plugin<undefined>;
|
package/lib/index.js
CHANGED
|
@@ -6,12 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const tslib_1 = require("tslib");
|
|
10
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
11
9
|
const utils_1 = require("@docusaurus/utils");
|
|
12
|
-
function pluginDebug({ siteConfig: { baseUrl },
|
|
13
|
-
const pluginDataDirRoot = path_1.default.join(generatedFilesDir, 'docusaurus-plugin-debug');
|
|
14
|
-
const aliasedSource = (source) => `~debug/${(0, utils_1.posixPath)(path_1.default.relative(pluginDataDirRoot, source))}`;
|
|
10
|
+
function pluginDebug({ siteConfig: { baseUrl }, }) {
|
|
15
11
|
return {
|
|
16
12
|
name: 'docusaurus-plugin-debug',
|
|
17
13
|
getThemePath() {
|
|
@@ -20,11 +16,7 @@ function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }) {
|
|
|
20
16
|
getTypeScriptThemePath() {
|
|
21
17
|
return '../src/theme';
|
|
22
18
|
},
|
|
23
|
-
async allContentLoaded({ actions: {
|
|
24
|
-
const allContentPath = await createData(
|
|
25
|
-
// Note that this created data path must be in sync with
|
|
26
|
-
// metadataPath provided to mdx-loader.
|
|
27
|
-
`${(0, utils_1.docuHash)('docusaurus-debug-allContent')}.json`, JSON.stringify(allContent, null, 2));
|
|
19
|
+
async allContentLoaded({ actions: { addRoute }, allContent }) {
|
|
28
20
|
// Home is config (duplicate for now)
|
|
29
21
|
addRoute({
|
|
30
22
|
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug']),
|
|
@@ -55,8 +47,8 @@ function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }) {
|
|
|
55
47
|
path: (0, utils_1.normalizeUrl)([baseUrl, '__docusaurus/debug/content']),
|
|
56
48
|
component: '@theme/DebugContent',
|
|
57
49
|
exact: true,
|
|
58
|
-
|
|
59
|
-
allContent
|
|
50
|
+
props: {
|
|
51
|
+
allContent,
|
|
60
52
|
},
|
|
61
53
|
});
|
|
62
54
|
addRoute({
|
|
@@ -65,15 +57,6 @@ function pluginDebug({ siteConfig: { baseUrl }, generatedFilesDir, }) {
|
|
|
65
57
|
exact: true,
|
|
66
58
|
});
|
|
67
59
|
},
|
|
68
|
-
configureWebpack() {
|
|
69
|
-
return {
|
|
70
|
-
resolve: {
|
|
71
|
-
alias: {
|
|
72
|
-
'~debug': pluginDataDirRoot,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
60
|
};
|
|
78
61
|
}
|
|
79
62
|
exports.default = pluginDebug;
|
|
@@ -4,6 +4,7 @@
|
|
|
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
|
+
/// <reference path="../../../src/plugin-debug.d.ts" />
|
|
7
8
|
/// <reference types="react" />
|
|
8
9
|
import type { Props } from '@theme/DebugContent';
|
|
9
10
|
export default function DebugContent({ allContent }: Props): JSX.Element;
|
|
@@ -4,6 +4,7 @@
|
|
|
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
|
+
/// <reference path="../../../src/plugin-debug.d.ts" />
|
|
7
8
|
/// <reference types="react" />
|
|
8
9
|
import type { Props } from '@theme/DebugJsonView';
|
|
9
10
|
export default function DebugJsonView({ src, collapseDepth, }: Props): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-debug",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "Debug plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-debug.d.ts",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "3.
|
|
24
|
-
"@docusaurus/types": "3.
|
|
25
|
-
"@docusaurus/utils": "3.
|
|
23
|
+
"@docusaurus/core": "3.3.0",
|
|
24
|
+
"@docusaurus/types": "3.3.0",
|
|
25
|
+
"@docusaurus/utils": "3.3.0",
|
|
26
26
|
"fs-extra": "^11.1.1",
|
|
27
27
|
"react-json-view-lite": "^1.2.0",
|
|
28
28
|
"tslib": "^2.6.0"
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=18.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "2ec4e078b5ca0c57f2cc04f2fe564d524bb5e858"
|
|
38
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,21 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import {docuHash, normalizeUrl, posixPath} from '@docusaurus/utils';
|
|
8
|
+
import {normalizeUrl} from '@docusaurus/utils';
|
|
10
9
|
import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
11
10
|
|
|
12
11
|
export default function pluginDebug({
|
|
13
12
|
siteConfig: {baseUrl},
|
|
14
|
-
generatedFilesDir,
|
|
15
13
|
}: LoadContext): Plugin<undefined> {
|
|
16
|
-
const pluginDataDirRoot = path.join(
|
|
17
|
-
generatedFilesDir,
|
|
18
|
-
'docusaurus-plugin-debug',
|
|
19
|
-
);
|
|
20
|
-
const aliasedSource = (source: string) =>
|
|
21
|
-
`~debug/${posixPath(path.relative(pluginDataDirRoot, source))}`;
|
|
22
|
-
|
|
23
14
|
return {
|
|
24
15
|
name: 'docusaurus-plugin-debug',
|
|
25
16
|
|
|
@@ -30,14 +21,7 @@ export default function pluginDebug({
|
|
|
30
21
|
return '../src/theme';
|
|
31
22
|
},
|
|
32
23
|
|
|
33
|
-
async allContentLoaded({actions: {
|
|
34
|
-
const allContentPath = await createData(
|
|
35
|
-
// Note that this created data path must be in sync with
|
|
36
|
-
// metadataPath provided to mdx-loader.
|
|
37
|
-
`${docuHash('docusaurus-debug-allContent')}.json`,
|
|
38
|
-
JSON.stringify(allContent, null, 2),
|
|
39
|
-
);
|
|
40
|
-
|
|
24
|
+
async allContentLoaded({actions: {addRoute}, allContent}) {
|
|
41
25
|
// Home is config (duplicate for now)
|
|
42
26
|
addRoute({
|
|
43
27
|
path: normalizeUrl([baseUrl, '__docusaurus/debug']),
|
|
@@ -73,8 +57,8 @@ export default function pluginDebug({
|
|
|
73
57
|
path: normalizeUrl([baseUrl, '__docusaurus/debug/content']),
|
|
74
58
|
component: '@theme/DebugContent',
|
|
75
59
|
exact: true,
|
|
76
|
-
|
|
77
|
-
allContent
|
|
60
|
+
props: {
|
|
61
|
+
allContent,
|
|
78
62
|
},
|
|
79
63
|
});
|
|
80
64
|
|
|
@@ -84,15 +68,5 @@ export default function pluginDebug({
|
|
|
84
68
|
exact: true,
|
|
85
69
|
});
|
|
86
70
|
},
|
|
87
|
-
|
|
88
|
-
configureWebpack() {
|
|
89
|
-
return {
|
|
90
|
-
resolve: {
|
|
91
|
-
alias: {
|
|
92
|
-
'~debug': pluginDataDirRoot,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
71
|
};
|
|
98
72
|
}
|