@modern-js/module-tools 2.14.0 → 2.16.0-beta.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 (135) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/compiled/postcss-custom-properties/index.js +1 -1
  3. package/compiled/postcss-custom-properties/package.json +1 -1
  4. package/dist/build.js +23 -66
  5. package/dist/build.js.map +1 -1
  6. package/dist/builder/build.js +114 -170
  7. package/dist/builder/build.js.map +1 -1
  8. package/dist/builder/clear.js +23 -65
  9. package/dist/builder/clear.js.map +1 -1
  10. package/dist/builder/copy.js +83 -164
  11. package/dist/builder/copy.js.map +1 -1
  12. package/dist/builder/dts/index.js +15 -28
  13. package/dist/builder/dts/index.js.map +1 -1
  14. package/dist/builder/dts/rollup.js +46 -120
  15. package/dist/builder/dts/rollup.js.map +1 -1
  16. package/dist/builder/dts/tsc.js +82 -141
  17. package/dist/builder/dts/tsc.js.map +1 -1
  18. package/dist/builder/index.js +34 -85
  19. package/dist/builder/index.js.map +1 -1
  20. package/dist/builder/platform.js +40 -93
  21. package/dist/builder/platform.js.map +1 -1
  22. package/dist/cli.js +35 -84
  23. package/dist/cli.js.map +1 -1
  24. package/dist/command.js +56 -136
  25. package/dist/command.js.map +1 -1
  26. package/dist/config/defineConfig.js +13 -42
  27. package/dist/config/defineConfig.js.map +1 -1
  28. package/dist/config/legacySchema.js +96 -52
  29. package/dist/config/legacySchema.js.map +1 -1
  30. package/dist/config/normalize.js +73 -149
  31. package/dist/config/normalize.js.map +1 -1
  32. package/dist/config/schema.d.ts +36 -0
  33. package/dist/config/schema.js +118 -56
  34. package/dist/config/schema.js.map +1 -1
  35. package/dist/config/transformLegacyConfig.js +152 -203
  36. package/dist/config/transformLegacyConfig.js.map +1 -1
  37. package/dist/constants/build.js +15 -27
  38. package/dist/constants/build.js.map +1 -1
  39. package/dist/constants/buildPresets.js +71 -84
  40. package/dist/constants/buildPresets.js.map +1 -1
  41. package/dist/constants/colors.js +28 -30
  42. package/dist/constants/colors.js.map +1 -1
  43. package/dist/constants/dts.js +13 -28
  44. package/dist/constants/dts.js.map +1 -1
  45. package/dist/constants/file.js +27 -30
  46. package/dist/constants/file.js.map +1 -1
  47. package/dist/constants/legacyBuildPresets.js +33 -49
  48. package/dist/constants/legacyBuildPresets.js.map +1 -1
  49. package/dist/constants/log.js +15 -33
  50. package/dist/constants/log.js.map +1 -1
  51. package/dist/dev.js +45 -91
  52. package/dist/dev.js.map +1 -1
  53. package/dist/error.js +37 -54
  54. package/dist/error.js.map +1 -1
  55. package/dist/hooks/build.js +22 -35
  56. package/dist/hooks/build.js.map +1 -1
  57. package/dist/hooks/dev.js +15 -33
  58. package/dist/hooks/dev.js.map +1 -1
  59. package/dist/hooks/index.js +15 -42
  60. package/dist/hooks/index.js.map +1 -1
  61. package/dist/hooks/misc.js +10 -28
  62. package/dist/hooks/misc.js.map +1 -1
  63. package/dist/index.js +21 -35
  64. package/dist/index.js.map +1 -1
  65. package/dist/locale/en.d.ts +7 -2
  66. package/dist/locale/en.js +25 -32
  67. package/dist/locale/en.js.map +1 -1
  68. package/dist/locale/index.d.ts +14 -4
  69. package/dist/locale/index.js +18 -31
  70. package/dist/locale/index.js.map +1 -1
  71. package/dist/locale/zh.d.ts +7 -2
  72. package/dist/locale/zh.js +25 -32
  73. package/dist/locale/zh.js.map +1 -1
  74. package/dist/plugins.js +16 -39
  75. package/dist/plugins.js.map +1 -1
  76. package/dist/types/color.js +4 -15
  77. package/dist/types/color.js.map +1 -1
  78. package/dist/types/command.js +4 -15
  79. package/dist/types/command.js.map +1 -1
  80. package/dist/types/config/index.d.ts +6 -0
  81. package/dist/types/config/index.js +6 -17
  82. package/dist/types/config/index.js.map +1 -1
  83. package/dist/types/config/style.js +4 -15
  84. package/dist/types/config/style.js.map +1 -1
  85. package/dist/types/context.js +4 -15
  86. package/dist/types/context.js.map +1 -1
  87. package/dist/types/copy.js +4 -15
  88. package/dist/types/copy.js.map +1 -1
  89. package/dist/types/dts.js +4 -15
  90. package/dist/types/dts.js.map +1 -1
  91. package/dist/types/hooks.js +4 -15
  92. package/dist/types/hooks.js.map +1 -1
  93. package/dist/types/index.js +11 -22
  94. package/dist/types/index.js.map +1 -1
  95. package/dist/types/legacyConfig/index.js +4 -15
  96. package/dist/types/legacyConfig/index.js.map +1 -1
  97. package/dist/types/legacyConfig/output.js +4 -15
  98. package/dist/types/legacyConfig/output.js.map +1 -1
  99. package/dist/types/legacyConfig/source.js +4 -15
  100. package/dist/types/legacyConfig/source.js.map +1 -1
  101. package/dist/types/legacyConfig/tools.js +4 -15
  102. package/dist/types/legacyConfig/tools.js.map +1 -1
  103. package/dist/types/utils.js +4 -17
  104. package/dist/utils/builder.d.ts +20 -2
  105. package/dist/utils/builder.js +81 -68
  106. package/dist/utils/builder.js.map +1 -1
  107. package/dist/utils/common.js +10 -44
  108. package/dist/utils/common.js.map +1 -1
  109. package/dist/utils/config.js +108 -144
  110. package/dist/utils/config.js.map +1 -1
  111. package/dist/utils/context.js +16 -59
  112. package/dist/utils/context.js.map +1 -1
  113. package/dist/utils/dts.js +69 -146
  114. package/dist/utils/dts.js.map +1 -1
  115. package/dist/utils/input.js +44 -87
  116. package/dist/utils/input.js.map +1 -1
  117. package/dist/utils/language.js +15 -60
  118. package/dist/utils/language.js.map +1 -1
  119. package/dist/utils/libuildPlugins.js +27 -67
  120. package/dist/utils/libuildPlugins.js.map +1 -1
  121. package/dist/utils/log.js +14 -61
  122. package/dist/utils/log.js.map +1 -1
  123. package/dist/utils/onExit.js +14 -61
  124. package/dist/utils/onExit.js.map +1 -1
  125. package/dist/utils/path.js +13 -59
  126. package/dist/utils/path.js.map +1 -1
  127. package/dist/utils/print.js +57 -105
  128. package/dist/utils/print.js.map +1 -1
  129. package/dist/utils/style.js +54 -106
  130. package/dist/utils/style.js.map +1 -1
  131. package/dist/utils/tspathsTransform.js +44 -81
  132. package/dist/utils/tspathsTransform.js.map +1 -1
  133. package/package.json +20 -19
  134. package/scripts/debug-mode.js +23 -21
  135. package/dist/types/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAEtB,MAAM,aAAa;AAAA,MACb,mBAAM;AAAA,EACR,mBAAM,KAAK,aAAa;AAAA,EACxB;AACF;AAAA;AAGK,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,OAAO;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UACE;AAAA,MACF,OAAO;AAAA,MACP,KAAK;AAAA,MACL,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,UAAU;AAAA,IACZ;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,cACE;AAAA,EACJ;AACF;;;;;","names":[],"sources":["../../src/locale/en.ts"],"sourcesContent":["import { chalk } from '@modern-js/utils';\n\nconst noDevTools = `There are no DevTools available, you can learn about them and choose to use them by following the link options.\n - ${chalk.underline(\n chalk.blue('[Storybook]'),\n 'https://modernjs.dev/module-tools/guide/basic/using-storybook.html',\n )}\n`;\n\nexport const EN_LOCALE = {\n command: {\n build: {\n describe: 'build the module for production',\n watch: 'building module in watch mode',\n tsconfig: 'Specify a path to the tsconfig.json file',\n styleOnly: 'only build style',\n platform:\n 'build the specified task or all tasks, If exist. (tasks: \"storybook\", \"docs\")',\n noTsc: 'close tsc compiler to emit d.ts (Deprecated)',\n dts: 'Turn on dts generation and type checking',\n noClear: 'disable auto clear dist dir',\n config: 'specify config file',\n },\n dev: {\n describe: 'run and debug the module',\n tsconfig: 'Specify a path to the tsconfig.json file',\n },\n new: {\n describe: 'enable optional features',\n debug: 'using debug mode to log something',\n config: 'set default generator config(json string)',\n distTag: `use specified tag version for it's generator`,\n registry: 'set npm registry url to run npm command',\n lang: 'set new command language(en or zh)',\n },\n },\n log: {\n dev: {\n noDevtools: noDevTools,\n },\n },\n dts: {\n abortOnError:\n 'With the `dts.abortOnError` configuration currently turned off, type errors do not cause build failures, but they do not guarantee proper type file output',\n },\n};\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;+BASaA;;aAAAA;;uBATS;AAEtB,MAAMC,aAAa;MACbC,aAAMC,UACRD,aAAME,KAAK,gBACX;;AAIG,MAAMJ,YAAY;EACvBK,SAAS;IACPC,OAAO;MACLC,UAAU;MACVC,OAAO;MACPC,UAAU;MACVC,WAAW;MACXC,UACE;MACFC,OAAO;MACPC,KAAK;MACLC,SAAS;MACTC,QAAQ;IACV;IACAC,KAAK;MACHT,UAAU;MACVE,UAAU;IACZ;IACAQ,KAAK;MACHV,UAAU;MACVW,OAAO;MACPH,QAAQ;MACRI,SAAS;MACTC,UAAU;MACVC,MAAM;IACR;EACF;EACAC,KAAK;IACHN,KAAK;MACHO,YAAYtB;IACd;EACF;EACAuB,QAAQ;IACNC,iBAAiB;QACbvB,aAAME,KAAK;QACXF,aAAMwB,OAAO,8BAA8BxB,aAAMwB,OACnD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,+BAA+BxB,aAAMwB,OACpD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,iCAAiCxB,aAAMwB,OACtD;;EAGJ;EACAC,OAAO;IACLd,KAAK;MACHe,cACE;IACJ;EACF;AACF;","names":["EN_LOCALE","noDevTools","chalk","underline","blue","command","build","describe","watch","tsconfig","styleOnly","platform","noTsc","dts","noClear","config","dev","new","debug","distTag","registry","lang","log","noDevtools","errors","externalHelpers","yellow","warns","abortOnError"],"sources":["../../src/locale/Users/bytedance/github/targeral/modern-js/packages/solutions/module-tools/src/locale/en.ts"],"sourcesContent":["import { chalk } from '@modern-js/utils';\n\nconst noDevTools = `There are no DevTools available, you can learn about them and choose to use them by following the link options.\n - ${chalk.underline(\n chalk.blue('[Storybook]'),\n 'https://modernjs.dev/module-tools/guide/basic/using-storybook.html',\n )}\n`;\n\nexport const EN_LOCALE = {\n command: {\n build: {\n describe: 'build the module for production',\n watch: 'building module in watch mode',\n tsconfig: 'Specify a path to the tsconfig.json file',\n styleOnly: 'only build style',\n platform:\n 'build the specified task or all tasks, If exist. (tasks: \"storybook\", \"docs\")',\n noTsc: 'close tsc compiler to emit d.ts (Deprecated)',\n dts: 'Turn on dts generation and type checking',\n noClear: 'disable auto clear dist dir',\n config: 'specify config file',\n },\n dev: {\n describe: 'run and debug the module',\n tsconfig: 'Specify a path to the tsconfig.json file',\n },\n new: {\n describe: 'enable optional features',\n debug: 'using debug mode to log something',\n config: 'set default generator config(json string)',\n distTag: `use specified tag version for it's generator`,\n registry: 'set npm registry url to run npm command',\n lang: 'set new command language(en or zh)',\n },\n },\n log: {\n dev: {\n noDevtools: noDevTools,\n },\n },\n errors: {\n 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:\n ${chalk.blue('Package Manager is npm:')}\n ${chalk.yellow('`npm i @swc/helpers`')} Or ${chalk.yellow(\n '`npm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is pnpm:')}\n ${chalk.yellow('`pnpm i @swc/helpers`')} Or ${chalk.yellow(\n '`pnpm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is yarn:')}\n ${chalk.yellow('`yarn add @swc/helpers`')} Or ${chalk.yellow(\n '`yarn add @swc/helpers -D`',\n )}\n `,\n },\n warns: {\n dts: {\n abortOnError:\n 'With the `dts.abortOnError` configuration currently turned off, type errors do not cause build failures, but they do not guarantee proper type file output',\n },\n },\n};\n"]}
@@ -30,8 +30,13 @@ declare const localeKeys: {
30
30
  noDevtools: string;
31
31
  };
32
32
  };
33
- dts: {
34
- abortOnError: string;
33
+ errors: {
34
+ externalHelpers: string;
35
+ };
36
+ warns: {
37
+ dts: {
38
+ abortOnError: string;
39
+ };
35
40
  };
36
41
  } | {
37
42
  command: {
@@ -64,8 +69,13 @@ declare const localeKeys: {
64
69
  noDevtools: string;
65
70
  };
66
71
  };
67
- dts: {
68
- abortOnError: string;
72
+ errors: {
73
+ externalHelpers: string;
74
+ };
75
+ warns: {
76
+ dts: {
77
+ abortOnError: string;
78
+ };
69
79
  };
70
80
  };
71
81
  export { i18n, localeKeys };
@@ -1,39 +1,26 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
6
  for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var locale_exports = {};
19
- __export(locale_exports, {
7
+ Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
10
+ });
11
+ }
12
+ _export(exports, {
20
13
  i18n: () => i18n,
21
14
  localeKeys: () => localeKeys
22
15
  });
23
- module.exports = __toCommonJS(locale_exports);
24
- var import_utils = require("@modern-js/utils");
25
- var import_zh = require("./zh");
26
- var import_en = require("./en");
27
- const i18nPlugin = import_utils.Import.lazy(
28
- "@modern-js/plugin-i18n",
29
- require
30
- );
16
+ const _utils = require("@modern-js/utils");
17
+ const _zh = require("./zh");
18
+ const _en = require("./en");
19
+ const i18nPlugin = _utils.Import.lazy("@modern-js/plugin-i18n", require);
31
20
  const i18n = new i18nPlugin.I18n();
32
- const localeKeys = i18n.init("en", { zh: import_zh.ZH_LOCALE, en: import_en.EN_LOCALE });
33
- // Annotate the CommonJS export names for ESM import in node:
34
- 0 && (module.exports = {
35
- i18n,
36
- localeKeys
21
+ const localeKeys = i18n.init("en", {
22
+ zh: _zh.ZH_LOCALE,
23
+ en: _en.EN_LOCALE
37
24
  });
38
25
 
39
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuB;AAEvB,gBAA0B;AAC1B,gBAA0B;AAE1B,MAAM,aAAsD,oBAAO;AAAA,EACjE;AAAA,EACA;AACF;AAEA,MAAM,OAAO,IAAI,WAAW,KAAK;AAEjC,MAAM,aAAa,KAAK,KAAK,MAAM,EAAE,IAAI,qBAAW,IAAI,oBAAU,CAAC;;;;;;","names":[],"sources":["../../src/locale/index.ts"],"sourcesContent":["import { Import } from '@modern-js/utils';\n\nimport { ZH_LOCALE } from './zh';\nimport { EN_LOCALE } from './en';\n\nconst i18nPlugin: typeof import('@modern-js/plugin-i18n') = Import.lazy(\n '@modern-js/plugin-i18n',\n require,\n);\n\nconst i18n = new i18nPlugin.I18n();\n\nconst localeKeys = i18n.init('en', { zh: ZH_LOCALE, en: EN_LOCALE });\n\nexport { i18n, localeKeys };\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;;;;;;;;EAcSA,MAAI,MAAJA;EAAMC,YAAU,MAAVA;;uBAdQ;oBAEG;oBACA;AAE1B,MAAMC,aAAsDC,cAAOC,KACjE,0BACAC;AAGF,MAAML,OAAO,IAAIE,WAAWI,KAAI;AAEhC,MAAML,aAAaD,KAAKO,KAAK,MAAM;EAAEC,IAAIC;EAAWC,IAAIC;AAAU;","names":["i18n","localeKeys","i18nPlugin","Import","lazy","require","I18n","init","zh","ZH_LOCALE","en","EN_LOCALE"],"sources":["../../src/locale/Users/bytedance/github/targeral/modern-js/packages/solutions/module-tools/src/locale/index.ts"],"sourcesContent":["import { Import } from '@modern-js/utils';\n\nimport { ZH_LOCALE } from './zh';\nimport { EN_LOCALE } from './en';\n\nconst i18nPlugin: typeof import('@modern-js/plugin-i18n') = Import.lazy(\n '@modern-js/plugin-i18n',\n require,\n);\n\nconst i18n = new i18nPlugin.I18n();\n\nconst localeKeys = i18n.init('en', { zh: ZH_LOCALE, en: EN_LOCALE });\n\nexport { i18n, localeKeys };\n"]}
@@ -29,7 +29,12 @@ export declare const ZH_LOCALE: {
29
29
  noDevtools: string;
30
30
  };
31
31
  };
32
- dts: {
33
- abortOnError: string;
32
+ errors: {
33
+ externalHelpers: string;
34
+ };
35
+ warns: {
36
+ dts: {
37
+ abortOnError: string;
38
+ };
34
39
  };
35
40
  };
package/dist/locale/zh.js CHANGED
@@ -1,31 +1,14 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var zh_exports = {};
19
- __export(zh_exports, {
20
- ZH_LOCALE: () => ZH_LOCALE
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
21
4
  });
22
- module.exports = __toCommonJS(zh_exports);
23
- var import_utils = require("@modern-js/utils");
5
+ Object.defineProperty(exports, "ZH_LOCALE", {
6
+ enumerable: true,
7
+ get: () => ZH_LOCALE
8
+ });
9
+ const _utils = require("@modern-js/utils");
24
10
  const noDevTools = `暂无可用的 DevTools,你可以通过以下选项以及对应的链接来了解如何使用。
25
- - ${import_utils.chalk.underline(
26
- import_utils.chalk.blue("[Storybook]:"),
27
- "https://modernjs.dev/module-tools/guide/basic/using-storybook.html"
28
- )}
11
+ - ${_utils.chalk.underline(_utils.chalk.blue("[Storybook]:"), "https://modernjs.dev/module-tools/guide/basic/using-storybook.html")}
29
12
  `;
30
13
  const ZH_LOCALE = {
31
14
  command: {
@@ -58,13 +41,23 @@ const ZH_LOCALE = {
58
41
  noDevtools: noDevTools
59
42
  }
60
43
  },
61
- dts: {
62
- abortOnError: "当前关闭了 `dts.abortOnError` 配置,类型错误不会导致构建失败,但无法保证类型文件正常输出"
44
+ errors: {
45
+ externalHelpers: `当前开启了 'externalHelpers' 配置,未找到 "@swc/helpers" 依赖声明,构建产物会存在问题。使用下面的方式进行安装:
46
+ ${_utils.chalk.blue("Package Manager is npm:")}
47
+ ${_utils.chalk.yellow("`npm i @swc/helpers`")} Or ${_utils.chalk.yellow("`npm i @swc/helpers -D`")}
48
+
49
+ ${_utils.chalk.blue("Package Manager is pnpm:")}
50
+ ${_utils.chalk.yellow("`pnpm i @swc/helpers`")} Or ${_utils.chalk.yellow("`pnpm i @swc/helpers -D`")}
51
+
52
+ ${_utils.chalk.blue("Package Manager is yarn:")}
53
+ ${_utils.chalk.yellow("`yarn add @swc/helpers`")} Or ${_utils.chalk.yellow("`yarn add @swc/helpers -D`")}
54
+ `
55
+ },
56
+ warns: {
57
+ dts: {
58
+ abortOnError: "当前关闭了 `dts.abortOnError` 配置,类型错误不会导致构建失败,但无法保证类型文件正常输出"
59
+ }
63
60
  }
64
61
  };
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {
67
- ZH_LOCALE
68
- });
69
62
 
70
63
  //# sourceMappingURL=zh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;AAEtB,MAAM,aAAa;AAAA,MACb,mBAAM;AAAA,EACR,mBAAM,KAAK,cAAc;AAAA,EACzB;AACF;AAAA;AAGK,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,OAAO;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,WAAW;AAAA,MACX,UACE;AAAA,MACF,OAAO;AAAA,MACP,KAAK;AAAA,MACL,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,UAAU;AAAA,IACZ;AAAA,IACA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,KAAK;AAAA,MACH,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,cACE;AAAA,EACJ;AACF;;;;;","names":[],"sources":["../../src/locale/zh.ts"],"sourcesContent":["import { chalk } from '@modern-js/utils';\n\nconst noDevTools = `暂无可用的 DevTools,你可以通过以下选项以及对应的链接来了解如何使用。\n - ${chalk.underline(\n chalk.blue('[Storybook]:'),\n 'https://modernjs.dev/module-tools/guide/basic/using-storybook.html',\n )}\n`;\n\nexport const ZH_LOCALE = {\n command: {\n build: {\n describe: '构建生产环境产物',\n watch: '使用 Watch 模式构建模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n styleOnly: '只构建样式文件',\n platform:\n '如果存在的话,执行指定的构建任务或者全部构建任务. (构建任务包括: \"storybook\", \"文档\")',\n noTsc: '关闭 tsc 编译(废弃)',\n dts: '开启 dts 文件的生成以及类型检查',\n noClear: '不清理产物目录',\n config: '指定配置文件路径,可以为相对路径或绝对路径',\n },\n dev: {\n describe: '运行和调试模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n },\n new: {\n describe: '启用可选功能',\n debug: '开启 Debug 模式,打印调试日志信息',\n config: '生成器运行默认配置(JSON 字符串)',\n distTag: '生成器使用特殊的 npm Tag 版本',\n registry: '生成器运行过程中定制 npm Registry',\n lang: '设置 new 命令执行语言(zh 或者 en)',\n },\n },\n log: {\n dev: {\n noDevtools: noDevTools,\n },\n },\n dts: {\n abortOnError:\n '当前关闭了 `dts.abortOnError` 配置,类型错误不会导致构建失败,但无法保证类型文件正常输出',\n },\n};\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;+BASaA;;aAAAA;;uBATS;AAEtB,MAAMC,aAAa;MACbC,aAAMC,UACRD,aAAME,KAAK,iBACX;;AAIG,MAAMJ,YAAY;EACvBK,SAAS;IACPC,OAAO;MACLC,UAAU;MACVC,OAAO;MACPC,UAAU;MACVC,WAAW;MACXC,UACE;MACFC,OAAO;MACPC,KAAK;MACLC,SAAS;MACTC,QAAQ;IACV;IACAC,KAAK;MACHT,UAAU;MACVE,UAAU;IACZ;IACAQ,KAAK;MACHV,UAAU;MACVW,OAAO;MACPH,QAAQ;MACRI,SAAS;MACTC,UAAU;MACVC,MAAM;IACR;EACF;EACAC,KAAK;IACHN,KAAK;MACHO,YAAYtB;IACd;EACF;EACAuB,QAAQ;IACNC,iBAAiB;QACbvB,aAAME,KAAK;QACXF,aAAMwB,OAAO,8BAA8BxB,aAAMwB,OACnD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,+BAA+BxB,aAAMwB,OACpD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,iCAAiCxB,aAAMwB,OACtD;;EAGJ;EACAC,OAAO;IACLd,KAAK;MACHe,cACE;IACJ;EACF;AACF;","names":["ZH_LOCALE","noDevTools","chalk","underline","blue","command","build","describe","watch","tsconfig","styleOnly","platform","noTsc","dts","noClear","config","dev","new","debug","distTag","registry","lang","log","noDevtools","errors","externalHelpers","yellow","warns","abortOnError"],"sources":["../../src/locale/Users/bytedance/github/targeral/modern-js/packages/solutions/module-tools/src/locale/zh.ts"],"sourcesContent":["import { chalk } from '@modern-js/utils';\n\nconst noDevTools = `暂无可用的 DevTools,你可以通过以下选项以及对应的链接来了解如何使用。\n - ${chalk.underline(\n chalk.blue('[Storybook]:'),\n 'https://modernjs.dev/module-tools/guide/basic/using-storybook.html',\n )}\n`;\n\nexport const ZH_LOCALE = {\n command: {\n build: {\n describe: '构建生产环境产物',\n watch: '使用 Watch 模式构建模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n styleOnly: '只构建样式文件',\n platform:\n '如果存在的话,执行指定的构建任务或者全部构建任务. (构建任务包括: \"storybook\", \"文档\")',\n noTsc: '关闭 tsc 编译(废弃)',\n dts: '开启 dts 文件的生成以及类型检查',\n noClear: '不清理产物目录',\n config: '指定配置文件路径,可以为相对路径或绝对路径',\n },\n dev: {\n describe: '运行和调试模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n },\n new: {\n describe: '启用可选功能',\n debug: '开启 Debug 模式,打印调试日志信息',\n config: '生成器运行默认配置(JSON 字符串)',\n distTag: '生成器使用特殊的 npm Tag 版本',\n registry: '生成器运行过程中定制 npm Registry',\n lang: '设置 new 命令执行语言(zh 或者 en)',\n },\n },\n log: {\n dev: {\n noDevtools: noDevTools,\n },\n },\n errors: {\n externalHelpers: `当前开启了 'externalHelpers' 配置,未找到 \"@swc/helpers\" 依赖声明,构建产物会存在问题。使用下面的方式进行安装:\n ${chalk.blue('Package Manager is npm:')}\n ${chalk.yellow('`npm i @swc/helpers`')} Or ${chalk.yellow(\n '`npm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is pnpm:')}\n ${chalk.yellow('`pnpm i @swc/helpers`')} Or ${chalk.yellow(\n '`pnpm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is yarn:')}\n ${chalk.yellow('`yarn add @swc/helpers`')} Or ${chalk.yellow(\n '`yarn add @swc/helpers -D`',\n )}\n `,\n },\n warns: {\n dts: {\n abortOnError:\n '当前关闭了 `dts.abortOnError` 配置,类型错误不会导致构建失败,但无法保证类型文件正常输出',\n },\n },\n};\n"]}
