@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.
Files changed (74) hide show
  1. package/lib/commands/build.d.ts +1 -1
  2. package/lib/commands/build.js +6 -3
  3. package/lib/commands/clear.d.ts +1 -1
  4. package/lib/commands/clear.js +2 -1
  5. package/lib/commands/commandUtils.js +2 -3
  6. package/lib/commands/deploy.d.ts +1 -1
  7. package/lib/commands/deploy.js +6 -4
  8. package/lib/commands/external.d.ts +1 -1
  9. package/lib/commands/external.js +5 -6
  10. package/lib/commands/serve.d.ts +1 -1
  11. package/lib/commands/serve.js +6 -5
  12. package/lib/commands/start.d.ts +1 -1
  13. package/lib/commands/start.js +4 -2
  14. package/lib/commands/swizzle/common.d.ts +1 -2
  15. package/lib/commands/swizzle/context.js +6 -10
  16. package/lib/commands/swizzle/index.d.ts +1 -1
  17. package/lib/commands/swizzle/index.js +2 -1
  18. package/lib/commands/writeHeadingIds.d.ts +1 -1
  19. package/lib/commands/writeHeadingIds.js +5 -8
  20. package/lib/commands/writeTranslations.d.ts +1 -1
  21. package/lib/commands/writeTranslations.js +6 -8
  22. package/lib/index.d.ts +9 -10
  23. package/lib/index.js +18 -19
  24. package/lib/server/choosePort.d.ts +12 -0
  25. package/lib/{choosePort.js → server/choosePort.js} +8 -10
  26. package/lib/server/{client-modules/index.d.ts → clientModules.d.ts} +5 -1
  27. package/lib/server/{client-modules/index.js → clientModules.js} +6 -1
  28. package/lib/server/config.d.ts +5 -2
  29. package/lib/server/config.js +11 -6
  30. package/lib/server/htmlTags.d.ts +12 -0
  31. package/lib/server/htmlTags.js +62 -0
  32. package/lib/server/i18n.d.ts +2 -11
  33. package/lib/server/i18n.js +1 -18
  34. package/lib/server/index.d.ts +26 -11
  35. package/lib/server/index.js +40 -201
  36. package/lib/server/plugins/configs.d.ts +14 -0
  37. package/lib/server/plugins/configs.js +101 -0
  38. package/lib/server/plugins/index.d.ts +6 -6
  39. package/lib/server/plugins/index.js +29 -64
  40. package/lib/server/plugins/init.d.ts +6 -19
  41. package/lib/server/plugins/init.js +14 -65
  42. package/lib/server/{moduleShorthand.d.ts → plugins/moduleShorthand.d.ts} +0 -0
  43. package/lib/server/{moduleShorthand.js → plugins/moduleShorthand.js} +0 -0
  44. package/lib/server/plugins/pluginIds.d.ts +4 -0
  45. package/lib/server/plugins/pluginIds.js +4 -2
  46. package/lib/server/plugins/presets.d.ts +12 -0
  47. package/lib/server/{presets/index.js → plugins/presets.js} +9 -4
  48. package/lib/server/plugins/{applyRouteTrailingSlash.d.ts → routeConfig.d.ts} +2 -1
  49. package/lib/server/plugins/routeConfig.js +53 -0
  50. package/lib/server/plugins/synthetic.d.ts +20 -0
  51. package/lib/server/plugins/synthetic.js +112 -0
  52. package/lib/server/routes.d.ts +3 -2
  53. package/lib/server/routes.js +50 -24
  54. package/lib/server/{versions/index.d.ts → siteMetadata.d.ts} +5 -2
  55. package/lib/server/{versions/index.js → siteMetadata.js} +36 -3
  56. package/lib/server/translations/translations.js +1 -4
  57. package/lib/webpack/aliases/index.d.ts +29 -0
  58. package/lib/webpack/aliases/index.js +106 -0
  59. package/lib/webpack/base.d.ts +0 -3
  60. package/lib/webpack/base.js +4 -21
  61. package/package.json +10 -11
  62. package/lib/choosePort.d.ts +0 -11
  63. package/lib/server/duplicateRoutes.d.ts +0 -8
  64. package/lib/server/duplicateRoutes.js +0 -42
  65. package/lib/server/html-tags/htmlTags.d.ts +0 -7
  66. package/lib/server/html-tags/htmlTags.js +0 -38
  67. package/lib/server/html-tags/index.d.ts +0 -8
  68. package/lib/server/html-tags/index.js +0 -42
  69. package/lib/server/plugins/applyRouteTrailingSlash.js +0 -19
  70. package/lib/server/presets/index.d.ts +0 -11
  71. package/lib/server/themes/alias.d.ts +0 -9
  72. package/lib/server/themes/alias.js +0 -50
  73. package/lib/server/themes/index.d.ts +0 -12
  74. 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;