@modern-js/module-tools 2.35.0 → 2.36.0

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 (227) hide show
  1. package/compiled/postcss-nesting/index.js +2 -2
  2. package/compiled/postcss-nesting/package.json +1 -1
  3. package/dist/build.js +43 -16
  4. package/dist/builder/build.d.ts +1 -10
  5. package/dist/builder/build.js +96 -208
  6. package/dist/builder/clear.d.ts +1 -4
  7. package/dist/builder/clear.js +32 -28
  8. package/dist/builder/copy.js +79 -64
  9. package/dist/builder/dts/index.js +27 -19
  10. package/dist/builder/dts/rollup.d.ts +6 -14
  11. package/dist/builder/dts/rollup.js +60 -37
  12. package/dist/builder/dts/tsc.d.ts +3 -2
  13. package/dist/builder/dts/tsc.js +50 -37
  14. package/dist/builder/esbuild/adapter.d.ts +3 -0
  15. package/dist/builder/esbuild/adapter.js +275 -0
  16. package/dist/builder/esbuild/hook.d.ts +4 -0
  17. package/dist/builder/esbuild/hook.js +103 -0
  18. package/dist/builder/esbuild/index.d.ts +35 -0
  19. package/dist/builder/esbuild/index.js +268 -0
  20. package/dist/builder/esbuild/resolve.d.ts +17 -0
  21. package/dist/builder/esbuild/resolve.js +125 -0
  22. package/dist/builder/esbuild/sourcemap.d.ts +16 -0
  23. package/dist/builder/esbuild/sourcemap.js +86 -0
  24. package/dist/builder/esbuild/transform.d.ts +7 -0
  25. package/dist/builder/esbuild/transform.js +45 -0
  26. package/dist/builder/esbuild/watch.d.ts +2 -0
  27. package/dist/builder/esbuild/watch.js +115 -0
  28. package/dist/builder/esbuild/write-file.d.ts +2 -0
  29. package/dist/builder/esbuild/write-file.js +89 -0
  30. package/dist/builder/feature/asset.d.ts +19 -0
  31. package/dist/builder/feature/asset.js +149 -0
  32. package/dist/builder/feature/format-cjs.d.ts +5 -0
  33. package/dist/builder/feature/format-cjs.js +53 -0
  34. package/dist/builder/feature/index.d.ts +2 -0
  35. package/dist/builder/feature/index.js +74 -0
  36. package/dist/builder/feature/json.d.ts +5 -0
  37. package/dist/builder/feature/json.js +47 -0
  38. package/dist/builder/feature/redirect.d.ts +5 -0
  39. package/dist/builder/feature/redirect.js +217 -0
  40. package/dist/builder/feature/style/index.d.ts +5 -0
  41. package/dist/builder/feature/style/index.js +94 -0
  42. package/dist/builder/feature/style/lessAliasPlugin.d.ts +12 -0
  43. package/dist/builder/feature/style/lessAliasPlugin.js +70 -0
  44. package/dist/builder/feature/style/lessRender.d.ts +2 -0
  45. package/dist/builder/feature/style/lessRender.js +64 -0
  46. package/dist/builder/feature/style/postcssTransformer.d.ts +6 -0
  47. package/dist/builder/feature/style/postcssTransformer.js +95 -0
  48. package/dist/builder/feature/style/postcssUrlPlugin.d.ts +6 -0
  49. package/dist/builder/feature/style/postcssUrlPlugin.js +58 -0
  50. package/dist/builder/feature/style/sassRender.d.ts +2 -0
  51. package/dist/builder/feature/style/sassRender.js +85 -0
  52. package/dist/builder/feature/style/transformStyle.d.ts +13 -0
  53. package/dist/builder/feature/style/transformStyle.js +101 -0
  54. package/dist/builder/feature/style/utils.d.ts +18 -0
  55. package/dist/builder/feature/style/utils.js +124 -0
  56. package/dist/builder/feature/swc.d.ts +9 -0
  57. package/dist/builder/feature/swc.js +170 -0
  58. package/dist/builder/feature/terser.d.ts +5 -0
  59. package/dist/builder/feature/terser.js +83 -0
  60. package/dist/builder/index.d.ts +1 -0
  61. package/dist/builder/index.js +59 -28
  62. package/dist/builder/platform.js +38 -23
  63. package/dist/cli.js +58 -29
  64. package/dist/command.js +62 -38
  65. package/dist/config/defineConfig.js +25 -17
  66. package/dist/config/legacySchema.js +35 -32
  67. package/dist/config/merge.d.ts +1 -0
  68. package/dist/config/merge.js +69 -36
  69. package/dist/config/normalize.d.ts +1 -0
  70. package/dist/config/normalize.js +63 -46
  71. package/dist/config/schema.d.ts +48 -0
  72. package/dist/config/schema.js +53 -34
  73. package/dist/config/transformLegacyConfig.js +67 -61
  74. package/dist/config/valid.d.ts +2 -2
  75. package/dist/config/valid.js +44 -21
  76. package/dist/constants/build.d.ts +5 -1
  77. package/dist/constants/build.js +88 -46
  78. package/dist/constants/color.js +27 -20
  79. package/dist/constants/dts.js +27 -20
  80. package/dist/constants/file.d.ts +2 -2
  81. package/dist/constants/file.js +48 -25
  82. package/dist/constants/legacy-preset.js +45 -32
  83. package/dist/constants/loader.d.ts +2 -0
  84. package/dist/constants/loader.js +53 -0
  85. package/dist/constants/log.d.ts +0 -8
  86. package/dist/constants/log.js +27 -41
  87. package/dist/constants/preset.js +55 -62
  88. package/dist/debug.d.ts +4 -0
  89. package/dist/debug.js +37 -0
  90. package/dist/dev.js +42 -25
  91. package/dist/error.js +49 -42
  92. package/dist/hooks/build.d.ts +1 -2
  93. package/dist/hooks/build.js +36 -28
  94. package/dist/hooks/dev.js +32 -17
  95. package/dist/hooks/index.d.ts +1 -1
  96. package/dist/hooks/index.js +31 -16
  97. package/dist/hooks/misc.d.ts +5 -2
  98. package/dist/hooks/misc.js +31 -12
  99. package/dist/index.d.ts +2 -1
  100. package/dist/index.js +39 -32
  101. package/dist/locale/en.js +32 -17
  102. package/dist/locale/index.d.ts +2 -1
  103. package/dist/locale/index.js +31 -24
  104. package/dist/locale/zh.js +32 -17
  105. package/dist/plugins.js +28 -13
  106. package/dist/types/color.js +15 -5
  107. package/dist/types/command.d.ts +3 -3
  108. package/dist/types/command.js +15 -5
  109. package/dist/types/config/copy.js +15 -5
  110. package/dist/types/config/dev.js +15 -5
  111. package/dist/types/config/index.d.ts +87 -52
  112. package/dist/types/config/index.js +24 -6
  113. package/dist/types/config/style.d.ts +58 -6
  114. package/dist/types/config/style.js +15 -5
  115. package/dist/types/context.js +15 -5
  116. package/dist/types/dts.d.ts +14 -3
  117. package/dist/types/dts.js +15 -5
  118. package/dist/types/esbuild.d.ts +107 -0
  119. package/dist/types/esbuild.js +32 -0
  120. package/dist/types/hooks.js +15 -5
  121. package/dist/types/index.d.ts +1 -0
  122. package/dist/types/index.js +32 -11
  123. package/dist/types/legacyConfig/index.js +15 -5
  124. package/dist/types/legacyConfig/output.d.ts +4 -4
  125. package/dist/types/legacyConfig/output.js +15 -5
  126. package/dist/types/legacyConfig/source.js +15 -5
  127. package/dist/types/legacyConfig/tools.js +15 -5
  128. package/dist/utils/assert.d.ts +5 -0
  129. package/dist/utils/assert.js +50 -0
  130. package/dist/utils/builder.d.ts +10 -14
  131. package/dist/utils/builder.js +59 -59
  132. package/dist/utils/common.d.ts +1 -1
  133. package/dist/utils/common.js +25 -17
  134. package/dist/utils/dts.d.ts +26 -9
  135. package/dist/utils/dts.js +100 -66
  136. package/dist/utils/hash.d.ts +2 -0
  137. package/dist/utils/hash.js +31 -0
  138. package/dist/utils/index.d.ts +11 -0
  139. package/dist/utils/index.js +42 -0
  140. package/dist/utils/input.js +47 -24
  141. package/dist/utils/log.d.ts +1 -2
  142. package/dist/utils/log.js +36 -20
  143. package/dist/utils/map.d.ts +13 -0
  144. package/dist/utils/map.js +58 -0
  145. package/dist/utils/onExit.js +35 -11
  146. package/dist/utils/print.d.ts +2 -2
  147. package/dist/utils/print.js +52 -49
  148. package/dist/utils/style.d.ts +5 -23
  149. package/dist/utils/style.js +63 -43
  150. package/dist/utils/tspath.js +114 -0
  151. package/package.json +64 -50
  152. package/vitest.config.ts +20 -0
  153. package/dist/build.js.map +0 -1
  154. package/dist/builder/build.js.map +0 -1
  155. package/dist/builder/clear.js.map +0 -1
  156. package/dist/builder/copy.js.map +0 -1
  157. package/dist/builder/dts/index.js.map +0 -1
  158. package/dist/builder/dts/rollup.js.map +0 -1
  159. package/dist/builder/dts/tsc.js.map +0 -1
  160. package/dist/builder/index.js.map +0 -1
  161. package/dist/builder/platform.js.map +0 -1
  162. package/dist/cli.js.map +0 -1
  163. package/dist/command.js.map +0 -1
  164. package/dist/config/defineConfig.js.map +0 -1
  165. package/dist/config/legacySchema.js.map +0 -1
  166. package/dist/config/merge.js.map +0 -1
  167. package/dist/config/normalize.js.map +0 -1
  168. package/dist/config/schema.js.map +0 -1
  169. package/dist/config/transformLegacyConfig.js.map +0 -1
  170. package/dist/config/valid.js.map +0 -1
  171. package/dist/constants/build.js.map +0 -1
  172. package/dist/constants/color.js.map +0 -1
  173. package/dist/constants/dts.js.map +0 -1
  174. package/dist/constants/file.js.map +0 -1
  175. package/dist/constants/legacy-preset.js.map +0 -1
  176. package/dist/constants/log.js.map +0 -1
  177. package/dist/constants/preset.js.map +0 -1
  178. package/dist/dev.js.map +0 -1
  179. package/dist/error.js.map +0 -1
  180. package/dist/hooks/build.js.map +0 -1
  181. package/dist/hooks/dev.js.map +0 -1
  182. package/dist/hooks/index.js.map +0 -1
  183. package/dist/hooks/misc.js.map +0 -1
  184. package/dist/index.js.map +0 -1
  185. package/dist/locale/en.js.map +0 -1
  186. package/dist/locale/index.js.map +0 -1
  187. package/dist/locale/zh.js.map +0 -1
  188. package/dist/plugins.js.map +0 -1
  189. package/dist/types/color.js.map +0 -1
  190. package/dist/types/command.js.map +0 -1
  191. package/dist/types/config/copy.js.map +0 -1
  192. package/dist/types/config/dev.js.map +0 -1
  193. package/dist/types/config/index.js.map +0 -1
  194. package/dist/types/config/style.js.map +0 -1
  195. package/dist/types/context.js.map +0 -1
  196. package/dist/types/dts.js.map +0 -1
  197. package/dist/types/hooks.js.map +0 -1
  198. package/dist/types/index.js.map +0 -1
  199. package/dist/types/legacyConfig/index.js.map +0 -1
  200. package/dist/types/legacyConfig/output.js.map +0 -1
  201. package/dist/types/legacyConfig/source.js.map +0 -1
  202. package/dist/types/legacyConfig/tools.js.map +0 -1
  203. package/dist/types/utils.d.ts +0 -5
  204. package/dist/types/utils.js +0 -4
  205. package/dist/utils/builder.js.map +0 -1
  206. package/dist/utils/common.js.map +0 -1
  207. package/dist/utils/context.d.ts +0 -7
  208. package/dist/utils/context.js +0 -23
  209. package/dist/utils/context.js.map +0 -1
  210. package/dist/utils/dts.js.map +0 -1
  211. package/dist/utils/input.js.map +0 -1
  212. package/dist/utils/language.d.ts +0 -1
  213. package/dist/utils/language.js +0 -22
  214. package/dist/utils/language.js.map +0 -1
  215. package/dist/utils/libuild-plugin.d.ts +0 -3
  216. package/dist/utils/libuild-plugin.js +0 -31
  217. package/dist/utils/libuild-plugin.js.map +0 -1
  218. package/dist/utils/log.js.map +0 -1
  219. package/dist/utils/onExit.js.map +0 -1
  220. package/dist/utils/path.d.ts +0 -1
  221. package/dist/utils/path.js +0 -19
  222. package/dist/utils/path.js.map +0 -1
  223. package/dist/utils/print.js.map +0 -1
  224. package/dist/utils/style.js.map +0 -1
  225. package/dist/utils/tspathsTransform.js +0 -91
  226. package/dist/utils/tspathsTransform.js.map +0 -1
  227. /package/dist/utils/{tspathsTransform.d.ts → tspath.d.ts} +0 -0
