@docusaurus/plugin-content-docs 0.0.0-4786 → 0.0.0-4788
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/cli.js +2 -2
- package/lib/sidebars/generator.js +1 -1
- package/package.json +9 -9
- package/src/cli.ts +2 -2
- package/src/sidebars/generator.ts +2 -2
package/lib/cli.js
CHANGED
|
@@ -64,7 +64,7 @@ async function cliDocsVersionCommand(version, siteDir, pluginId, options) {
|
|
|
64
64
|
}
|
|
65
65
|
const { path: docsPath, sidebarPath } = options;
|
|
66
66
|
// Copy docs files.
|
|
67
|
-
const docsDir = path_1.default.
|
|
67
|
+
const docsDir = path_1.default.resolve(siteDir, docsPath);
|
|
68
68
|
if ((await fs_extra_1.default.pathExists(docsDir)) &&
|
|
69
69
|
(await fs_extra_1.default.readdir(docsDir)).length > 0) {
|
|
70
70
|
const versionedDir = (0, versions_1.getVersionedDocsDirPath)(siteDir, pluginId);
|
|
@@ -72,7 +72,7 @@ async function cliDocsVersionCommand(version, siteDir, pluginId, options) {
|
|
|
72
72
|
await fs_extra_1.default.copy(docsDir, newVersionDir);
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
-
throw new Error(`${pluginIdLogPrefix}:
|
|
75
|
+
throw new Error(`${pluginIdLogPrefix}: no docs found in ${docsDir}.`);
|
|
76
76
|
}
|
|
77
77
|
await createVersionedSidebarFile({
|
|
78
78
|
siteDir,
|
|
@@ -104,7 +104,7 @@ Available doc IDs:
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function createCategoryItem(dir, fullPath, folderName) {
|
|
107
|
-
const categoryMetadata = categoriesMetadata[
|
|
107
|
+
const categoryMetadata = categoriesMetadata[path_1.default.posix.join(autogenDir, fullPath)];
|
|
108
108
|
const allItems = Object.entries(dir).map(([key, content]) => dirToItem(content, key, `${fullPath}/${key}`));
|
|
109
109
|
// Try to match a doc inside the category folder,
|
|
110
110
|
// using the "local id" (myDoc) or "qualified id" (dirName/myDoc)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-docs",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4788",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@docusaurus/core": "0.0.0-
|
|
27
|
-
"@docusaurus/logger": "0.0.0-
|
|
28
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
29
|
-
"@docusaurus/utils": "0.0.0-
|
|
30
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
26
|
+
"@docusaurus/core": "0.0.0-4788",
|
|
27
|
+
"@docusaurus/logger": "0.0.0-4788",
|
|
28
|
+
"@docusaurus/mdx-loader": "0.0.0-4788",
|
|
29
|
+
"@docusaurus/utils": "0.0.0-4788",
|
|
30
|
+
"@docusaurus/utils-validation": "0.0.0-4788",
|
|
31
31
|
"combine-promises": "^1.1.0",
|
|
32
32
|
"fs-extra": "^10.0.1",
|
|
33
33
|
"import-fresh": "^3.3.0",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"webpack": "^5.70.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
43
|
-
"@docusaurus/types": "0.0.0-
|
|
42
|
+
"@docusaurus/module-type-aliases": "0.0.0-4788",
|
|
43
|
+
"@docusaurus/types": "0.0.0-4788",
|
|
44
44
|
"@types/js-yaml": "^4.0.5",
|
|
45
45
|
"@types/picomatch": "^2.3.0",
|
|
46
46
|
"commander": "^5.1.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=14"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "880b995e4b33e050d1e6cb2bcbe5058ee6fd8cbd"
|
|
60
60
|
}
|
package/src/cli.ts
CHANGED
|
@@ -117,7 +117,7 @@ export async function cliDocsVersionCommand(
|
|
|
117
117
|
const {path: docsPath, sidebarPath} = options;
|
|
118
118
|
|
|
119
119
|
// Copy docs files.
|
|
120
|
-
const docsDir = path.
|
|
120
|
+
const docsDir = path.resolve(siteDir, docsPath);
|
|
121
121
|
|
|
122
122
|
if (
|
|
123
123
|
(await fs.pathExists(docsDir)) &&
|
|
@@ -127,7 +127,7 @@ export async function cliDocsVersionCommand(
|
|
|
127
127
|
const newVersionDir = path.join(versionedDir, `version-${version}`);
|
|
128
128
|
await fs.copy(docsDir, newVersionDir);
|
|
129
129
|
} else {
|
|
130
|
-
throw new Error(`${pluginIdLogPrefix}:
|
|
130
|
+
throw new Error(`${pluginIdLogPrefix}: no docs found in ${docsDir}.`);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
await createVersionedSidebarFile({
|
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
SidebarItemCategoryLinkConfig,
|
|
15
15
|
} from './types';
|
|
16
16
|
import _ from 'lodash';
|
|
17
|
-
import {addTrailingSlash
|
|
17
|
+
import {addTrailingSlash} from '@docusaurus/utils';
|
|
18
18
|
import logger from '@docusaurus/logger';
|
|
19
19
|
import path from 'path';
|
|
20
20
|
import {createDocsByIdIndex, toCategoryIndexMatcherParam} from '../docs';
|
|
@@ -157,7 +157,7 @@ Available doc IDs:
|
|
|
157
157
|
folderName: string,
|
|
158
158
|
): WithPosition<NormalizedSidebarItemCategory> {
|
|
159
159
|
const categoryMetadata =
|
|
160
|
-
categoriesMetadata[
|
|
160
|
+
categoriesMetadata[path.posix.join(autogenDir, fullPath)];
|
|
161
161
|
const allItems = Object.entries(dir).map(([key, content]) =>
|
|
162
162
|
dirToItem(content, key, `${fullPath}/${key}`),
|
|
163
163
|
);
|