@docusaurus/core 0.0.0-5340 → 0.0.0-5343

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.
@@ -77,6 +77,10 @@ cli
77
77
  'copy TypeScript theme files when possible (default: false)',
78
78
  )
79
79
  .option('--danger', 'enable swizzle for unsafe component of themes')
80
+ .option(
81
+ '--config <config>',
82
+ 'path to Docusaurus config file (default: `[siteDir]/docusaurus.config.js`)',
83
+ )
80
84
  .action(swizzle);
81
85
 
82
86
  cli
@@ -27,6 +27,7 @@ export declare type SwizzleCLIOptions = {
27
27
  list: boolean;
28
28
  wrap: boolean;
29
29
  eject: boolean;
30
+ config?: string;
30
31
  };
31
32
  export declare function normalizeOptions(options: Partial<SwizzleCLIOptions>): SwizzleCLIOptions;
32
33
  export declare function findStringIgnoringCase(str: string, values: string[]): string | undefined;
@@ -43,6 +43,7 @@ function normalizeOptions(options) {
43
43
  list: options.list ?? false,
44
44
  wrap: options.wrap ?? false,
45
45
  eject: options.eject ?? false,
46
+ config: options.config ?? undefined,
46
47
  };
47
48
  }
48
49
  exports.normalizeOptions = normalizeOptions;
@@ -4,5 +4,5 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import type { SwizzleContext } from './common';
8
- export declare function initSwizzleContext(siteDir: string): Promise<SwizzleContext>;
7
+ import type { SwizzleCLIOptions, SwizzleContext } from './common';
8
+ export declare function initSwizzleContext(siteDir: string, options: SwizzleCLIOptions): Promise<SwizzleContext>;
@@ -10,8 +10,8 @@ exports.initSwizzleContext = void 0;
10
10
  const server_1 = require("../../server");
11
11
  const init_1 = require("../../server/plugins/init");
12
12
  const configs_1 = require("../../server/plugins/configs");
13
- async function initSwizzleContext(siteDir) {
14
- const context = await (0, server_1.loadContext)({ siteDir });
13
+ async function initSwizzleContext(siteDir, options) {
14
+ const context = await (0, server_1.loadContext)({ siteDir, config: options.config });
15
15
  const plugins = await (0, init_1.initPlugins)(context);
16
16
  const pluginConfigs = await (0, configs_1.loadPluginConfigs)(context);
17
17
  return {
@@ -62,7 +62,7 @@ async function swizzle(themeNameParam = undefined, componentNameParam = undefine
62
62
  const siteDir = await fs_extra_1.default.realpath(siteDirParam);
63
63
  const options = (0, common_1.normalizeOptions)(optionsParam);
64
64
  const { list, danger, typescript } = options;
65
- const { plugins } = await (0, context_1.initSwizzleContext)(siteDir);
65
+ const { plugins } = await (0, context_1.initSwizzleContext)(siteDir, options);
66
66
  const themeNames = (0, themes_1.getThemeNames)(plugins);
67
67
  if (list && !themeNameParam) {
68
68
  await listAllThemeComponents({ themeNames, plugins, typescript });
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-5340",
4
+ "version": "0.0.0-5343",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -43,13 +43,13 @@
43
43
  "@babel/runtime": "^7.19.0",
44
44
  "@babel/runtime-corejs3": "^7.19.0",
45
45
  "@babel/traverse": "^7.19.0",
46
- "@docusaurus/cssnano-preset": "0.0.0-5340",
47
- "@docusaurus/logger": "0.0.0-5340",
48
- "@docusaurus/mdx-loader": "0.0.0-5340",
46
+ "@docusaurus/cssnano-preset": "0.0.0-5343",
47
+ "@docusaurus/logger": "0.0.0-5343",
48
+ "@docusaurus/mdx-loader": "0.0.0-5343",
49
49
  "@docusaurus/react-loadable": "5.5.2",
50
- "@docusaurus/utils": "0.0.0-5340",
51
- "@docusaurus/utils-common": "0.0.0-5340",
52
- "@docusaurus/utils-validation": "0.0.0-5340",
50
+ "@docusaurus/utils": "0.0.0-5343",
51
+ "@docusaurus/utils-common": "0.0.0-5343",
52
+ "@docusaurus/utils-validation": "0.0.0-5343",
53
53
  "@slorber/static-site-generator-webpack-plugin": "^4.0.7",
54
54
  "@svgr/webpack": "^6.3.1",
55
55
  "autoprefixer": "^10.4.8",
@@ -106,8 +106,8 @@
106
106
  "webpackbar": "^5.0.2"
107
107
  },
108
108
  "devDependencies": {
109
- "@docusaurus/module-type-aliases": "0.0.0-5340",
110
- "@docusaurus/types": "0.0.0-5340",
109
+ "@docusaurus/module-type-aliases": "0.0.0-5343",
110
+ "@docusaurus/types": "0.0.0-5343",
111
111
  "@types/detect-port": "^1.3.2",
112
112
  "@types/react-dom": "^18.0.6",
113
113
  "@types/react-router-config": "^5.0.6",
@@ -127,5 +127,5 @@
127
127
  "engines": {
128
128
  "node": ">=16.14"
129
129
  },
130
- "gitHead": "4ca40b74f67cede21e3ff2f88d4764f596057e72"
130
+ "gitHead": "69fe520eda4a20da22c1e22ff3349ff60a7f0004"
131
131
  }