@docusaurus/plugin-content-docs 2.0.0-beta.0e652730d → 2.0.0-beta.10
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/.tsbuildinfo +1 -1
- package/lib/categoryGeneratedIndex.d.ts +12 -0
- package/lib/categoryGeneratedIndex.js +37 -0
- package/lib/cli.d.ts +2 -2
- package/lib/cli.js +12 -34
- package/lib/client/docsClientUtils.d.ts +1 -4
- package/lib/client/docsClientUtils.js +21 -31
- package/lib/docFrontMatter.d.ts +1 -1
- package/lib/docFrontMatter.js +10 -6
- package/lib/docs.d.ts +25 -3
- package/lib/docs.js +125 -38
- package/lib/globalData.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +104 -138
- package/lib/lastUpdate.js +9 -10
- package/lib/markdown/index.d.ts +3 -6
- package/lib/markdown/index.js +3 -3
- package/lib/markdown/linkify.js +2 -2
- package/lib/numberPrefix.d.ts +1 -1
- package/lib/options.d.ts +3 -3
- package/lib/options.js +49 -17
- package/lib/props.d.ts +7 -2
- package/lib/props.js +61 -9
- package/lib/routes.d.ts +27 -0
- package/lib/routes.js +105 -0
- package/lib/{sidebarItemsGenerator.d.ts → sidebars/generator.d.ts} +5 -2
- package/lib/sidebars/generator.js +216 -0
- package/lib/sidebars/index.d.ts +15 -0
- package/lib/sidebars/index.js +73 -0
- package/lib/sidebars/normalization.d.ts +14 -0
- package/lib/sidebars/normalization.js +77 -0
- package/lib/sidebars/processor.d.ts +18 -0
- package/lib/sidebars/processor.js +85 -0
- package/lib/sidebars/types.d.ts +127 -0
- package/lib/sidebars/types.js +8 -0
- package/lib/sidebars/utils.d.ts +35 -0
- package/lib/sidebars/utils.js +228 -0
- package/lib/sidebars/validation.d.ts +10 -0
- package/lib/sidebars/validation.js +138 -0
- package/lib/slug.d.ts +4 -3
- package/lib/slug.js +27 -15
- package/lib/tags.d.ts +8 -0
- package/lib/tags.js +20 -0
- package/lib/theme/hooks/useDocs.js +24 -21
- package/lib/translations.d.ts +2 -2
- package/lib/translations.js +71 -29
- package/lib/types.d.ts +52 -62
- package/lib/versions.d.ts +3 -3
- package/lib/versions.js +76 -24
- package/package.json +22 -20
- package/src/__tests__/__fixtures__/simple-site/docs/_partials/somePartial.md +3 -0
- package/src/__tests__/__fixtures__/simple-site/docs/_partials/subfolder/somePartial.md +3 -0
- package/src/__tests__/__fixtures__/simple-site/docs/_somePartial.md +3 -0
- package/src/__tests__/__fixtures__/simple-site/docs/foo/baz.md +5 -0
- package/src/__tests__/__fixtures__/simple-site/docs/hello.md +2 -0
- package/src/__tests__/__fixtures__/simple-site/docs/rootAbsoluteSlug.md +2 -0
- package/src/__tests__/__fixtures__/simple-site/docs/rootRelativeSlug.md +2 -0
- package/src/__tests__/__fixtures__/simple-site/docs/rootResolvedSlug.md +2 -0
- package/src/__tests__/__fixtures__/simple-site/docs/rootTryToEscapeSlug.md +2 -0
- package/src/__tests__/__fixtures__/simple-site/sidebars.json +15 -1
- package/src/__tests__/__fixtures__/site-with-doc-label/docs/hello-1.md +1 -0
- package/src/__tests__/__fixtures__/versioned-site/docs/foo/bar.md +6 -0
- package/src/__tests__/__fixtures__/versioned-site/docs/hello.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/i18n/en/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/i18n/fr/docusaurus-plugin-content-docs/version-1.0.0/hello.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.0/hello.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/somePartial.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_partials/subfolder/somePartial.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/_somePartial.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/versioned_docs/version-1.0.1/hello.md +3 -0
- package/src/__tests__/__fixtures__/versioned-site/versioned_sidebars/version-1.0.1-sidebars.json +2 -2
- package/src/__tests__/__snapshots__/cli.test.ts.snap +48 -73
- package/src/__tests__/__snapshots__/docs.test.ts.snap +140 -0
- package/src/__tests__/__snapshots__/index.test.ts.snap +753 -112
- package/src/__tests__/__snapshots__/translations.test.ts.snap +45 -18
- package/src/__tests__/cli.test.ts +15 -11
- package/src/__tests__/docFrontMatter.test.ts +195 -40
- package/src/__tests__/docs.test.ts +311 -150
- package/src/__tests__/index.test.ts +112 -69
- package/src/__tests__/lastUpdate.test.ts +3 -2
- package/src/__tests__/options.test.ts +48 -4
- package/src/__tests__/props.test.ts +62 -0
- package/src/__tests__/slug.test.ts +127 -20
- package/src/__tests__/translations.test.ts +7 -2
- package/src/__tests__/versions.test.ts +93 -67
- package/src/categoryGeneratedIndex.ts +57 -0
- package/src/cli.ts +8 -41
- package/src/client/__tests__/docsClientUtils.test.ts +4 -5
- package/src/client/docsClientUtils.ts +19 -41
- package/{types.d.ts → src/deps.d.ts} +0 -0
- package/src/docFrontMatter.ts +13 -7
- package/src/docs.ts +158 -29
- package/src/globalData.ts +6 -1
- package/src/index.ts +134 -179
- package/src/lastUpdate.ts +10 -9
- package/src/markdown/index.ts +8 -12
- package/src/numberPrefix.ts +5 -3
- package/src/options.ts +59 -28
- package/src/plugin-content-docs.d.ts +179 -35
- package/src/props.ts +91 -16
- package/src/routes.ts +173 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-shorthand.js +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-items.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category-wrong-label.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-category.js +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed-first-level.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-collapsed.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-doc-id-not-string.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-first-level-not-category.js +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-href.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link-wrong-label.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-link.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-unknown-type.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars-wrong-field.json +0 -0
- package/src/{__tests__ → sidebars/__tests__}/__fixtures__/sidebars/sidebars.json +0 -0
- package/src/{__tests__/__snapshots__/sidebars.test.ts.snap → sidebars/__tests__/__snapshots__/index.test.ts.snap} +36 -6
- package/src/{__tests__/sidebarItemsGenerator.test.ts → sidebars/__tests__/generator.test.ts} +143 -18
- package/src/sidebars/__tests__/index.test.ts +204 -0
- package/src/sidebars/__tests__/processor.test.ts +237 -0
- package/src/sidebars/__tests__/utils.test.ts +695 -0
- package/src/sidebars/__tests__/validation.test.ts +105 -0
- package/src/sidebars/generator.ts +310 -0
- package/src/sidebars/index.ts +94 -0
- package/src/sidebars/normalization.ts +112 -0
- package/src/sidebars/processor.ts +154 -0
- package/src/sidebars/types.ts +211 -0
- package/src/sidebars/utils.ts +329 -0
- package/src/sidebars/validation.ts +168 -0
- package/src/slug.ts +32 -17
- package/src/tags.ts +19 -0
- package/src/theme/hooks/useDocs.ts +5 -1
- package/src/translations.ts +103 -47
- package/src/types.ts +67 -105
- package/src/versions.ts +117 -21
- package/lib/sidebarItemsGenerator.js +0 -211
- package/lib/sidebars.d.ts +0 -43
- package/lib/sidebars.js +0 -319
- package/src/__tests__/sidebars.test.ts +0 -639
- package/src/sidebarItemsGenerator.ts +0 -307
- package/src/sidebars.ts +0 -506
package/lib/versions.js
CHANGED
|
@@ -8,16 +8,15 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.getDocsDirPaths = exports.readVersionsMetadata = exports.getVersionsFilePath = exports.getVersionedSidebarsDirPath = exports.getVersionedDocsDirPath = void 0;
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
11
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
12
|
+
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
13
13
|
const constants_1 = require("./constants");
|
|
14
|
-
const constants_2 = require("@docusaurus/core/lib/constants");
|
|
15
14
|
const utils_1 = require("@docusaurus/utils");
|
|
16
15
|
const lodash_1 = require("lodash");
|
|
17
16
|
const sidebars_1 = require("./sidebars");
|
|
18
17
|
// retro-compatibility: no prefix for the default plugin id
|
|
19
18
|
function addPluginIdPrefix(fileOrDir, pluginId) {
|
|
20
|
-
if (pluginId ===
|
|
19
|
+
if (pluginId === utils_1.DEFAULT_PLUGIN_ID) {
|
|
21
20
|
return fileOrDir;
|
|
22
21
|
}
|
|
23
22
|
else {
|
|
@@ -83,7 +82,7 @@ function readVersionNames(siteDir, options) {
|
|
|
83
82
|
return versions;
|
|
84
83
|
}
|
|
85
84
|
function getDocsDirPathLocalized({ siteDir, locale, pluginId, versionName, }) {
|
|
86
|
-
return utils_1.getPluginI18nPath({
|
|
85
|
+
return (0, utils_1.getPluginI18nPath)({
|
|
87
86
|
siteDir,
|
|
88
87
|
locale,
|
|
89
88
|
pluginName: 'docusaurus-plugin-content-docs',
|
|
@@ -108,7 +107,7 @@ function getVersionMetadataPaths({ versionName, context, options, }) {
|
|
|
108
107
|
});
|
|
109
108
|
function getSidebarFilePath() {
|
|
110
109
|
if (isCurrentVersion) {
|
|
111
|
-
return sidebars_1.resolveSidebarPathOption(context.siteDir, options.sidebarPath);
|
|
110
|
+
return (0, sidebars_1.resolveSidebarPathOption)(context.siteDir, options.sidebarPath);
|
|
112
111
|
}
|
|
113
112
|
else {
|
|
114
113
|
return path_1.default.join(getVersionedSidebarsDirPath(context.siteDir, options.id), `version-${versionName}-sidebars.json`);
|
|
@@ -138,10 +137,10 @@ function getVersionEditUrls({ contentPath, contentPathLocalized, context: { site
|
|
|
138
137
|
pluginId: id,
|
|
139
138
|
})
|
|
140
139
|
: contentPathLocalized;
|
|
141
|
-
const versionPathSegment = utils_1.posixPath(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPath)));
|
|
142
|
-
const versionPathSegmentLocalized = utils_1.posixPath(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPathLocalized)));
|
|
143
|
-
const versionEditUrl = utils_1.normalizeUrl([editUrl, versionPathSegment]);
|
|
144
|
-
const versionEditUrlLocalized = utils_1.normalizeUrl([
|
|
140
|
+
const versionPathSegment = (0, utils_1.posixPath)(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPath)));
|
|
141
|
+
const versionPathSegmentLocalized = (0, utils_1.posixPath)(path_1.default.relative(siteDir, path_1.default.resolve(siteDir, editDirPathLocalized)));
|
|
142
|
+
const versionEditUrl = (0, utils_1.normalizeUrl)([editUrl, versionPathSegment]);
|
|
143
|
+
const versionEditUrlLocalized = (0, utils_1.normalizeUrl)([
|
|
145
144
|
editUrl,
|
|
146
145
|
versionPathSegmentLocalized,
|
|
147
146
|
]);
|
|
@@ -150,24 +149,64 @@ function getVersionEditUrls({ contentPath, contentPathLocalized, context: { site
|
|
|
150
149
|
versionEditUrlLocalized,
|
|
151
150
|
};
|
|
152
151
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
function getDefaultVersionBanner({ versionName, versionNames, lastVersionName, }) {
|
|
153
|
+
// Current version: good, no banner
|
|
154
|
+
if (versionName === lastVersionName) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
// Upcoming versions: unreleased banner
|
|
158
|
+
else if (versionNames.indexOf(versionName) < versionNames.indexOf(lastVersionName)) {
|
|
159
|
+
return 'unreleased';
|
|
160
|
+
}
|
|
161
|
+
// Older versions: display unmaintained banner
|
|
162
|
+
else {
|
|
163
|
+
return 'unmaintained';
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function getVersionBanner({ versionName, versionNames, lastVersionName, options, }) {
|
|
167
|
+
var _a;
|
|
168
|
+
const versionBannerOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.banner;
|
|
169
|
+
if (versionBannerOption) {
|
|
170
|
+
return versionBannerOption === 'none' ? null : versionBannerOption;
|
|
171
|
+
}
|
|
172
|
+
return getDefaultVersionBanner({
|
|
156
173
|
versionName,
|
|
157
|
-
|
|
158
|
-
|
|
174
|
+
versionNames,
|
|
175
|
+
lastVersionName,
|
|
159
176
|
});
|
|
177
|
+
}
|
|
178
|
+
function getVersionBadge({ versionName, versionNames, options, }) {
|
|
179
|
+
var _a;
|
|
180
|
+
const versionBadgeOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.badge;
|
|
181
|
+
// If site is not versioned or only one version is included
|
|
182
|
+
// we don't show the version badge by default
|
|
183
|
+
// See https://github.com/facebook/docusaurus/issues/3362
|
|
184
|
+
const versionBadgeDefault = versionNames.length !== 1;
|
|
185
|
+
return versionBadgeOption !== null && versionBadgeOption !== void 0 ? versionBadgeOption : versionBadgeDefault;
|
|
186
|
+
}
|
|
187
|
+
function getVersionClassName({ versionName, options, }) {
|
|
188
|
+
var _a;
|
|
189
|
+
const versionClassNameOption = (_a = options.versions[versionName]) === null || _a === void 0 ? void 0 : _a.className;
|
|
190
|
+
const versionClassNameDefault = `docs-version-${versionName}`;
|
|
191
|
+
return versionClassNameOption !== null && versionClassNameOption !== void 0 ? versionClassNameOption : versionClassNameDefault;
|
|
192
|
+
}
|
|
193
|
+
function createVersionMetadata({ versionName, versionNames, lastVersionName, context, options, }) {
|
|
194
|
+
var _a, _b, _c;
|
|
195
|
+
const { sidebarFilePath, contentPath, contentPathLocalized } = getVersionMetadataPaths({ versionName, context, options });
|
|
196
|
+
const isLast = versionName === lastVersionName;
|
|
160
197
|
// retro-compatible values
|
|
161
198
|
const defaultVersionLabel = versionName === constants_1.CURRENT_VERSION_NAME ? 'Next' : versionName;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
199
|
+
function getDefaultVersionPathPart() {
|
|
200
|
+
if (isLast) {
|
|
201
|
+
return '';
|
|
202
|
+
}
|
|
203
|
+
return versionName === constants_1.CURRENT_VERSION_NAME ? 'next' : versionName;
|
|
204
|
+
}
|
|
205
|
+
const defaultVersionPathPart = getDefaultVersionPathPart();
|
|
167
206
|
const versionOptions = (_a = options.versions[versionName]) !== null && _a !== void 0 ? _a : {};
|
|
168
207
|
const versionLabel = (_b = versionOptions.label) !== null && _b !== void 0 ? _b : defaultVersionLabel;
|
|
169
208
|
const versionPathPart = (_c = versionOptions.path) !== null && _c !== void 0 ? _c : defaultVersionPathPart;
|
|
170
|
-
const versionPath = utils_1.normalizeUrl([
|
|
209
|
+
const versionPath = (0, utils_1.normalizeUrl)([
|
|
171
210
|
context.baseUrl,
|
|
172
211
|
options.routeBasePath,
|
|
173
212
|
versionPathPart,
|
|
@@ -180,12 +219,24 @@ function createVersionMetadata({ versionName, isLast, context, options, }) {
|
|
|
180
219
|
});
|
|
181
220
|
// Because /docs/:route` should always be after `/docs/versionName/:route`.
|
|
182
221
|
const routePriority = versionPathPart === '' ? -1 : undefined;
|
|
222
|
+
// the path that will be used to refer the docs tags
|
|
223
|
+
// example below will be using /docs/tags
|
|
224
|
+
const tagsPath = (0, utils_1.normalizeUrl)([versionPath, options.tagsBasePath]);
|
|
183
225
|
return {
|
|
184
226
|
versionName,
|
|
185
227
|
versionLabel,
|
|
186
228
|
versionPath,
|
|
229
|
+
tagsPath,
|
|
187
230
|
versionEditUrl: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrl,
|
|
188
231
|
versionEditUrlLocalized: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrlLocalized,
|
|
232
|
+
versionBanner: getVersionBanner({
|
|
233
|
+
versionName,
|
|
234
|
+
versionNames,
|
|
235
|
+
lastVersionName,
|
|
236
|
+
options,
|
|
237
|
+
}),
|
|
238
|
+
versionBadge: getVersionBadge({ versionName, versionNames, options }),
|
|
239
|
+
versionClassName: getVersionClassName({ versionName, options }),
|
|
189
240
|
isLast,
|
|
190
241
|
routePriority,
|
|
191
242
|
sidebarFilePath,
|
|
@@ -231,7 +282,7 @@ function checkVersionsOptions(availableVersionNames, options) {
|
|
|
231
282
|
!availableVersionNames.includes(options.lastVersion)) {
|
|
232
283
|
throw new Error(`Docs option lastVersion=${options.lastVersion} is invalid. ${availableVersionNamesMsg}`);
|
|
233
284
|
}
|
|
234
|
-
const unknownVersionConfigNames = lodash_1.difference(Object.keys(options.versions), availableVersionNames);
|
|
285
|
+
const unknownVersionConfigNames = (0, lodash_1.difference)(Object.keys(options.versions), availableVersionNames);
|
|
235
286
|
if (unknownVersionConfigNames.length > 0) {
|
|
236
287
|
throw new Error(`Invalid docs option "versions": unknown versions (${unknownVersionConfigNames.join(',')}) found. ${availableVersionNamesMsg}`);
|
|
237
288
|
}
|
|
@@ -239,7 +290,7 @@ function checkVersionsOptions(availableVersionNames, options) {
|
|
|
239
290
|
if (options.onlyIncludeVersions.length === 0) {
|
|
240
291
|
throw new Error(`Invalid docs option "onlyIncludeVersions": an empty array is not allowed, at least one version is needed.`);
|
|
241
292
|
}
|
|
242
|
-
const unknownOnlyIncludeVersionNames = lodash_1.difference(options.onlyIncludeVersions, availableVersionNames);
|
|
293
|
+
const unknownOnlyIncludeVersionNames = (0, lodash_1.difference)(options.onlyIncludeVersions, availableVersionNames);
|
|
243
294
|
if (unknownOnlyIncludeVersionNames.length > 0) {
|
|
244
295
|
throw new Error(`Invalid docs option "onlyIncludeVersions": unknown versions (${unknownOnlyIncludeVersionNames.join(',')}) found. ${availableVersionNamesMsg}`);
|
|
245
296
|
}
|
|
@@ -269,7 +320,8 @@ function readVersionsMetadata({ context, options, }) {
|
|
|
269
320
|
const lastVersionName = (_a = options.lastVersion) !== null && _a !== void 0 ? _a : getDefaultLastVersionName(versionNames);
|
|
270
321
|
const versionsMetadata = versionNames.map((versionName) => createVersionMetadata({
|
|
271
322
|
versionName,
|
|
272
|
-
|
|
323
|
+
versionNames,
|
|
324
|
+
lastVersionName,
|
|
273
325
|
context,
|
|
274
326
|
options,
|
|
275
327
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-docs",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.10",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-docs.d.ts",
|
|
@@ -17,40 +17,42 @@
|
|
|
17
17
|
"directory": "packages/docusaurus-plugin-content-docs"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@docusaurus/module-type-aliases": "2.0.0-beta.0e652730d",
|
|
22
|
-
"@types/js-yaml": "^4.0.0",
|
|
23
|
-
"@types/picomatch": "^2.2.1",
|
|
24
|
-
"commander": "^5.1.0",
|
|
25
|
-
"picomatch": "^2.1.1"
|
|
26
|
-
},
|
|
27
20
|
"dependencies": {
|
|
28
|
-
"@docusaurus/
|
|
29
|
-
"@docusaurus/
|
|
30
|
-
"@docusaurus/
|
|
31
|
-
"
|
|
32
|
-
"@docusaurus/utils-validation": "2.0.0-beta.0e652730d",
|
|
33
|
-
"chalk": "^4.1.1",
|
|
21
|
+
"@docusaurus/mdx-loader": "2.0.0-beta.10",
|
|
22
|
+
"@docusaurus/utils": "2.0.0-beta.10",
|
|
23
|
+
"@docusaurus/utils-validation": "2.0.0-beta.10",
|
|
24
|
+
"chalk": "^4.1.2",
|
|
34
25
|
"combine-promises": "^1.1.0",
|
|
35
|
-
"
|
|
26
|
+
"escape-string-regexp": "^4.0.0",
|
|
36
27
|
"fs-extra": "^10.0.0",
|
|
37
28
|
"globby": "^11.0.2",
|
|
38
29
|
"import-fresh": "^3.2.2",
|
|
39
30
|
"js-yaml": "^4.0.0",
|
|
40
|
-
"loader-utils": "^
|
|
31
|
+
"loader-utils": "^2.0.0",
|
|
41
32
|
"lodash": "^4.17.20",
|
|
42
33
|
"remark-admonitions": "^1.2.1",
|
|
43
34
|
"shelljs": "^0.8.4",
|
|
44
|
-
"tslib": "^2.
|
|
35
|
+
"tslib": "^2.3.1",
|
|
45
36
|
"utility-types": "^3.10.0",
|
|
46
|
-
"webpack": "^5.
|
|
37
|
+
"webpack": "^5.61.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@docusaurus/core": "2.0.0-beta.10",
|
|
41
|
+
"@docusaurus/module-type-aliases": "2.0.0-beta.10",
|
|
42
|
+
"@docusaurus/types": "2.0.0-beta.10",
|
|
43
|
+
"@types/js-yaml": "^4.0.0",
|
|
44
|
+
"@types/picomatch": "^2.2.1",
|
|
45
|
+
"commander": "^5.1.0",
|
|
46
|
+
"picomatch": "^2.1.1",
|
|
47
|
+
"utility-types": "^3.10.0"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
50
|
+
"@docusaurus/core": "2.0.0-beta.9",
|
|
49
51
|
"react": "^16.8.4 || ^17.0.0",
|
|
50
52
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
51
53
|
},
|
|
52
54
|
"engines": {
|
|
53
|
-
"node": ">=
|
|
55
|
+
"node": ">=14"
|
|
54
56
|
},
|
|
55
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "6f4869af5721435d6995e63e2f24ac41646e34ea"
|
|
56
58
|
}
|
|
@@ -4,7 +4,21 @@
|
|
|
4
4
|
{
|
|
5
5
|
"type": "category",
|
|
6
6
|
"label": "foo",
|
|
7
|
-
"items": ["foo/bar", "foo/baz"]
|
|
7
|
+
"items": ["foo/bar", "foo/baz"]
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"type": "category",
|
|
11
|
+
"label": "Slugs",
|
|
12
|
+
"items": [
|
|
13
|
+
"rootAbsoluteSlug",
|
|
14
|
+
"rootRelativeSlug",
|
|
15
|
+
"rootResolvedSlug",
|
|
16
|
+
"rootTryToEscapeSlug"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"type": "doc",
|
|
21
|
+
"id": "headingAsTitle"
|
|
8
22
|
},
|
|
9
23
|
{
|
|
10
24
|
"type": "link",
|
|
@@ -2,89 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`docsVersion first time versioning 1`] = `
|
|
4
4
|
Object {
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
"label": "Guides",
|
|
46
|
-
"type": "category",
|
|
47
|
-
},
|
|
48
|
-
],
|
|
5
|
+
"docs": Object {
|
|
6
|
+
"Guides": Array [
|
|
7
|
+
"hello",
|
|
8
|
+
],
|
|
9
|
+
"Test": Array [
|
|
10
|
+
Object {
|
|
11
|
+
"items": Array [
|
|
12
|
+
"foo/bar",
|
|
13
|
+
"foo/baz",
|
|
14
|
+
],
|
|
15
|
+
"label": "foo",
|
|
16
|
+
"type": "category",
|
|
17
|
+
},
|
|
18
|
+
Object {
|
|
19
|
+
"items": Array [
|
|
20
|
+
"rootAbsoluteSlug",
|
|
21
|
+
"rootRelativeSlug",
|
|
22
|
+
"rootResolvedSlug",
|
|
23
|
+
"rootTryToEscapeSlug",
|
|
24
|
+
],
|
|
25
|
+
"label": "Slugs",
|
|
26
|
+
"type": "category",
|
|
27
|
+
},
|
|
28
|
+
Object {
|
|
29
|
+
"id": "headingAsTitle",
|
|
30
|
+
"type": "doc",
|
|
31
|
+
},
|
|
32
|
+
Object {
|
|
33
|
+
"href": "https://github.com",
|
|
34
|
+
"label": "Github",
|
|
35
|
+
"type": "link",
|
|
36
|
+
},
|
|
37
|
+
Object {
|
|
38
|
+
"id": "hello",
|
|
39
|
+
"type": "ref",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
},
|
|
49
43
|
}
|
|
50
44
|
`;
|
|
51
45
|
|
|
52
46
|
exports[`docsVersion not the first time versioning 1`] = `
|
|
53
47
|
Object {
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
],
|
|
63
|
-
"label": "Test",
|
|
64
|
-
"type": "category",
|
|
65
|
-
},
|
|
66
|
-
Object {
|
|
67
|
-
"collapsed": true,
|
|
68
|
-
"items": Array [
|
|
69
|
-
Object {
|
|
70
|
-
"id": "version-2.0.0/hello",
|
|
71
|
-
"type": "doc",
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
"label": "Guides",
|
|
75
|
-
"type": "category",
|
|
76
|
-
},
|
|
77
|
-
],
|
|
48
|
+
"docs": Object {
|
|
49
|
+
"Guides": Array [
|
|
50
|
+
"hello",
|
|
51
|
+
],
|
|
52
|
+
"Test": Array [
|
|
53
|
+
"foo/bar",
|
|
54
|
+
],
|
|
55
|
+
},
|
|
78
56
|
}
|
|
79
57
|
`;
|
|
80
58
|
|
|
81
59
|
exports[`docsVersion second docs instance versioning 1`] = `
|
|
82
60
|
Object {
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
"id": "version-2.0.0/team",
|
|
86
|
-
"type": "doc",
|
|
87
|
-
},
|
|
61
|
+
"community": Array [
|
|
62
|
+
"team",
|
|
88
63
|
],
|
|
89
64
|
}
|
|
90
65
|
`;
|