@docusaurus/core 0.0.0-4524 → 0.0.0-4525

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.
@@ -11,7 +11,7 @@ const server_1 = require("../server");
11
11
  const init_1 = (0, tslib_1.__importDefault)(require("../server/plugins/init"));
12
12
  async function externalCommand(cli, siteDir) {
13
13
  const context = await (0, server_1.loadContext)(siteDir);
14
- const pluginConfigs = (0, server_1.loadPluginConfigs)(context);
14
+ const pluginConfigs = await (0, server_1.loadPluginConfigs)(context);
15
15
  const plugins = await (0, init_1.default)({ pluginConfigs, context });
16
16
  // Plugin Lifecycle - extendCli.
17
17
  plugins.forEach((plugin) => {
@@ -109,7 +109,7 @@ function colorCode(themePath, plugin) {
109
109
  async function swizzle(siteDir, themeName, componentName, typescript, danger) {
110
110
  var _a, _b, _c, _d, _e;
111
111
  const context = await (0, server_1.loadContext)(siteDir);
112
- const pluginConfigs = (0, server_1.loadPluginConfigs)(context);
112
+ const pluginConfigs = await (0, server_1.loadPluginConfigs)(context);
113
113
  const pluginNames = getPluginNames(pluginConfigs);
114
114
  const plugins = await (0, init_1.default)({
115
115
  pluginConfigs,
@@ -85,7 +85,7 @@ async function transformMarkdownFile(filepath, options) {
85
85
  */
86
86
  async function getPathsToWatch(siteDir) {
87
87
  const context = await (0, server_1.loadContext)(siteDir);
88
- const pluginConfigs = (0, server_1.loadPluginConfigs)(context);
88
+ const pluginConfigs = await (0, server_1.loadPluginConfigs)(context);
89
89
  const plugins = await (0, init_1.default)({
90
90
  pluginConfigs,
91
91
  context,
@@ -53,7 +53,7 @@ async function writeTranslations(siteDir, options) {
53
53
  customConfigFilePath: options.config,
54
54
  locale: options.locale,
55
55
  });
56
- const pluginConfigs = (0, server_1.loadPluginConfigs)(context);
56
+ const pluginConfigs = await (0, server_1.loadPluginConfigs)(context);
57
57
  const plugins = await (0, init_1.default)({
58
58
  pluginConfigs,
59
59
  context,
@@ -19,5 +19,5 @@ export declare function loadSiteConfig({ siteDir, customConfigFilePath, }: {
19
19
  siteConfigPath: string;
20
20
  }>;
21
21
  export declare function loadContext(siteDir: string, options?: LoadContextOptions): Promise<LoadContext>;
22
- export declare function loadPluginConfigs(context: LoadContext): PluginConfig[];
22
+ export declare function loadPluginConfigs(context: LoadContext): Promise<PluginConfig[]>;
23
23
  export declare function load(siteDir: string, options?: LoadContextOptions): Promise<Props>;
@@ -82,8 +82,8 @@ async function loadContext(siteDir, options = {}) {
82
82
  };
83
83
  }
84
84
  exports.loadContext = loadContext;
85
- function loadPluginConfigs(context) {
86
- let { plugins: presetPlugins, themes: presetThemes } = (0, presets_1.default)(context);
85
+ async function loadPluginConfigs(context) {
86
+ let { plugins: presetPlugins, themes: presetThemes } = await (0, presets_1.default)(context);
87
87
  const { siteConfig, siteConfigPath } = context;
88
88
  const require = (0, module_1.createRequire)(siteConfigPath);
89
89
  function normalizeShorthand(pluginConfig, pluginType) {
@@ -205,7 +205,7 @@ async function load(siteDir, options = {}) {
205
205
  const context = await loadContext(siteDir, options);
206
206
  const { generatedFilesDir, siteConfig, siteConfigPath, outDir, baseUrl, i18n, ssrTemplate, codeTranslations, } = context;
207
207
  // Plugins.
208
- const pluginConfigs = loadPluginConfigs(context);
208
+ const pluginConfigs = await loadPluginConfigs(context);
209
209
  const { plugins, pluginsRouteConfigs, globalData, themeConfigTranslated } = await (0, plugins_1.loadPlugins)({ pluginConfigs, context });
210
210
  // Side-effect to replace the untranslated themeConfig by the translated one
211
211
  context.siteConfig.themeConfig = themeConfigTranslated;
@@ -13,7 +13,7 @@ const utils_1 = require("@docusaurus/utils");
13
13
  const versions_1 = require("../versions");
14
14
  const pluginIds_1 = require("./pluginIds");
15
15
  const utils_validation_1 = require("@docusaurus/utils-validation");
16
- function normalizePluginConfig(pluginConfig, pluginRequire) {
16
+ async function normalizePluginConfig(pluginConfig, pluginRequire) {
17
17
  var _a, _b, _c, _d;
18
18
  // plugins: ['./plugin']
19
19
  if (typeof pluginConfig === 'string') {
@@ -121,7 +121,7 @@ async function initPlugins({ pluginConfigs, context, }) {
121
121
  };
122
122
  }
123
123
  async function initializePlugin(pluginConfig) {
124
- const normalizedPluginConfig = normalizePluginConfig(pluginConfig, pluginRequire);
124
+ const normalizedPluginConfig = await normalizePluginConfig(pluginConfig, pluginRequire);
125
125
  const pluginVersion = doGetPluginVersion(normalizedPluginConfig);
126
126
  const pluginOptions = doValidatePluginOptions(normalizedPluginConfig);
127
127
  // Side-effect: merge the normalized theme config in the original one
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import type { LoadContext, PluginConfig } from '@docusaurus/types';
8
- export default function loadPresets(context: LoadContext): {
8
+ export default function loadPresets(context: LoadContext): Promise<{
9
9
  plugins: PluginConfig[];
10
10
  themes: PluginConfig[];
11
- };
11
+ }>;
@@ -10,7 +10,7 @@ const tslib_1 = require("tslib");
10
10
  const module_1 = require("module");
11
11
  const import_fresh_1 = (0, tslib_1.__importDefault)(require("import-fresh"));
12
12
  const moduleShorthand_1 = require("../moduleShorthand");
13
- function loadPresets(context) {
13
+ async function loadPresets(context) {
14
14
  // We need to resolve presets from the perspective of the siteDir, since the
15
15
  // siteDir's package.json declares the dependency on these presets.
16
16
  const presetRequire = (0, module_1.createRequire)(context.siteConfigPath);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docusaurus/core",
3
3
  "description": "Easy to Maintain Open Source Documentation Websites",
4
- "version": "0.0.0-4524",
4
+ "version": "0.0.0-4525",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -41,13 +41,13 @@
41
41
  "@babel/runtime": "^7.16.3",
42
42
  "@babel/runtime-corejs3": "^7.16.3",
43
43
  "@babel/traverse": "^7.16.3",
44
- "@docusaurus/cssnano-preset": "0.0.0-4524",
45
- "@docusaurus/logger": "0.0.0-4524",
46
- "@docusaurus/mdx-loader": "0.0.0-4524",
44
+ "@docusaurus/cssnano-preset": "0.0.0-4525",
45
+ "@docusaurus/logger": "0.0.0-4525",
46
+ "@docusaurus/mdx-loader": "0.0.0-4525",
47
47
  "@docusaurus/react-loadable": "5.5.2",
48
- "@docusaurus/utils": "0.0.0-4524",
49
- "@docusaurus/utils-common": "0.0.0-4524",
50
- "@docusaurus/utils-validation": "0.0.0-4524",
48
+ "@docusaurus/utils": "0.0.0-4525",
49
+ "@docusaurus/utils-common": "0.0.0-4525",
50
+ "@docusaurus/utils-validation": "0.0.0-4525",
51
51
  "@slorber/static-site-generator-webpack-plugin": "^4.0.0",
52
52
  "@svgr/webpack": "^6.0.0",
53
53
  "autoprefixer": "^10.3.5",
@@ -105,8 +105,8 @@
105
105
  "webpackbar": "^5.0.2"
106
106
  },
107
107
  "devDependencies": {
108
- "@docusaurus/module-type-aliases": "0.0.0-4524",
109
- "@docusaurus/types": "0.0.0-4524",
108
+ "@docusaurus/module-type-aliases": "0.0.0-4525",
109
+ "@docusaurus/types": "0.0.0-4525",
110
110
  "@types/copy-webpack-plugin": "^8.0.1",
111
111
  "@types/detect-port": "^1.3.0",
112
112
  "@types/mini-css-extract-plugin": "^1.4.3",
@@ -129,5 +129,5 @@
129
129
  "engines": {
130
130
  "node": ">=14"
131
131
  },
132
- "gitHead": "41a6bff3a67446f7d2a2972cbe4d05fec7378a15"
132
+ "gitHead": "c1122ee21d114f85261bed9b8296ab3501454098"
133
133
  }