@@ -1,17 +1,36 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "miscHooks", {
6
- enumerable: true,
7
- get: function() {
8
- return miscHooks;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var misc_exports = {};
20
+ __export(misc_exports, {
21
+ miscHooks: () => miscHooks
10
22
  });
11
- const _plugin = require("@modern-js/plugin");
23
+ module.exports = __toCommonJS(misc_exports);
24
+ var import_plugin = require("@modern-js/plugin");
12
25
  const miscHooks = {
13
- addRuntimeExports: (0, _plugin.createAsyncWaterfall)(),
14
- modifyLibuild: (0, _plugin.createAsyncPipeline)()
26
+ addRuntimeExports: (0, import_plugin.createAsyncWaterfall)(),
27
+ /**
28
+ * @deprecated
29
+ * use buildConfig.hooks and buildConfig.esbuildOptions instead.
30
+ */
31
+ modifyLibuild: (0, import_plugin.createAsyncPipeline)()
15
32
  };
16
-
17
- //# sourceMappingURL=misc.js.map
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ miscHooks
36
+ });
package/dist/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export { defineConfig, defineLegacyConfig } from './config/defineConfig';
3
3
  export { legacyPresets } from './constants/legacy-preset';
4
4
  export * from './types';
5
5
  export { moduleTools };
