@docusaurus/plugin-content-docs 2.0.0-beta.12faed89d → 2.0.0-beta.13
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 +0 -3
- package/lib/client/docsClientUtils.js +19 -22
- package/lib/docFrontMatter.d.ts +1 -1
- package/lib/docFrontMatter.js +7 -3
- package/lib/docs.d.ts +25 -3
- package/lib/docs.js +125 -41
- package/lib/globalData.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +100 -131
- package/lib/lastUpdate.js +8 -9
- 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 +48 -11
- package/lib/props.d.ts +7 -2
- package/lib/props.js +60 -8
- 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 +21 -21
- package/lib/translations.d.ts +2 -2
- package/lib/translations.js +71 -29
- package/lib/types.d.ts +52 -63
- package/lib/versions.d.ts +3 -3
- package/lib/versions.js +41 -22
- package/package.json +20 -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 +745 -97
- package/src/__tests__/__snapshots__/translations.test.ts.snap +45 -15
- package/src/__tests__/cli.test.ts +15 -11
- package/src/__tests__/docFrontMatter.test.ts +160 -45
- package/src/__tests__/docs.test.ts +311 -150
- package/src/__tests__/index.test.ts +108 -66
- package/src/__tests__/lastUpdate.test.ts +1 -1
- package/src/__tests__/options.test.ts +48 -3
- package/src/__tests__/props.test.ts +62 -0
- package/src/__tests__/slug.test.ts +127 -20
- package/src/__tests__/translations.test.ts +7 -1
- package/src/__tests__/versions.test.ts +73 -70
- package/src/categoryGeneratedIndex.ts +57 -0
- package/src/cli.ts +8 -41
- package/src/client/docsClientUtils.ts +14 -26
- package/{types.d.ts → src/deps.d.ts} +0 -0
- package/src/docFrontMatter.ts +9 -4
- package/src/docs.ts +158 -32
- package/src/globalData.ts +6 -1
- package/src/index.ts +125 -169
- package/src/lastUpdate.ts +10 -13
- package/src/markdown/index.ts +8 -12
- package/src/numberPrefix.ts +5 -3
- package/src/options.ts +59 -14
- package/src/plugin-content-docs.d.ts +173 -40
- package/src/props.ts +90 -15
- 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/translations.ts +103 -47
- package/src/types.ts +64 -107
- package/src/versions.ts +59 -25
- package/lib/sidebarItemsGenerator.js +0 -211
- package/lib/sidebars.d.ts +0 -43
- package/lib/sidebars.js +0 -320
- package/src/__tests__/sidebars.test.ts +0 -639
- package/src/sidebarItemsGenerator.ts +0 -307
- package/src/sidebars.ts +0 -522
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
|
]);
|
|
@@ -153,7 +152,7 @@ function getVersionEditUrls({ contentPath, contentPathLocalized, context: { site
|
|
|
153
152
|
function getDefaultVersionBanner({ versionName, versionNames, lastVersionName, }) {
|
|
154
153
|
// Current version: good, no banner
|
|
155
154
|
if (versionName === lastVersionName) {
|
|
156
|
-
return
|
|
155
|
+
return null;
|
|
157
156
|
}
|
|
158
157
|
// Upcoming versions: unreleased banner
|
|
159
158
|
else if (versionNames.indexOf(versionName) < versionNames.indexOf(lastVersionName)) {
|
|
@@ -166,20 +165,34 @@ function getDefaultVersionBanner({ versionName, versionNames, lastVersionName, }
|
|
|
166
165
|
}
|
|
167
166
|
function getVersionBanner({ versionName, versionNames, lastVersionName, options, }) {
|
|
168
167
|
var _a;
|
|
169
|
-
const
|
|
170
|
-
|
|
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({
|
|
171
173
|
versionName,
|
|
172
174
|
versionNames,
|
|
173
175
|
lastVersionName,
|
|
174
|
-
})
|
|
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;
|
|
175
192
|
}
|
|
176
193
|
function createVersionMetadata({ versionName, versionNames, lastVersionName, context, options, }) {
|
|
177
194
|
var _a, _b, _c;
|
|
178
|
-
const { sidebarFilePath, contentPath, contentPathLocalized
|
|
179
|
-
versionName,
|
|
180
|
-
context,
|
|
181
|
-
options,
|
|
182
|
-
});
|
|
195
|
+
const { sidebarFilePath, contentPath, contentPathLocalized } = getVersionMetadataPaths({ versionName, context, options });
|
|
183
196
|
const isLast = versionName === lastVersionName;
|
|
184
197
|
// retro-compatible values
|
|
185
198
|
const defaultVersionLabel = versionName === constants_1.CURRENT_VERSION_NAME ? 'Next' : versionName;
|
|
@@ -193,7 +206,7 @@ function createVersionMetadata({ versionName, versionNames, lastVersionName, con
|
|
|
193
206
|
const versionOptions = (_a = options.versions[versionName]) !== null && _a !== void 0 ? _a : {};
|
|
194
207
|
const versionLabel = (_b = versionOptions.label) !== null && _b !== void 0 ? _b : defaultVersionLabel;
|
|
195
208
|
const versionPathPart = (_c = versionOptions.path) !== null && _c !== void 0 ? _c : defaultVersionPathPart;
|
|
196
|
-
const versionPath = utils_1.normalizeUrl([
|
|
209
|
+
const versionPath = (0, utils_1.normalizeUrl)([
|
|
197
210
|
context.baseUrl,
|
|
198
211
|
options.routeBasePath,
|
|
199
212
|
versionPathPart,
|
|
@@ -206,10 +219,14 @@ function createVersionMetadata({ versionName, versionNames, lastVersionName, con
|
|
|
206
219
|
});
|
|
207
220
|
// Because /docs/:route` should always be after `/docs/versionName/:route`.
|
|
208
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]);
|
|
209
225
|
return {
|
|
210
226
|
versionName,
|
|
211
227
|
versionLabel,
|
|
212
228
|
versionPath,
|
|
229
|
+
tagsPath,
|
|
213
230
|
versionEditUrl: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrl,
|
|
214
231
|
versionEditUrlLocalized: versionEditUrls === null || versionEditUrls === void 0 ? void 0 : versionEditUrls.versionEditUrlLocalized,
|
|
215
232
|
versionBanner: getVersionBanner({
|
|
@@ -218,6 +235,8 @@ function createVersionMetadata({ versionName, versionNames, lastVersionName, con
|
|
|
218
235
|
lastVersionName,
|
|
219
236
|
options,
|
|
220
237
|
}),
|
|
238
|
+
versionBadge: getVersionBadge({ versionName, versionNames, options }),
|
|
239
|
+
versionClassName: getVersionClassName({ versionName, options }),
|
|
221
240
|
isLast,
|
|
222
241
|
routePriority,
|
|
223
242
|
sidebarFilePath,
|
|
@@ -263,7 +282,7 @@ function checkVersionsOptions(availableVersionNames, options) {
|
|
|
263
282
|
!availableVersionNames.includes(options.lastVersion)) {
|
|
264
283
|
throw new Error(`Docs option lastVersion=${options.lastVersion} is invalid. ${availableVersionNamesMsg}`);
|
|
265
284
|
}
|
|
266
|
-
const unknownVersionConfigNames = lodash_1.difference(Object.keys(options.versions), availableVersionNames);
|
|
285
|
+
const unknownVersionConfigNames = (0, lodash_1.difference)(Object.keys(options.versions), availableVersionNames);
|
|
267
286
|
if (unknownVersionConfigNames.length > 0) {
|
|
268
287
|
throw new Error(`Invalid docs option "versions": unknown versions (${unknownVersionConfigNames.join(',')}) found. ${availableVersionNamesMsg}`);
|
|
269
288
|
}
|
|
@@ -271,7 +290,7 @@ function checkVersionsOptions(availableVersionNames, options) {
|
|
|
271
290
|
if (options.onlyIncludeVersions.length === 0) {
|
|
272
291
|
throw new Error(`Invalid docs option "onlyIncludeVersions": an empty array is not allowed, at least one version is needed.`);
|
|
273
292
|
}
|
|
274
|
-
const unknownOnlyIncludeVersionNames = lodash_1.difference(options.onlyIncludeVersions, availableVersionNames);
|
|
293
|
+
const unknownOnlyIncludeVersionNames = (0, lodash_1.difference)(options.onlyIncludeVersions, availableVersionNames);
|
|
275
294
|
if (unknownOnlyIncludeVersionNames.length > 0) {
|
|
276
295
|
throw new Error(`Invalid docs option "onlyIncludeVersions": unknown versions (${unknownOnlyIncludeVersionNames.join(',')}) found. ${availableVersionNamesMsg}`);
|
|
277
296
|
}
|
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.13",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-docs.d.ts",
|
|
@@ -17,41 +17,41 @@
|
|
|
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.12faed89d",
|
|
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/core": "2.0.0-beta.
|
|
29
|
-
"@docusaurus/mdx-loader": "2.0.0-beta.
|
|
30
|
-
"@docusaurus/
|
|
31
|
-
"@docusaurus/utils": "2.0.0-beta.
|
|
32
|
-
"
|
|
33
|
-
"chalk": "^4.1.1",
|
|
21
|
+
"@docusaurus/core": "2.0.0-beta.13",
|
|
22
|
+
"@docusaurus/mdx-loader": "2.0.0-beta.13",
|
|
23
|
+
"@docusaurus/utils": "2.0.0-beta.13",
|
|
24
|
+
"@docusaurus/utils-validation": "2.0.0-beta.13",
|
|
25
|
+
"chalk": "^4.1.2",
|
|
34
26
|
"combine-promises": "^1.1.0",
|
|
35
27
|
"escape-string-regexp": "^4.0.0",
|
|
36
|
-
"execa": "^5.0.0",
|
|
37
28
|
"fs-extra": "^10.0.0",
|
|
38
29
|
"globby": "^11.0.2",
|
|
39
30
|
"import-fresh": "^3.2.2",
|
|
40
31
|
"js-yaml": "^4.0.0",
|
|
41
|
-
"loader-utils": "^
|
|
32
|
+
"loader-utils": "^2.0.0",
|
|
42
33
|
"lodash": "^4.17.20",
|
|
43
34
|
"remark-admonitions": "^1.2.1",
|
|
44
35
|
"shelljs": "^0.8.4",
|
|
45
|
-
"tslib": "^2.
|
|
36
|
+
"tslib": "^2.3.1",
|
|
46
37
|
"utility-types": "^3.10.0",
|
|
47
|
-
"webpack": "^5.
|
|
38
|
+
"webpack": "^5.61.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@docusaurus/module-type-aliases": "2.0.0-beta.13",
|
|
42
|
+
"@docusaurus/types": "2.0.0-beta.13",
|
|
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"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^16.8.4 || ^17.0.0",
|
|
51
51
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": ">=
|
|
54
|
+
"node": ">=14"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "b6ca12aedf10a10c2375f4f8b7e7380cfd7c7202"
|
|
57
57
|
}
|
|
@@ -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
|
`;
|