@docusaurus/core 0.0.0-4798 → 0.0.0-4801
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/commands/build.d.ts +1 -1
- package/lib/commands/build.js +6 -3
- package/lib/commands/clear.d.ts +1 -1
- package/lib/commands/clear.js +2 -1
- package/lib/commands/commandUtils.js +2 -3
- package/lib/commands/deploy.d.ts +1 -1
- package/lib/commands/deploy.js +6 -4
- package/lib/commands/external.d.ts +1 -1
- package/lib/commands/external.js +5 -6
- package/lib/commands/serve.d.ts +1 -1
- package/lib/commands/serve.js +6 -5
- package/lib/commands/start.d.ts +1 -1
- package/lib/commands/start.js +4 -2
- package/lib/commands/swizzle/common.d.ts +1 -2
- package/lib/commands/swizzle/context.js +6 -10
- package/lib/commands/swizzle/index.d.ts +1 -1
- package/lib/commands/swizzle/index.js +2 -1
- package/lib/commands/writeHeadingIds.d.ts +1 -1
- package/lib/commands/writeHeadingIds.js +5 -8
- package/lib/commands/writeTranslations.d.ts +1 -1
- package/lib/commands/writeTranslations.js +6 -8
- package/lib/index.d.ts +9 -10
- package/lib/index.js +18 -19
- package/lib/server/choosePort.d.ts +12 -0
- package/lib/{choosePort.js → server/choosePort.js} +8 -10
- package/lib/server/{client-modules/index.d.ts → clientModules.d.ts} +5 -1
- package/lib/server/{client-modules/index.js → clientModules.js} +6 -1
- package/lib/server/config.d.ts +5 -2
- package/lib/server/config.js +11 -6
- package/lib/server/htmlTags.d.ts +12 -0
- package/lib/server/htmlTags.js +62 -0
- package/lib/server/i18n.d.ts +2 -11
- package/lib/server/i18n.js +1 -18
- package/lib/server/index.d.ts +26 -11
- package/lib/server/index.js +40 -201
- package/lib/server/plugins/configs.d.ts +14 -0
- package/lib/server/plugins/configs.js +101 -0
- package/lib/server/plugins/index.d.ts +6 -6
- package/lib/server/plugins/index.js +29 -64
- package/lib/server/plugins/init.d.ts +6 -19
- package/lib/server/plugins/init.js +14 -65
- package/lib/server/{moduleShorthand.d.ts → plugins/moduleShorthand.d.ts} +0 -0
- package/lib/server/{moduleShorthand.js → plugins/moduleShorthand.js} +0 -0
- package/lib/server/plugins/pluginIds.d.ts +4 -0
- package/lib/server/plugins/pluginIds.js +4 -2
- package/lib/server/plugins/presets.d.ts +12 -0
- package/lib/server/{presets/index.js → plugins/presets.js} +9 -4
- package/lib/server/plugins/{applyRouteTrailingSlash.d.ts → routeConfig.d.ts} +2 -1
- package/lib/server/plugins/routeConfig.js +53 -0
- package/lib/server/plugins/synthetic.d.ts +20 -0
- package/lib/server/plugins/synthetic.js +112 -0
- package/lib/server/routes.d.ts +3 -2
- package/lib/server/routes.js +50 -24
- package/lib/server/{versions/index.d.ts → siteMetadata.d.ts} +5 -2
- package/lib/server/{versions/index.js → siteMetadata.js} +36 -3
- package/lib/server/translations/translations.js +1 -4
- package/lib/webpack/aliases/index.d.ts +29 -0
- package/lib/webpack/aliases/index.js +106 -0
- package/lib/webpack/base.d.ts +0 -3
- package/lib/webpack/base.js +4 -21
- package/package.json +10 -11
- package/lib/choosePort.d.ts +0 -11
- package/lib/server/duplicateRoutes.d.ts +0 -8
- package/lib/server/duplicateRoutes.js +0 -42
- package/lib/server/html-tags/htmlTags.d.ts +0 -7
- package/lib/server/html-tags/htmlTags.js +0 -38
- package/lib/server/html-tags/index.d.ts +0 -8
- package/lib/server/html-tags/index.js +0 -42
- package/lib/server/plugins/applyRouteTrailingSlash.js +0 -19
- package/lib/server/presets/index.d.ts +0 -11
- package/lib/server/themes/alias.d.ts +0 -9
- package/lib/server/themes/alias.js +0 -50
- package/lib/server/themes/index.d.ts +0 -12
- package/lib/server/themes/index.js +0 -47
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the MIT license found in the
|
|
6
|
-
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.loadPluginsThemeAliases = exports.loadThemeAliases = void 0;
|
|
10
|
-
const tslib_1 = require("tslib");
|
|
11
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
-
const utils_1 = require("@docusaurus/utils");
|
|
13
|
-
const alias_1 = tslib_1.__importStar(require("./alias"));
|
|
14
|
-
const ThemeFallbackDir = path_1.default.join(__dirname, '../../client/theme-fallback');
|
|
15
|
-
async function loadThemeAliases(themePaths, userThemePaths) {
|
|
16
|
-
const aliases = {};
|
|
17
|
-
for (const themePath of themePaths) {
|
|
18
|
-
const themeAliases = await (0, alias_1.default)(themePath, true);
|
|
19
|
-
Object.entries(themeAliases).forEach(([aliasKey, alias]) => {
|
|
20
|
-
// If this alias shadows a previous one, use @theme-init to preserve the
|
|
21
|
-
// initial one. @theme-init is only applied once: to the initial theme
|
|
22
|
-
// that provided this component
|
|
23
|
-
if (aliasKey in aliases) {
|
|
24
|
-
const componentName = aliasKey.substring(aliasKey.indexOf('/') + 1);
|
|
25
|
-
const initAlias = `@theme-init/${componentName}`;
|
|
26
|
-
if (!(initAlias in aliases)) {
|
|
27
|
-
aliases[initAlias] = aliases[aliasKey];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
aliases[aliasKey] = alias;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
for (const themePath of userThemePaths) {
|
|
34
|
-
const userThemeAliases = await (0, alias_1.default)(themePath, false);
|
|
35
|
-
Object.assign(aliases, userThemeAliases);
|
|
36
|
-
}
|
|
37
|
-
return (0, alias_1.sortAliases)(aliases);
|
|
38
|
-
}
|
|
39
|
-
exports.loadThemeAliases = loadThemeAliases;
|
|
40
|
-
function loadPluginsThemeAliases({ siteDir, plugins, }) {
|
|
41
|
-
const pluginThemes = plugins
|
|
42
|
-
.map((plugin) => plugin.getThemePath && path_1.default.resolve(plugin.path, plugin.getThemePath()))
|
|
43
|
-
.filter((x) => Boolean(x));
|
|
44
|
-
const userTheme = path_1.default.resolve(siteDir, utils_1.THEME_PATH);
|
|
45
|
-
return loadThemeAliases([ThemeFallbackDir, ...pluginThemes], [userTheme]);
|
|
46
|
-
}
|
|
47
|
-
exports.loadPluginsThemeAliases = loadPluginsThemeAliases;
|