6
- export default moduleTools;
6
+ export default moduleTools;
7
+ export * from './utils/assert';
package/dist/index.js CHANGED
@@ -1,36 +1,43 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- defineConfig: function() {
14
- return _defineConfig.defineConfig;
15
- },
16
- defineLegacyConfig: function() {
17
- return _defineConfig.defineLegacyConfig;
18
- },
19
- legacyPresets: function() {
20
- return _legacypreset.legacyPresets;
21
- },
22
- moduleTools: function() {
23
- return _cli.moduleTools;
24
- },
25
- default: function() {
26
- return _default;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
15
  }
16
+ return to;
17
+ };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ default: () => src_default,
23
+ defineConfig: () => import_defineConfig.defineConfig,
24
+ defineLegacyConfig: () => import_defineConfig.defineLegacyConfig,
25
+ legacyPresets: () => import_legacy_preset.legacyPresets,
26
+ moduleTools: () => import_cli.moduleTools
27
+ });
28
+ module.exports = __toCommonJS(src_exports);
29
+ var import_cli = require("./cli");
30
+ var import_defineConfig = require("./config/defineConfig");
31
+ var import_legacy_preset = require("./constants/legacy-preset");
32
+ __reExport(src_exports, require("./types"), module.exports);
33
+ __reExport(src_exports, require("./utils/assert"), module.exports);
34
+ var src_default = import_cli.moduleTools;
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ defineConfig,
38
+ defineLegacyConfig,
39
+ legacyPresets,
40
+ moduleTools,
41
+ ...require("./types"),
42
+ ...require("./utils/assert")
28
43
  });