package/dist/plugins.js CHANGED
@@ -1,37 +1,14 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var plugins_exports = {};
29
- __export(plugins_exports, {
30
- getPlugins: () => getPlugins
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
31
4
  });
32
- module.exports = __toCommonJS(plugins_exports);
33
- var import_plugin_changeset = __toESM(require("@modern-js/plugin-changeset"));
34
- var import_plugin_lint = __toESM(require("@modern-js/plugin-lint"));
5
+ Object.defineProperty(exports, "getPlugins", {
6
+ enumerable: true,
7
+ get: () => getPlugins
8
+ });
9
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
10
+ const _pluginchangeset = /* @__PURE__ */ _interop_require_default._(require("@modern-js/plugin-changeset"));
11
+ const _pluginlint = /* @__PURE__ */ _interop_require_default._(require("@modern-js/plugin-lint"));
35
12
  const getPlugins = (runningCmd) => {
36
13
  let plugins = [];
37
14
  switch (runningCmd) {
@@ -39,21 +16,21 @@ const getPlugins = (runningCmd) => {
39
16
  plugins = [];
40
17
  break;
41
18
  case "lint":
42
- plugins = [(0, import_plugin_lint.default)()];
19
+ plugins = [
20
+ (0, _pluginlint.default)()
21
+ ];
43
22
  break;
44
23
  case "change":
45
24
  case "release":
46
25
  case "bump":
47
- plugins = [(0, import_plugin_changeset.default)()];
26
+ plugins = [
27
+ (0, _pluginchangeset.default)()
28
+ ];
48
29
  break;
49
30
  default:
50
31
  plugins = [];
51
32
  }
52
33
  return plugins;
53
34
  };
54
- // Annotate the CommonJS export names for ESM import in node:
55
- 0 && (module.exports = {
56
- getPlugins
57
- });
58
35
 
59
36
  //# sourceMappingURL=plugins.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,8BAA4B;AAC5B,yBAAuB;AAEhB,MAAM,aAAa,CAAC,eAAuB;AAChD,MAAI,UAAuB,CAAC;AAE5B,UAAQ,YAAY;AAAA,IAClB,KAAK;AACH,gBAAU,CAAC;AACX;AAAA,IACF,KAAK;AACH,gBAAU,KAAC,4BAAW,CAAC;AACvB;AAAA,IACF,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,gBAAU,KAAC,iCAAgB,CAAC;AAC5B;AAAA,IACF;AACE,gBAAU,CAAC;AAAA,EACf;AAEA,SAAO;AACT;;;;;","names":[],"sources":["../src/plugins.ts"],"sourcesContent":["import type { CliPlugin } from '@modern-js/core';\nimport changesetPlugin from '@modern-js/plugin-changeset';\nimport lintPlugin from '@modern-js/plugin-lint';\n\nexport const getPlugins = (runningCmd: string) => {\n let plugins: CliPlugin[] = [];\n\n switch (runningCmd) {\n case 'build':\n plugins = [];\n break;\n case 'lint':\n plugins = [lintPlugin()];\n break;\n case 'change':\n case 'release':\n case 'bump':\n plugins = [changesetPlugin()];\n break;\n default:\n plugins = [];\n }\n\n return plugins;\n};\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;+BAIaA;;aAAAA;;;4EAHe;uEACL;AAEhB,MAAMA,aAAa,CAACC,eAAuB;AAChD,MAAIC,UAAuB;AAE3B,UAAQD;IACN,KAAK;AACHC,gBAAU;AACV;IACF,KAAK;AACHA,gBAAU;SAACC,wBAAU;;AACrB;IACF,KAAK;IACL,KAAK;IACL,KAAK;AACHD,gBAAU;SAACE,6BAAe;;AAC1B;IACF;AACEF,gBAAU;EACd;AAEA,SAAOA;AACT;","names":["getPlugins","runningCmd","plugins","lintPlugin","changesetPlugin"],"sources":["../src/Users/bytedance/github/targeral/modern-js/packages/solutions/module-tools/src/plugins.ts"],"sourcesContent":["import type { CliPlugin } from '@modern-js/core';\nimport changesetPlugin from '@modern-js/plugin-changeset';\nimport lintPlugin from '@modern-js/plugin-lint';\n\nexport const getPlugins = (runningCmd: string) => {\n let plugins: CliPlugin[] = [];\n\n switch (runningCmd) {\n case 'build':\n plugins = [];\n break;\n case 'lint':\n plugins = [lintPlugin()];\n break;\n case 'change':\n case 'release':\n case 'bump':\n plugins = [changesetPlugin()];\n break;\n default:\n plugins = [];\n }\n\n return plugins;\n};\n"]}
@@ -1,17 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var color_exports = {};
15
- module.exports = __toCommonJS(color_exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
16
5
 
17
6
  //# sourceMappingURL=color.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/color.ts"],"sourcesContent":["export type RGB = [number, number, number];\n"]}
1
+ {"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/color.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
@@ -1,17 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var command_exports = {};
15
- module.exports = __toCommonJS(command_exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
16
5
 
17
6
  //# sourceMappingURL=command.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["export interface DevCommandOptions {\n port?: string;\n tsconfig: string;\n}\n\nexport interface BuildCommandOptions {\n config?: string;\n clear?: boolean;\n dts?: boolean;\n platform?: boolean | string[];\n tsconfig: string;\n watch?: boolean;\n}\n"]}
1
+ {"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { UserConfig as LibuildUserConfig, Asset as LibuildAsset, Style as LibuildStyle } from '@modern-js/libuild';
2
2
  import type { Options } from '@modern-js/libuild-plugin-svgr';
3
+ import type { ImportItem } from '@modern-js/libuild-plugin-swc';
3
4
  import type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';
4
5
  import { BuildInPreset, presetList } from '../../constants/buildPresets';
5
6
  import type { CopyConfig } from '../copy';
@@ -28,6 +29,7 @@ export type AutoExternal = boolean | {
28
29
  peerDependencies?: boolean;
29
30
  };
30
31
  export type JSX = 'automatic' | 'transform';
32
+ export type ExternalHelpers = boolean;
31
33
  export type AliasOption = Record<string, string> | ((aliases: Record<string, string>) => Record<string, string> | void);
32
34
  export type BaseBuildConfig = Omit<Required<PartialBaseBuildConfig>, 'dts' | 'style' | 'alias' | 'sideEffects'> & {
33
35
  sideEffects: LibuildUserConfig['sideEffects'];
@@ -38,6 +40,7 @@ export type BaseBuildConfig = Omit<Required<PartialBaseBuildConfig>, 'dts' | 'st
38
40
  alias: Record<string, string>;
39
41
  };
40
42
  export type PartialBaseBuildConfig = {
43
+ sourceType?: 'commonjs' | 'module';
41
44
  buildType?: 'bundleless' | 'bundle';
42
45
  format?: Format;
43
46
  target?: Target;
@@ -63,6 +66,9 @@ export type PartialBaseBuildConfig = {
63
66
  redirect?: LibuildUserConfig['redirect'];
64
67
  sideEffects?: LibuildUserConfig['sideEffects'];
65
68
  esbuildOptions?: LibuildUserConfig['esbuildOptions'];
69
+ externalHelpers?: ExternalHelpers;
70
+ transformImport?: ImportItem[];
71
+ disableSwcTransform?: boolean;
66
72
  };
67
73
  export type BuildConfig = BaseBuildConfig | BaseBuildConfig[];
68
74
  export type PartialBuildConfig = PartialBaseBuildConfig | PartialBaseBuildConfig[];
@@ -1,19 +1,8 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var config_exports = {};
16
- module.exports = __toCommonJS(config_exports);
17
- __reExport(config_exports, require("./style"), module.exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./style"), exports);
18
7
 
19
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;AAAA;AAAA;AAgBA,2BAAc,oBAhBd;","names":[],"sources":["../../../src/types/config/index.ts"],"sourcesContent":["import type {\n UserConfig as LibuildUserConfig,\n Asset as LibuildAsset,\n Style as LibuildStyle,\n} from '@modern-js/libuild';\nimport type { Options } from '@modern-js/libuild-plugin-svgr';\nimport type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';\nimport { BuildInPreset, presetList } from '../../constants/buildPresets';\nimport type { CopyConfig } from '../copy';\nimport type {\n LessConfig,\n SassConfig,\n PostCSSConfig,\n TailwindCSSConfig,\n} from './style';\n\nexport * from './style';\n\nexport type BuildType = 'bundleless' | 'bundle';\n\nexport type Format = 'esm' | 'cjs' | 'umd' | 'iife';\n\nexport type Target =\n | 'es5'\n | 'es6'\n | 'es2015'\n | 'es2016'\n | 'es2017'\n | 'es2018'\n | 'es2019'\n | 'es2020'\n | 'es2021'\n | 'es2022'\n // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported.\n | 'esnext';\n\nexport type Input = Required<LibuildUserConfig>['input'];\n\nexport type DTSOptions = {\n abortOnError: boolean;\n distPath: string;\n tsconfigPath: string;\n only: boolean;\n};\nexport type DTS = false | Partial<DTSOptions>;\n\nexport interface Asset {\n path?: LibuildAsset['outdir'];\n limit?: LibuildAsset['limit'];\n publicPath?: LibuildAsset['publicPath'];\n svgr?: boolean | Options;\n}\nexport type SourceMap = Required<LibuildUserConfig>['sourceMap'];\nexport type AutoExternal =\n | boolean\n | {\n dependencies?: boolean;\n peerDependencies?: boolean;\n };\nexport type JSX = 'automatic' | 'transform';\n\nexport type AliasOption =\n | Record<string, string>\n | ((aliases: Record<string, string>) => Record<string, string> | void);\n\nexport type BaseBuildConfig = Omit<\n Required<PartialBaseBuildConfig>,\n 'dts' | 'style' | 'alias' | 'sideEffects'\n> & {\n sideEffects: LibuildUserConfig['sideEffects'];\n dts: false | DTSOptions;\n style: Omit<Required<LibuildStyle>, 'cleanCss'> & {\n tailwindCss: TailwindCSSConfig;\n };\n alias: Record<string, string>;\n};\n\nexport type PartialBaseBuildConfig = {\n buildType?: 'bundleless' | 'bundle';\n format?: Format;\n target?: Target;\n dts?: DTS;\n sourceMap?: SourceMap;\n sourceDir?: string;\n copy?: CopyConfig;\n asset?: Asset;\n jsx?: JSX;\n outDir?: string;\n alias?: AliasOption;\n input?: Input;\n metafile?: boolean;\n platform?: LibuildUserConfig['platform'];\n splitting?: LibuildUserConfig['splitting'];\n minify?: LibuildUserConfig['minify'];\n externals?: LibuildUserConfig['external'];\n autoExternal?: AutoExternal;\n umdGlobals?: LibuildUserConfig['globals'];\n umdModuleName?: ((chunkName: string) => string) | string | undefined;\n define?: LibuildUserConfig['define'];\n style?: StyleConfig;\n redirect?: LibuildUserConfig['redirect'];\n sideEffects?: LibuildUserConfig['sideEffects'];\n esbuildOptions?: LibuildUserConfig['esbuildOptions'];\n};\n\nexport type BuildConfig = BaseBuildConfig | BaseBuildConfig[];\nexport type PartialBuildConfig =\n | PartialBaseBuildConfig\n | PartialBaseBuildConfig[];\n\nexport type BuildPreset =\n | keyof typeof presetList\n | ((options: {\n preset: typeof BuildInPreset;\n extendPreset: (\n extendPresetName: keyof typeof BuildInPreset,\n extendBuildConfig: PartialBaseBuildConfig,\n ) => PartialBuildConfig;\n }) => PartialBuildConfig | Promise<PartialBuildConfig>);\n\nexport interface StyleConfig {\n less?: LessConfig;\n sass?: SassConfig;\n postcss?: PostCSSConfig;\n autoModules?: LibuildStyle['autoModules'];\n modules?: LibuildStyle['modules'];\n inject?: LibuildStyle['inject'];\n /**\n * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.\n * Please use `yarn new` or `pnpm new` to enable the corresponding capability.\n * @requires `tailwindcss` plugin\n */\n tailwindcss?: TailwindCSSConfig;\n}\n\nexport interface StorybookBuildConfig {\n webpack?: WebpackBuilderToolsConfig['webpack'];\n webpackChain?: WebpackBuilderToolsConfig['webpackChain'];\n}\nexport interface Dev {\n storybook?: StorybookBuildConfig;\n}\n\nexport interface RuntimeUserConfig {\n [name: string]: any;\n}\n\nexport interface ModuleExtraConfig {\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: Dev;\n\n runtime?: RuntimeUserConfig;\n}\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;uBAiBc;","names":[],"sources":["../../../src/types/config/Users/bytedance/github/targeral/modern-js/packages/solutions/module-tools/src/types/config/index.ts"],"sourcesContent":["import type {\n UserConfig as LibuildUserConfig,\n Asset as LibuildAsset,\n Style as LibuildStyle,\n} from '@modern-js/libuild';\nimport type { Options } from '@modern-js/libuild-plugin-svgr';\nimport type { ImportItem } from '@modern-js/libuild-plugin-swc';\nimport type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';\nimport { BuildInPreset, presetList } from '../../constants/buildPresets';\nimport type { CopyConfig } from '../copy';\nimport type {\n LessConfig,\n SassConfig,\n PostCSSConfig,\n TailwindCSSConfig,\n} from './style';\n\nexport * from './style';\n\nexport type BuildType = 'bundleless' | 'bundle';\n\nexport type Format = 'esm' | 'cjs' | 'umd' | 'iife';\n\nexport type Target =\n | 'es5'\n | 'es6'\n | 'es2015'\n | 'es2016'\n | 'es2017'\n | 'es2018'\n | 'es2019'\n | 'es2020'\n | 'es2021'\n | 'es2022'\n // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported.\n | 'esnext';\n\nexport type Input = Required<LibuildUserConfig>['input'];\n\nexport type DTSOptions = {\n abortOnError: boolean;\n distPath: string;\n tsconfigPath: string;\n only: boolean;\n};\nexport type DTS = false | Partial<DTSOptions>;\n\nexport interface Asset {\n path?: LibuildAsset['outdir'];\n limit?: LibuildAsset['limit'];\n publicPath?: LibuildAsset['publicPath'];\n svgr?: boolean | Options;\n}\nexport type SourceMap = Required<LibuildUserConfig>['sourceMap'];\nexport type AutoExternal =\n | boolean\n | {\n dependencies?: boolean;\n peerDependencies?: boolean;\n };\nexport type JSX = 'automatic' | 'transform';\nexport type ExternalHelpers = boolean;\n\nexport type AliasOption =\n | Record<string, string>\n | ((aliases: Record<string, string>) => Record<string, string> | void);\n\nexport type BaseBuildConfig = Omit<\n Required<PartialBaseBuildConfig>,\n 'dts' | 'style' | 'alias' | 'sideEffects'\n> & {\n sideEffects: LibuildUserConfig['sideEffects'];\n dts: false | DTSOptions;\n style: Omit<Required<LibuildStyle>, 'cleanCss'> & {\n tailwindCss: TailwindCSSConfig;\n };\n alias: Record<string, string>;\n};\n\nexport type PartialBaseBuildConfig = {\n sourceType?: 'commonjs' | 'module';\n buildType?: 'bundleless' | 'bundle';\n format?: Format;\n target?: Target;\n dts?: DTS;\n sourceMap?: SourceMap;\n sourceDir?: string;\n copy?: CopyConfig;\n asset?: Asset;\n jsx?: JSX;\n outDir?: string;\n alias?: AliasOption;\n input?: Input;\n metafile?: boolean;\n platform?: LibuildUserConfig['platform'];\n splitting?: LibuildUserConfig['splitting'];\n minify?: LibuildUserConfig['minify'];\n externals?: LibuildUserConfig['external'];\n autoExternal?: AutoExternal;\n umdGlobals?: LibuildUserConfig['globals'];\n umdModuleName?: ((chunkName: string) => string) | string | undefined;\n define?: LibuildUserConfig['define'];\n style?: StyleConfig;\n redirect?: LibuildUserConfig['redirect'];\n sideEffects?: LibuildUserConfig['sideEffects'];\n esbuildOptions?: LibuildUserConfig['esbuildOptions'];\n // Related to swc-transform\n externalHelpers?: ExternalHelpers;\n transformImport?: ImportItem[];\n disableSwcTransform?: boolean;\n};\n\nexport type BuildConfig = BaseBuildConfig | BaseBuildConfig[];\nexport type PartialBuildConfig =\n | PartialBaseBuildConfig\n | PartialBaseBuildConfig[];\n\nexport type BuildPreset =\n | keyof typeof presetList\n | ((options: {\n preset: typeof BuildInPreset;\n extendPreset: (\n extendPresetName: keyof typeof BuildInPreset,\n extendBuildConfig: PartialBaseBuildConfig,\n ) => PartialBuildConfig;\n }) => PartialBuildConfig | Promise<PartialBuildConfig>);\n\nexport interface StyleConfig {\n less?: LessConfig;\n sass?: SassConfig;\n postcss?: PostCSSConfig;\n autoModules?: LibuildStyle['autoModules'];\n modules?: LibuildStyle['modules'];\n inject?: LibuildStyle['inject'];\n /**\n * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.\n * Please use `yarn new` or `pnpm new` to enable the corresponding capability.\n * @requires `tailwindcss` plugin\n */\n tailwindcss?: TailwindCSSConfig;\n}\n\nexport interface StorybookBuildConfig {\n webpack?: WebpackBuilderToolsConfig['webpack'];\n webpackChain?: WebpackBuilderToolsConfig['webpackChain'];\n}\nexport interface Dev {\n storybook?: StorybookBuildConfig;\n}\n\nexport interface RuntimeUserConfig {\n [name: string]: any;\n}\n\nexport interface ModuleExtraConfig {\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: Dev;\n\n runtime?: RuntimeUserConfig;\n}\n"]}
@@ -1,17 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var style_exports = {};
15
- module.exports = __toCommonJS(style_exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
16
5
 
17
6
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../../src/types/config/style.ts"],"sourcesContent":["import type { Style } from '@modern-js/libuild';\nimport type { AcceptedPlugin as PostCSSPlugin } from 'postcss';\n\nexport type LessOptions = Required<Style>['less'];\nexport type SassOptions = Required<Style>['sass'];\nexport type PostcssOptions = Required<Style>['postcss'];\n\nexport type LessConfig =\n | LessOptions\n | ((options: LessOptions) => LessOptions | void);\n\nexport type SassConfig =\n | SassOptions\n | ((options: SassOptions) => SassOptions | void);\n\nexport type PostCSSConfigUtils = {\n addPlugins: (plugins: PostCSSPlugin | PostCSSPlugin[]) => void;\n};\nexport type PostCSSConfig =\n | PostcssOptions\n | ((\n options: PostcssOptions,\n utils: PostCSSConfigUtils,\n ) => PostcssOptions | void);\n\nexport type TailwindCSSConfig =\n | Record<string, any>\n | ((options: Record<string, any>) => Record<string, any> | void);\n"]}
1
+ {"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/config/style.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
@@ -1,17 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var context_exports = {};
15
- module.exports = __toCommonJS(context_exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
16
5
 
17
6
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/context.ts"],"sourcesContent":["export interface ModuleContext {\n isTsProject: boolean;\n appDirectory: string;\n srcDirectory: string;\n}\n"]}
1
+ {"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/context.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
@@ -1,17 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var copy_exports = {};
15
- module.exports = __toCommonJS(copy_exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
16
5
 
17
6
  //# sourceMappingURL=copy.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/copy.ts"],"sourcesContent":["import type { globby } from '@modern-js/utils';\n\nexport interface CopyPattern {\n from: string;\n to?: string;\n context?: string;\n globOptions?: globby.GlobbyOptions;\n}\n\nexport interface CopyOptions {\n patterns?: CopyPattern[];\n options?: {\n concurrency?: number;\n enableCopySync?: boolean;\n };\n}\n\nexport type CopyConfig = CopyOptions;\n"]}
1
+ {"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/copy.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
package/dist/types/dts.js CHANGED
@@ -1,17 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var dts_exports = {};
15
- module.exports = __toCommonJS(dts_exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
16
5
 
17
6
  //# sourceMappingURL=dts.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/dts.ts"],"sourcesContent":["import type { AliasOption } from './config';\n\nexport interface BundlelessGeneratorDtsConfig {\n appDirectory: string;\n distAbsPath: string;\n tsconfigPath: string;\n watch: boolean;\n sourceDir: string;\n alias: AliasOption;\n abortOnError?: boolean;\n}\n\nexport interface ITsconfig {\n compilerOptions?:\n | {\n rootDir?: string;\n baseUrl?: string;\n declaration?: boolean;\n declarationDir?: string;\n emitDeclarationOnly?: boolean;\n emitDecoratorMetadata?: boolean;\n isolatedModules?: boolean;\n allowJs?: boolean;\n outDir?: string;\n paths?: Record<string, string[]>;\n }\n | undefined;\n include?: string[];\n exclude?: string[];\n extends?: string;\n}\n"]}
1
+ {"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/dts.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
@@ -1,17 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var hooks_exports = {};
15
- module.exports = __toCommonJS(hooks_exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
16
5
 
17
6
  //# sourceMappingURL=hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/hooks.ts"],"sourcesContent":["import { DevToolData as BaseDevToolData } from '@modern-js/core';\nimport { registerHook } from '../hooks';\nimport type { BaseBuildConfig, BuildConfig, BuildType } from './config';\nimport type { DevCommandOptions, BuildCommandOptions } from './command';\n\nexport interface BuildTaskResult {\n status: 'success' | 'fail';\n message?: string;\n config: BaseBuildConfig;\n}\n\nexport interface BuildResult {\n status: 'success' | 'fail';\n message?: string;\n config: BuildConfig;\n commandOptions: BuildCommandOptions;\n totalDuration: number;\n}\nexport interface BuildPlatformResult {\n status: 'success' | 'fail';\n message: string | Error | null;\n}\n\nexport type DevToolData = BaseDevToolData<DevCommandOptions>;\n\nexport type PromptResult = { choiceDevTool: string } & Record<string, any>;\n\nexport type ModuleToolsHooks = typeof registerHook;\n\nexport interface WatchJsHookContext {\n buildConfig: BaseBuildConfig;\n}\n\nexport interface WatchDtsHookContext {\n buildType: BuildType;\n}\n"]}
1
+ {"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/hooks.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}