29
- const _export_star = require("@swc/helpers/_/_export_star");
30
- const _cli = require("./cli");
31
- const _defineConfig = require("./config/defineConfig");
32
- const _legacypreset = require("./constants/legacy-preset");
33
- _export_star._(require("./types"), exports);
34
- const _default = _cli.moduleTools;
35
-
36
- //# sourceMappingURL=index.js.map
package/dist/locale/en.js CHANGED
@@ -1,16 +1,29 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "EN_LOCALE", {
6
- enumerable: true,
7
- get: function() {
8
- return EN_LOCALE;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var en_exports = {};
20
+ __export(en_exports, {
21
+ EN_LOCALE: () => EN_LOCALE
10
22
  });
11
- const _utils = require("@modern-js/utils");
23
+ module.exports = __toCommonJS(en_exports);
24
+ var import_utils = require("@modern-js/utils");
12
25
  const noDevTools = `There are no DevTools available, you can learn about them and choose to use them by following the link options.
13
- - ${_utils.chalk.underline(_utils.chalk.blue("[Storybook]"), "https://modernjs.dev/module-tools/guide/basic/using-storybook.html")}
26
+ - ${import_utils.chalk.underline(import_utils.chalk.blue("[Storybook]"), "https://modernjs.dev/module-tools/guide/basic/using-storybook.html")}
14
27
  `;
15
28
  const EN_LOCALE = {
16
29
  command: {
@@ -49,14 +62,14 @@ const EN_LOCALE = {
49
62
  },
50
63
  errors: {
51
64
  externalHelpers: `The 'externalHelpers' configuration is currently enabled, but the "@swc/helpers" dependency declaration was not found. This will cause issues with the build output.Use the following for installation:
52
- ${_utils.chalk.blue("Package Manager is npm:")}
53
- ${_utils.chalk.yellow("`npm i @swc/helpers`")} Or ${_utils.chalk.yellow("`npm i @swc/helpers -D`")}
65
+ ${import_utils.chalk.blue("Package Manager is npm:")}
66
+ ${import_utils.chalk.yellow("`npm i @swc/helpers`")} Or ${import_utils.chalk.yellow("`npm i @swc/helpers -D`")}
54
67
 
55
- ${_utils.chalk.blue("Package Manager is pnpm:")}
56
- ${_utils.chalk.yellow("`pnpm i @swc/helpers`")} Or ${_utils.chalk.yellow("`pnpm i @swc/helpers -D`")}
68
+ ${import_utils.chalk.blue("Package Manager is pnpm:")}
69
+ ${import_utils.chalk.yellow("`pnpm i @swc/helpers`")} Or ${import_utils.chalk.yellow("`pnpm i @swc/helpers -D`")}
57
70
 
58
- ${_utils.chalk.blue("Package Manager is yarn:")}
59
- ${_utils.chalk.yellow("`yarn add @swc/helpers`")} Or ${_utils.chalk.yellow("`yarn add @swc/helpers -D`")}
71
+ ${import_utils.chalk.blue("Package Manager is yarn:")}
72
+ ${import_utils.chalk.yellow("`yarn add @swc/helpers`")} Or ${import_utils.chalk.yellow("`yarn add @swc/helpers -D`")}
60
73
  `
61
74
  },
62
75
  warns: {
@@ -66,5 +79,7 @@ const EN_LOCALE = {
66
79
  clearRootPath: "It is detected that the outDir in the configuration is the same as the current project directory, and the current product directory will not be automatically deleted."
67
80
  }
68
81
  };
69
-
70
- //# sourceMappingURL=en.js.map
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (module.exports = {
84
+ EN_LOCALE
85
+ });
@@ -1,4 +1,5 @@
1
- declare const i18n: import("@modern-js/plugin-i18n").I18n;
1
+ import { I18n } from '@modern-js/plugin-i18n';
2
+ declare const i18n: I18n;
2
3
  declare const localeKeys: {
3
4
  command: {
4
5
  shared: {
@@ -1,30 +1,37 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
6
7
  for (var name in all)
7
- Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- i18n: function() {
14
- return i18n;
15
- },
16
- localeKeys: function() {
17
- return localeKeys;
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var locale_exports = {};
20
+ __export(locale_exports, {
21
+ i18n: () => i18n,
22
+ localeKeys: () => localeKeys
19
23
  });
20
- const _utils = require("@modern-js/utils");
21
- const _zh = require("./zh");
22
- const _en = require("./en");
23
- const i18nPlugin = _utils.Import.lazy("@modern-js/plugin-i18n", require);
24
- const i18n = new i18nPlugin.I18n();
24
+ module.exports = __toCommonJS(locale_exports);
25
+ var import_plugin_i18n = require("@modern-js/plugin-i18n");
26
+ var import_zh = require("./zh");
27
+ var import_en = require("./en");
28
+ const i18n = new import_plugin_i18n.I18n();
25
29
  const localeKeys = i18n.init("en", {
26
- zh: _zh.ZH_LOCALE,
27
- en: _en.EN_LOCALE
30
+ zh: import_zh.ZH_LOCALE,
31
+ en: import_en.EN_LOCALE
32
+ });
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ i18n,
36
+ localeKeys
28
37
  });
29
-
30
- //# sourceMappingURL=index.js.map
package/dist/locale/zh.js CHANGED
@@ -1,16 +1,29 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "ZH_LOCALE", {
6
- enumerable: true,
7
- get: function() {
8
- return ZH_LOCALE;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var zh_exports = {};
20
+ __export(zh_exports, {
21
+ ZH_LOCALE: () => ZH_LOCALE
10
22
  });
11
- const _utils = require("@modern-js/utils");
23
+ module.exports = __toCommonJS(zh_exports);
24
+ var import_utils = require("@modern-js/utils");
12
25
  const noDevTools = `暂无可用的 DevTools,你可以通过以下选项以及对应的链接来了解如何使用。
13
- - ${_utils.chalk.underline(_utils.chalk.blue("[Storybook]:"), "https://modernjs.dev/module-tools/guide/basic/using-storybook.html")}
26
+ - ${import_utils.chalk.underline(import_utils.chalk.blue("[Storybook]:"), "https://modernjs.dev/module-tools/guide/basic/using-storybook.html")}
14
27
  `;
15
28
  const ZH_LOCALE = {
16
29
  command: {
@@ -49,14 +62,14 @@ const ZH_LOCALE = {
49
62
  },
50
63
  errors: {
51
64
  externalHelpers: `当前开启了 'externalHelpers' 配置,未找到 "@swc/helpers" 依赖声明,构建产物会存在问题。使用下面的方式进行安装:
52
- ${_utils.chalk.blue("Package Manager is npm:")}
53
- ${_utils.chalk.yellow("`npm i @swc/helpers`")} Or ${_utils.chalk.yellow("`npm i @swc/helpers -D`")}
65
+ ${import_utils.chalk.blue("Package Manager is npm:")}
66
+ ${import_utils.chalk.yellow("`npm i @swc/helpers`")} Or ${import_utils.chalk.yellow("`npm i @swc/helpers -D`")}
54
67
 
55
- ${_utils.chalk.blue("Package Manager is pnpm:")}
56
- ${_utils.chalk.yellow("`pnpm i @swc/helpers`")} Or ${_utils.chalk.yellow("`pnpm i @swc/helpers -D`")}
68
+ ${import_utils.chalk.blue("Package Manager is pnpm:")}
69
+ ${import_utils.chalk.yellow("`pnpm i @swc/helpers`")} Or ${import_utils.chalk.yellow("`pnpm i @swc/helpers -D`")}
57
70
 
58
- ${_utils.chalk.blue("Package Manager is yarn:")}
59
- ${_utils.chalk.yellow("`yarn add @swc/helpers`")} Or ${_utils.chalk.yellow("`yarn add @swc/helpers -D`")}
71
+ ${import_utils.chalk.blue("Package Manager is yarn:")}
72
+ ${import_utils.chalk.yellow("`yarn add @swc/helpers`")} Or ${import_utils.chalk.yellow("`yarn add @swc/helpers -D`")}
60
73
  `
61
74
  },
62
75
  warns: {
@@ -66,5 +79,7 @@ const ZH_LOCALE = {
66
79
  clearRootPath: "检测到配置中 outDir 与当前项目目录相同,不会自动删除当前产物目录"
67
80
  }
68
81
  };
69
-
70
- //# sourceMappingURL=zh.js.map
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (module.exports = {
84
+ ZH_LOCALE
85
+ });
package/dist/plugins.js CHANGED
@@ -1,15 +1,28 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "getPlugins", {
6
- enumerable: true,
7
- get: function() {
8
- return getPlugins;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
15
  }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var plugins_exports = {};
20
+ __export(plugins_exports, {
21
+ getPlugins: () => getPlugins
10
22
  });
11
- const _pluginchangeset = require("@modern-js/plugin-changeset");
12
- const _pluginlint = require("@modern-js/plugin-lint");
23
+ module.exports = __toCommonJS(plugins_exports);
24
+ var import_plugin_changeset = require("@modern-js/plugin-changeset");
25
+ var import_plugin_lint = require("@modern-js/plugin-lint");
13
26
  const getPlugins = (runningCmd) => {
14
27
  let plugins = [];
15
28
  switch (runningCmd) {
@@ -18,7 +31,7 @@ const getPlugins = (runningCmd) => {
18
31
  break;
19
32
  case "lint":
20
33
  plugins = [
21
- (0, _pluginlint.lintPlugin)()
34
+ (0, import_plugin_lint.lintPlugin)()
22
35
  ];
23
36
  break;
24
37
  case "change":
@@ -27,7 +40,7 @@ const getPlugins = (runningCmd) => {
27
40
  case "pre":
28
41
  case "gen-release-note":
29
42
  plugins = [
30
- (0, _pluginchangeset.changesetPlugin)()
43
+ (0, import_plugin_changeset.changesetPlugin)()
31
44
  ];
32
45
  break;
33
46
  default:
@@ -35,5 +48,7 @@ const getPlugins = (runningCmd) => {
35
48
  }
36
49
  return plugins;
37
50
  };
38
-
39
- //# sourceMappingURL=plugins.js.map
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ getPlugins
54
+ });
@@ -1,6 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=color.js.map
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var color_exports = {};
16
+ module.exports = __toCommonJS(color_exports);
@@ -3,10 +3,10 @@ export interface DevCommandOptions {
3
3
  tsconfig?: string;
4
4
  }
5
5
  export interface BuildCommandOptions {
6
+ clear: boolean;
7
+ dts: boolean;
8
+ watch: boolean;
6
9
  config?: string;
7
- clear?: boolean;
8
- dts?: boolean;
9
10
  platform?: boolean | string[];
10
11
  tsconfig?: string;
11
- watch?: boolean;
12
12
  }
@@ -1,6 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=command.js.map
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var command_exports = {};
16
+ module.exports = __toCommonJS(command_exports);
@@ -1,6 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=copy.js.map
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var copy_exports = {};
16
+ module.exports = __toCommonJS(copy_exports);
@@ -1,6 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
-
6
- //# sourceMappingURL=dev.js.map
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var dev_exports = {};
16
+ module.exports = __toCommonJS(dev_exports);