@modern-js/module-tools 2.0.0-beta.4 → 2.0.0-beta.6

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 (110) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/builder/build.js +54 -50
  3. package/dist/builder/build.js.map +1 -1
  4. package/dist/builder/clear.js +16 -23
  5. package/dist/builder/clear.js.map +1 -1
  6. package/dist/builder/copy.d.ts +2 -0
  7. package/dist/builder/copy.js +45 -56
  8. package/dist/builder/copy.js.map +1 -1
  9. package/dist/builder/dts/index.js +8 -3
  10. package/dist/builder/dts/index.js.map +1 -1
  11. package/dist/builder/dts/rollup.js +39 -52
  12. package/dist/builder/dts/rollup.js.map +1 -1
  13. package/dist/builder/dts/tsc.js +28 -35
  14. package/dist/builder/dts/tsc.js.map +1 -1
  15. package/dist/builder/index.js +14 -22
  16. package/dist/builder/index.js.map +1 -1
  17. package/dist/builder/platform.js +14 -22
  18. package/dist/builder/platform.js.map +1 -1
  19. package/dist/cli.js +16 -24
  20. package/dist/cli.js.map +1 -1
  21. package/dist/command.js +33 -38
  22. package/dist/command.js.map +1 -1
  23. package/dist/config/defineConfig.js +7 -3
  24. package/dist/config/defineConfig.js.map +1 -1
  25. package/dist/config/normalize.js +29 -38
  26. package/dist/config/normalize.js.map +1 -1
  27. package/dist/config/schema.js +11 -3
  28. package/dist/config/schema.js.map +1 -1
  29. package/dist/constants/build-presets.js +39 -22
  30. package/dist/constants/build-presets.js.map +1 -1
  31. package/dist/constants/build.js +10 -3
  32. package/dist/constants/build.js.map +1 -1
  33. package/dist/constants/colors.js +9 -3
  34. package/dist/constants/colors.js.map +1 -1
  35. package/dist/constants/dts.js +10 -3
  36. package/dist/constants/dts.js.map +1 -1
  37. package/dist/constants/file.js +9 -3
  38. package/dist/constants/file.js.map +1 -1
  39. package/dist/constants/legacy-build-presets.js +12 -3
  40. package/dist/constants/legacy-build-presets.js.map +1 -1
  41. package/dist/constants/log.js +10 -3
  42. package/dist/constants/log.js.map +1 -1
  43. package/dist/dev.js +18 -24
  44. package/dist/dev.js.map +1 -1
  45. package/dist/error.js +12 -3
  46. package/dist/error.js.map +1 -1
  47. package/dist/hooks/build.js +7 -3
  48. package/dist/hooks/build.js.map +1 -1
  49. package/dist/hooks/dev.js +7 -3
  50. package/dist/hooks/dev.js.map +1 -1
  51. package/dist/hooks/index.js +21 -19
  52. package/dist/hooks/index.js.map +1 -1
  53. package/dist/hooks/misc.js +7 -3
  54. package/dist/hooks/misc.js.map +1 -1
  55. package/dist/index.js +9 -4
  56. package/dist/index.js.map +1 -1
  57. package/dist/locale/en.js +7 -3
  58. package/dist/locale/en.js.map +1 -1
  59. package/dist/locale/index.js +8 -3
  60. package/dist/locale/index.js.map +1 -1
  61. package/dist/locale/zh.js +7 -3
  62. package/dist/locale/zh.js.map +1 -1
  63. package/dist/plugins.js +7 -3
  64. package/dist/plugins.js.map +1 -1
  65. package/dist/types/color.js +17 -0
  66. package/dist/types/color.js.map +1 -0
  67. package/dist/types/command.js +17 -0
  68. package/dist/types/command.js.map +1 -0
  69. package/dist/types/config/index.d.ts +2 -5
  70. package/dist/types/config/index.js +3 -3
  71. package/dist/types/config/index.js.map +1 -1
  72. package/dist/types/config/style.js +17 -0
  73. package/dist/types/config/style.js.map +1 -0
  74. package/dist/types/context.js +17 -0
  75. package/dist/types/context.js.map +1 -0
  76. package/dist/types/copy.js +17 -0
  77. package/dist/types/copy.js.map +1 -0
  78. package/dist/types/dts.js +17 -0
  79. package/dist/types/dts.js.map +1 -0
  80. package/dist/types/hooks.js +17 -0
  81. package/dist/types/hooks.js.map +1 -0
  82. package/dist/types/index.js +7 -7
  83. package/dist/types/index.js.map +1 -1
  84. package/dist/types/utils.js +17 -0
  85. package/dist/types/utils.js.map +1 -0
  86. package/dist/utils/builder.js +13 -26
  87. package/dist/utils/builder.js.map +1 -1
  88. package/dist/utils/config.js +32 -37
  89. package/dist/utils/config.js.map +1 -1
  90. package/dist/utils/context.js +14 -22
  91. package/dist/utils/context.js.map +1 -1
  92. package/dist/utils/dts.js +39 -50
  93. package/dist/utils/dts.js.map +1 -1
  94. package/dist/utils/input.js +19 -30
  95. package/dist/utils/input.js.map +1 -1
  96. package/dist/utils/language.js +17 -24
  97. package/dist/utils/language.js.map +1 -1
  98. package/dist/utils/libuild-plugins.js +16 -23
  99. package/dist/utils/libuild-plugins.js.map +1 -1
  100. package/dist/utils/log.js +15 -23
  101. package/dist/utils/log.js.map +1 -1
  102. package/dist/utils/onExit.js +14 -22
  103. package/dist/utils/onExit.js.map +1 -1
  104. package/dist/utils/path.js +11 -25
  105. package/dist/utils/path.js.map +1 -1
  106. package/dist/utils/style.js +20 -25
  107. package/dist/utils/style.js.map +1 -1
  108. package/dist/utils/tspaths-transform.js +7 -3
  109. package/dist/utils/tspaths-transform.js.map +1 -1
  110. package/package.json +13 -15
package/dist/locale/en.js CHANGED
@@ -15,11 +15,11 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
18
+ var en_exports = {};
19
+ __export(en_exports, {
20
20
  EN_LOCALE: () => EN_LOCALE
21
21
  });
22
- module.exports = __toCommonJS(stdin_exports);
22
+ module.exports = __toCommonJS(en_exports);
23
23
  const EN_LOCALE = {
24
24
  command: {
25
25
  build: {
@@ -43,5 +43,9 @@ const EN_LOCALE = {
43
43
  }
44
44
  }
45
45
  };
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ EN_LOCALE
49
+ });
46
50
 
47
51
  //# sourceMappingURL=en.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;AAAO;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,OAAO;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,UACE;AAAA,MACF,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IACV;AAAA,IACA,KAAK,EAAE,UAAU,mBAAmB;AAAA,IACpC,KAAK;AAAA,MACH,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,IACZ;AAAA,EACF;AACF;","names":[],"sources":["../../src/locale/en.ts"],"sourcesContent":["export const EN_LOCALE = {\n command: {\n build: {\n describe: 'command for building module',\n watch: 'building module in watch mode',\n tsconfig: 'Specify a path to the tsconfig.json file',\n style_only: 'only build style',\n platform:\n 'build the specified task or all tasks, If exist. (tasks: \"storybook\", \"docs\")',\n no_tsc: 'close tsc compiler to emit d.ts (Deprecated)',\n dts: 'Turn on dts generation and type checking',\n no_clear: 'disable auto clear dist dir',\n config: 'specify config file',\n },\n dev: { describe: 'start dev server' },\n new: {\n describe: 'generator runner for modern project',\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 },\n },\n};\n"]}
1
+ {"version":3,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,OAAO;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,UACE;AAAA,MACF,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IACV;AAAA,IACA,KAAK,EAAE,UAAU,mBAAmB;AAAA,IACpC,KAAK;AAAA,MACH,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,IACZ;AAAA,EACF;AACF;","names":[],"sources":["../../src/locale/en.ts"],"sourcesContent":["export const EN_LOCALE = {\n command: {\n build: {\n describe: 'command for building module',\n watch: 'building module in watch mode',\n tsconfig: 'Specify a path to the tsconfig.json file',\n style_only: 'only build style',\n platform:\n 'build the specified task or all tasks, If exist. (tasks: \"storybook\", \"docs\")',\n no_tsc: 'close tsc compiler to emit d.ts (Deprecated)',\n dts: 'Turn on dts generation and type checking',\n no_clear: 'disable auto clear dist dir',\n config: 'specify config file',\n },\n dev: { describe: 'start dev server' },\n new: {\n describe: 'generator runner for modern project',\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 },\n },\n};\n"]}
@@ -15,12 +15,12 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
18
+ var locale_exports = {};
19
+ __export(locale_exports, {
20
20
  i18n: () => i18n,
21
21
  localeKeys: () => localeKeys
22
22
  });
23
- module.exports = __toCommonJS(stdin_exports);
23
+ module.exports = __toCommonJS(locale_exports);
24
24
  var import_utils = require("@modern-js/utils");
25
25
  var import_zh = require("./zh");
26
26
  var import_en = require("./en");
@@ -30,5 +30,10 @@ const i18nPlugin = import_utils.Import.lazy(
30
30
  );
31
31
  const i18n = new i18nPlugin.I18n();
32
32
  const localeKeys = i18n.init("zh", { 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
37
+ });
33
38
 
34
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"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('zh', { zh: ZH_LOCALE, en: EN_LOCALE });\n\nexport { i18n, localeKeys };\n"]}
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('zh', { zh: ZH_LOCALE, en: EN_LOCALE });\n\nexport { i18n, localeKeys };\n"]}
package/dist/locale/zh.js CHANGED
@@ -15,11 +15,11 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
18
+ var zh_exports = {};
19
+ __export(zh_exports, {
20
20
  ZH_LOCALE: () => ZH_LOCALE
21
21
  });
22
- module.exports = __toCommonJS(stdin_exports);
22
+ module.exports = __toCommonJS(zh_exports);
23
23
  const ZH_LOCALE = {
24
24
  command: {
25
25
  build: {
@@ -43,5 +43,9 @@ const ZH_LOCALE = {
43
43
  }
44
44
  }
45
45
  };
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ ZH_LOCALE
49
+ });
46
50
 
47
51
  //# sourceMappingURL=zh.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;AAAO;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,OAAO;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,UACE;AAAA,MACF,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IACV;AAAA,IACA,KAAK,EAAE,UAAU,SAAS;AAAA,IAC1B,KAAK;AAAA,MACH,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,IACZ;AAAA,EACF;AACF;","names":[],"sources":["../../src/locale/zh.ts"],"sourcesContent":["export const ZH_LOCALE = {\n command: {\n build: {\n describe: '构建模块命令',\n watch: '使用 Watch 模式构建模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n style_only: '只构建样式文件',\n platform:\n '如果存在的话,执行指定的构建任务或者全部构建任务. (构建任务包括: \"storybook\", \"文档\")',\n no_tsc: '关闭 tsc 编译(废弃)',\n dts: '开启 dts 文件的生成以及类型检查',\n no_clear: '不清理产物目录',\n config: '指定配置文件路径,可以为相对路径或绝对路径',\n },\n dev: { describe: '本地开发命令' },\n new: {\n describe: '模块化工程方案中执行生成器',\n debug: '开启 Debug 模式,打印调试日志信息',\n config: '生成器运行默认配置(JSON 字符串)',\n distTag: '生成器使用特殊的 npm Tag 版本',\n registry: '生成器运行过程中定制 npm Registry',\n },\n },\n};\n"]}
1
+ {"version":3,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,IACP,OAAO;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,UACE;AAAA,MACF,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,MACV,QAAQ;AAAA,IACV;AAAA,IACA,KAAK,EAAE,UAAU,SAAS;AAAA,IAC1B,KAAK;AAAA,MACH,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,IACZ;AAAA,EACF;AACF;","names":[],"sources":["../../src/locale/zh.ts"],"sourcesContent":["export const ZH_LOCALE = {\n command: {\n build: {\n describe: '构建模块命令',\n watch: '使用 Watch 模式构建模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n style_only: '只构建样式文件',\n platform:\n '如果存在的话,执行指定的构建任务或者全部构建任务. (构建任务包括: \"storybook\", \"文档\")',\n no_tsc: '关闭 tsc 编译(废弃)',\n dts: '开启 dts 文件的生成以及类型检查',\n no_clear: '不清理产物目录',\n config: '指定配置文件路径,可以为相对路径或绝对路径',\n },\n dev: { describe: '本地开发命令' },\n new: {\n describe: '模块化工程方案中执行生成器',\n debug: '开启 Debug 模式,打印调试日志信息',\n config: '生成器运行默认配置(JSON 字符串)',\n distTag: '生成器使用特殊的 npm Tag 版本',\n registry: '生成器运行过程中定制 npm Registry',\n },\n },\n};\n"]}
package/dist/plugins.js CHANGED
@@ -21,11 +21,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  mod
22
22
  ));
23
23
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
- var stdin_exports = {};
25
- __export(stdin_exports, {
24
+ var plugins_exports = {};
25
+ __export(plugins_exports, {
26
26
  getPlugins: () => getPlugins
27
27
  });
28
- module.exports = __toCommonJS(stdin_exports);
28
+ module.exports = __toCommonJS(plugins_exports);
29
29
  var import_plugin_changeset = __toESM(require("@modern-js/plugin-changeset"));
30
30
  var import_plugin_lint = __toESM(require("@modern-js/plugin-lint"));
31
31
  const getPlugins = (runningCmd) => {
@@ -47,5 +47,9 @@ const getPlugins = (runningCmd) => {
47
47
  }
48
48
  return plugins;
49
49
  };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ getPlugins
53
+ });
50
54
 
51
55
  //# sourceMappingURL=plugins.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA4B;AAC5B,yBAAuB;AAEhB,MAAM,aAAa,CAAC,eAAuB;AAChD,MAAI,UAAuB,CAAC;AAE5B,UAAQ;AAAA,SACD;AACH,gBAAU,CAAC;AACX;AAAA,SACG;AACH,gBAAU,KAAC,4BAAW,CAAC;AACvB;AAAA,SACG;AAAA,SACA;AAAA,SACA;AACH,gBAAU,KAAC,iCAAgB,CAAC;AAC5B;AAAA;AAEA,gBAAU,CAAC;AAAA;AAGf,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":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,8BAA4B;AAC5B,yBAAuB;AAEhB,MAAM,aAAa,CAAC,eAAuB;AAChD,MAAI,UAAuB,CAAC;AAE5B,UAAQ;AAAA,SACD;AACH,gBAAU,CAAC;AACX;AAAA,SACG;AACH,gBAAU,KAAC,4BAAW,CAAC;AACvB;AAAA,SACG;AAAA,SACA;AAAA,SACA;AACH,gBAAU,KAAC,iCAAgB,CAAC;AAC5B;AAAA;AAEA,gBAAU,CAAC;AAAA;AAGf,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"]}
@@ -0,0 +1,17 @@
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);
16
+
17
+ //# sourceMappingURL=color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/color.ts"],"sourcesContent":["export type RGB = [number, number, number];\n"]}
@@ -0,0 +1,17 @@
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);
16
+
17
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["export interface DevCommandOptions {\n port?: 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,4 +1,5 @@
1
1
  import type { UserConfig as LibuildUserConfig, Asset as LibuildAsset, Style as LibuildStyle } from '@modern-js/libuild';
2
+ import type { Options } from '@modern-js/libuild-plugin-svgr';
2
3
  import type { DeepPartial } from '../utils';
3
4
  import { BuildInPreset, presetList } from '../../constants/build-presets';
4
5
  import type { CopyConfig } from '../copy';
@@ -14,15 +15,11 @@ export declare type DTSOptions = {
14
15
  only: boolean;
15
16
  };
16
17
  export declare type DTS = false | Partial<DTSOptions>;
17
- export declare type SvgrOptions = {
18
- include: string | RegExp | (string | RegExp)[];
19
- exclude: string | RegExp | (string | RegExp)[];
20
- };
21
18
  export interface Asset {
22
19
  path?: LibuildAsset['outdir'];
23
20
  limit?: LibuildAsset['limit'];
24
21
  publicPath?: LibuildAsset['publicPath'];
25
- svgr?: boolean | SvgrOptions;
22
+ svgr?: boolean | Options;
26
23
  }
27
24
  export declare type SourceMap = Required<LibuildUserConfig>['sourceMap'];
28
25
  export declare type AutoExternal = boolean | {
@@ -12,8 +12,8 @@ var __copyProps = (to, from, except, desc) => {
12
12
  };
13
13
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var stdin_exports = {};
16
- module.exports = __toCommonJS(stdin_exports);
17
- __reExport(stdin_exports, require("./style"), module.exports);
15
+ var config_exports = {};
16
+ module.exports = __toCommonJS(config_exports);
17
+ __reExport(config_exports, require("./style"), module.exports);
18
18
 
19
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;AAeA;AAAA;AAAA,0BAAc,oBAAd;","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 { DeepPartial } from '../utils';\nimport { BuildInPreset, presetList } from '../../constants/build-presets';\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 distPath: string;\n tsconfigPath: string;\n only: boolean;\n};\nexport type DTS = false | Partial<DTSOptions>;\n\nexport type SvgrOptions = {\n include: string | RegExp | (string | RegExp)[];\n exclude: string | RegExp | (string | RegExp)[];\n};\n\nexport interface Asset {\n path?: LibuildAsset['outdir'];\n limit?: LibuildAsset['limit'];\n publicPath?: LibuildAsset['publicPath'];\n svgr?: boolean | SvgrOptions;\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'\n> & {\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 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};\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 }) => 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 StorybookDevConfig {\n name?: string;\n}\nexport interface Dev {\n storybook: StorybookDevConfig;\n}\n\nexport interface ModuleExtraConfig {\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: DeepPartial<Dev>;\n}\n"]}
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 { DeepPartial } from '../utils';\nimport { BuildInPreset, presetList } from '../../constants/build-presets';\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 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'\n> & {\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 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};\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 }) => 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 StorybookDevConfig {\n name?: string;\n}\nexport interface Dev {\n storybook: StorybookDevConfig;\n}\n\nexport interface ModuleExtraConfig {\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: DeepPartial<Dev>;\n}\n"]}
@@ -0,0 +1,17 @@
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);
16
+
17
+ //# sourceMappingURL=style.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,17 @@
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);
16
+
17
+ //# sourceMappingURL=context.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,17 @@
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);
16
+
17
+ //# sourceMappingURL=copy.js.map
@@ -0,0 +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"]}
package/dist/types/dts.js CHANGED
@@ -0,0 +1,17 @@
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);
16
+
17
+ //# sourceMappingURL=dts.js.map
@@ -0,0 +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}\n\nexport interface ITsconfig {\n compilerOptions?:\n | {\n rootDir?: string;\n baseUrl?: string;\n declaration?: boolean;\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"]}
@@ -0,0 +1,17 @@
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);
16
+
17
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +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 } 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;\n}\n\nexport type DevToolData = BaseDevToolData<DevCommandOptions>;\n\nexport type PromptResult = { choiceDevTool: string | symbol } & Record<\n string,\n any\n>;\n\nexport type ModuleToolsHooks = typeof registerHook;\n"]}
@@ -12,12 +12,12 @@ var __copyProps = (to, from, except, desc) => {
12
12
  };
13
13
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var stdin_exports = {};
16
- module.exports = __toCommonJS(stdin_exports);
17
- __reExport(stdin_exports, require("./hooks"), module.exports);
18
- __reExport(stdin_exports, require("./command"), module.exports);
19
- __reExport(stdin_exports, require("./config"), module.exports);
20
- __reExport(stdin_exports, require("./dts"), module.exports);
21
- __reExport(stdin_exports, require("./context"), module.exports);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ __reExport(types_exports, require("./hooks"), module.exports);
18
+ __reExport(types_exports, require("./command"), module.exports);
19
+ __reExport(types_exports, require("./config"), module.exports);
20
+ __reExport(types_exports, require("./dts"), module.exports);
21
+ __reExport(types_exports, require("./context"), module.exports);
22
22
 
23
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;AAIA;AAAA;AAAA,0BAAc,oBAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,qBAFd;AAGA,0BAAc,kBAHd;AAIA,0BAAc,sBAJd;","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["import { NormalizedConfig, UserConfig } from '@modern-js/core';\nimport { ModuleToolsHooks } from './hooks';\nimport { ModuleExtraConfig } from './config';\n\nexport * from './hooks';\nexport * from './command';\nexport * from './config';\nexport * from './dts';\nexport * from './context';\nexport type { CliPlugin, IAppContext, PluginAPI } from '@modern-js/core';\n\nexport type ModuleTools = {\n hooks: ModuleToolsHooks;\n userConfig: ModuleExtraConfig;\n normalizedConfig: Required<ModuleExtraConfig>;\n};\n\nexport type ModuleUserConfig = UserConfig<ModuleTools>;\n\nexport type ModuleNormalizedConfig = NormalizedConfig<ModuleTools>;\n\n// params type for defineConfig\nexport type ModuleConfigParams =\n | ModuleUserConfig\n | Promise<ModuleUserConfig>\n | ((env: any) => ModuleUserConfig | Promise<ModuleUserConfig>);\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;AAAA;AAAA;AAIA,0BAAc,oBAJd;AAKA,0BAAc,sBALd;AAMA,0BAAc,qBANd;AAOA,0BAAc,kBAPd;AAQA,0BAAc,sBARd;","names":[],"sources":["../../src/types/index.ts"],"sourcesContent":["import { NormalizedConfig, UserConfig } from '@modern-js/core';\nimport { ModuleToolsHooks } from './hooks';\nimport { ModuleExtraConfig } from './config';\n\nexport * from './hooks';\nexport * from './command';\nexport * from './config';\nexport * from './dts';\nexport * from './context';\nexport type { CliPlugin, IAppContext, PluginAPI } from '@modern-js/core';\n\nexport type ModuleTools = {\n hooks: ModuleToolsHooks;\n userConfig: ModuleExtraConfig;\n normalizedConfig: Required<ModuleExtraConfig>;\n};\n\nexport type ModuleUserConfig = UserConfig<ModuleTools>;\n\nexport type ModuleNormalizedConfig = NormalizedConfig<ModuleTools>;\n\n// params type for defineConfig\nexport type ModuleConfigParams =\n | ModuleUserConfig\n | Promise<ModuleUserConfig>\n | ((env: any) => ModuleUserConfig | Promise<ModuleUserConfig>);\n"]}
@@ -0,0 +1,17 @@
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 utils_exports = {};
15
+ module.exports = __toCommonJS(utils_exports);
16
+
17
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";;;;;;;;;;;;;AAAA;AAAA;","names":[],"sources":["../../src/types/utils.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-types\nexport type DeepPartial<T> = T extends Function\n ? T\n : T extends Array<infer U>\n ? DeepPartialArray<U>\n : T extends object\n ? DeepPartialObject<T>\n : T | undefined;\n/** @private */\nexport type DeepPartialArray<T> = Array<DeepPartial<T>>;\n/** @private */\nexport type DeepPartialObject<T> = { [P in keyof T]?: DeepPartial<T[P]> };\n"]}
@@ -21,31 +21,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  mod
22
22
  ));
23
23
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
- var stdin_exports = {};
25
- __export(stdin_exports, {
26
- getAllDeps: () => getAllDeps,
27
- getFinalExternals: () => getFinalExternals
28
- });
29
- module.exports = __toCommonJS(stdin_exports);
30
- var import_path = __toESM(require("path"));
31
- var __create2 = Object.create;
32
- var __defProp2 = Object.defineProperty;
33
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
34
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
35
- var __getProtoOf2 = Object.getPrototypeOf;
36
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
37
- var __copyProps2 = (to, from, except, desc) => {
38
- if (from && typeof from === "object" || typeof from === "function") {
39
- for (let key of __getOwnPropNames2(from))
40
- if (!__hasOwnProp2.call(to, key) && key !== except)
41
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
42
- }
43
- return to;
44
- };
45
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
46
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
47
- mod
48
- ));
49
24
  var __async = (__this, __arguments, generator) => {
50
25
  return new Promise((resolve, reject) => {
51
26
  var fulfilled = (value) => {
@@ -66,6 +41,13 @@ var __async = (__this, __arguments, generator) => {
66
41
  step((generator = generator.apply(__this, __arguments)).next());
67
42
  });
68
43
  };
44
+ var builder_exports = {};
45
+ __export(builder_exports, {
46
+ getAllDeps: () => getAllDeps,
47
+ getFinalExternals: () => getFinalExternals
48
+ });
49
+ module.exports = __toCommonJS(builder_exports);
50
+ var import_path = __toESM(require("path"));
69
51
  const getFinalExternals = (config, options) => __async(void 0, null, function* () {
70
52
  const { autoExternal, externals } = config;
71
53
  const { appDirectory } = options;
@@ -89,7 +71,7 @@ const getFinalExternals = (config, options) => __async(void 0, null, function* (
89
71
  ];
90
72
  });
91
73
  const getAllDeps = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (appDirectory, options = {}) {
92
- const { fs } = yield Promise.resolve().then(() => __toESM2(require("@modern-js/utils")));
74
+ const { fs } = yield Promise.resolve().then(() => __toESM(require("@modern-js/utils")));
93
75
  try {
94
76
  const json = JSON.parse(
95
77
  fs.readFileSync(import_path.default.resolve(appDirectory, "./package.json"), "utf8")
@@ -113,5 +95,10 @@ const getAllDeps = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (appDir
113
95
  return [];
114
96
  }
115
97
  });
98
+ // Annotate the CommonJS export names for ESM import in node:
99
+ 0 && (module.exports = {
100
+ getAllDeps,
101
+ getFinalExternals
102
+ });
116
103
 
117
104
  //# sourceMappingURL=builder.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGV,MAAM,oBAAoB,CAC/B,QACA,YACG;AACH,QAAM,EAAE,cAAc,UAAU,IAAI;AACpC,QAAM,EAAE,aAAa,IAAI;AAEzB,MAAI,OAAO,iBAAiB,WAAW;AACrC,QAAI,CAAC,cAAc;AACjB,aAAO,aAAa,CAAC;AAAA,IACvB;AAEA,UAAMA,QAAO,MAAM,WAAW,cAAc;AAAA,MAC1C,cAAc;AAAA,MACd,kBAAkB;AAAA,IACpB,CAAC;AACD,WAAO;AAAA,MACL,GAAGA,MAAK,IAAI,SAAO,IAAI,OAAO,IAAI,iBAAiB,CAAC;AAAA,MACpD,GAAI,aAAa,CAAC;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,OAAO,MAAM,WAAW,cAAc,YAAY;AACxD,SAAO;AAAA,IACL,GAAG,KAAK,IAAI,SAAO,IAAI,OAAO,IAAI,iBAAiB,CAAC;AAAA,IACpD,GAAI,aAAa,CAAC;AAAA,EACpB;AACF;AAEO,MAAM,aAAa,CACxB,OAKG,wBALH,IAKG,mBALH,cACA,UAGI,CAAC,GACF;AACH,QAAM,EAAE,GAAG,IAAI,MAAM,8CAAO;AAC5B,MAAI;AACF,UAAM,OAAO,KAAK;AAAA,MAChB,GAAG,aAAa,oBAAK,QAAQ,cAAc,gBAAgB,GAAG,MAAM;AAAA,IACtE;AAEA,QAAI,OAAiB,CAAC;AAEtB,QAAI,QAAQ,cAAc;AACxB,aAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAG,OAAO,KAAM,KAAK,gBAAkC,CAAC,CAAC;AAAA,MAC3D;AAAA,IACF;AAEA,QAAI,QAAQ,kBAAkB;AAC5B,aAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAG,OAAO,KAAM,KAAK,oBAAsC,CAAC,CAAC;AAAA,MAC/D;AAAA,IACF;AAEA,WAAO;AAAA,EACT,SAAS,GAAT;AACE,YAAQ,KAAK,+BAA+B;AAC5C,WAAO,CAAC;AAAA,EACV;AACF;","names":["deps"],"sources":["../../src/utils/builder.ts"],"sourcesContent":["import path from 'path';\nimport type { BaseBuildConfig } from '../types/config';\n\nexport const getFinalExternals = async (\n config: BaseBuildConfig,\n options: { appDirectory: string },\n) => {\n const { autoExternal, externals } = config;\n const { appDirectory } = options;\n\n if (typeof autoExternal === 'boolean') {\n if (!autoExternal) {\n return externals || [];\n }\n\n const deps = await getAllDeps(appDirectory, {\n dependencies: true,\n peerDependencies: true,\n });\n return [\n ...deps.map(dep => new RegExp(`^${dep}($|\\\\/|\\\\\\\\)`)),\n ...(externals || []),\n ];\n }\n\n const deps = await getAllDeps(appDirectory, autoExternal);\n return [\n ...deps.map(dep => new RegExp(`^${dep}($|\\\\/|\\\\\\\\)`)),\n ...(externals || []),\n ];\n};\n\nexport const getAllDeps = async <T>(\n appDirectory: string,\n options: {\n dependencies?: boolean;\n peerDependencies?: boolean;\n } = {},\n) => {\n const { fs } = await import('@modern-js/utils');\n try {\n const json = JSON.parse(\n fs.readFileSync(path.resolve(appDirectory, './package.json'), 'utf8'),\n );\n\n let deps: string[] = [];\n\n if (options.dependencies) {\n deps = [\n ...deps,\n ...Object.keys((json.dependencies as T | undefined) || {}),\n ];\n }\n\n if (options.peerDependencies) {\n deps = [\n ...deps,\n ...Object.keys((json.peerDependencies as T | undefined) || {}),\n ];\n }\n\n return deps;\n } catch (e) {\n console.warn('[WARN] package.json is broken');\n return [];\n }\n};\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAGV,MAAM,oBAAoB,CAC/B,QACA,YACG;AACH,QAAM,EAAE,cAAc,UAAU,IAAI;AACpC,QAAM,EAAE,aAAa,IAAI;AAEzB,MAAI,OAAO,iBAAiB,WAAW;AACrC,QAAI,CAAC,cAAc;AACjB,aAAO,aAAa,CAAC;AAAA,IACvB;AAEA,UAAMA,QAAO,MAAM,WAAW,cAAc;AAAA,MAC1C,cAAc;AAAA,MACd,kBAAkB;AAAA,IACpB,CAAC;AACD,WAAO;AAAA,MACL,GAAGA,MAAK,IAAI,SAAO,IAAI,OAAO,IAAI,iBAAiB,CAAC;AAAA,MACpD,GAAI,aAAa,CAAC;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,OAAO,MAAM,WAAW,cAAc,YAAY;AACxD,SAAO;AAAA,IACL,GAAG,KAAK,IAAI,SAAO,IAAI,OAAO,IAAI,iBAAiB,CAAC;AAAA,IACpD,GAAI,aAAa,CAAC;AAAA,EACpB;AACF;AAEO,MAAM,aAAa,CACxB,OAKG,wBALH,IAKG,mBALH,cACA,UAGI,CAAC,GACF;AACH,QAAM,EAAE,GAAG,IAAI,MAAM,6CAAO;AAC5B,MAAI;AACF,UAAM,OAAO,KAAK;AAAA,MAChB,GAAG,aAAa,oBAAK,QAAQ,cAAc,gBAAgB,GAAG,MAAM;AAAA,IACtE;AAEA,QAAI,OAAiB,CAAC;AAEtB,QAAI,QAAQ,cAAc;AACxB,aAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAG,OAAO,KAAM,KAAK,gBAAkC,CAAC,CAAC;AAAA,MAC3D;AAAA,IACF;AAEA,QAAI,QAAQ,kBAAkB;AAC5B,aAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAG,OAAO,KAAM,KAAK,oBAAsC,CAAC,CAAC;AAAA,MAC/D;AAAA,IACF;AAEA,WAAO;AAAA,EACT,SAAS,GAAP;AACA,YAAQ,KAAK,+BAA+B;AAC5C,WAAO,CAAC;AAAA,EACV;AACF;;;;;;","names":["deps"],"sources":["../../src/utils/builder.ts"],"sourcesContent":["import path from 'path';\nimport type { BaseBuildConfig } from '../types/config';\n\nexport const getFinalExternals = async (\n config: BaseBuildConfig,\n options: { appDirectory: string },\n) => {\n const { autoExternal, externals } = config;\n const { appDirectory } = options;\n\n if (typeof autoExternal === 'boolean') {\n if (!autoExternal) {\n return externals || [];\n }\n\n const deps = await getAllDeps(appDirectory, {\n dependencies: true,\n peerDependencies: true,\n });\n return [\n ...deps.map(dep => new RegExp(`^${dep}($|\\\\/|\\\\\\\\)`)),\n ...(externals || []),\n ];\n }\n\n const deps = await getAllDeps(appDirectory, autoExternal);\n return [\n ...deps.map(dep => new RegExp(`^${dep}($|\\\\/|\\\\\\\\)`)),\n ...(externals || []),\n ];\n};\n\nexport const getAllDeps = async <T>(\n appDirectory: string,\n options: {\n dependencies?: boolean;\n peerDependencies?: boolean;\n } = {},\n) => {\n const { fs } = await import('@modern-js/utils');\n try {\n const json = JSON.parse(\n fs.readFileSync(path.resolve(appDirectory, './package.json'), 'utf8'),\n );\n\n let deps: string[] = [];\n\n if (options.dependencies) {\n deps = [\n ...deps,\n ...Object.keys((json.dependencies as T | undefined) || {}),\n ];\n }\n\n if (options.peerDependencies) {\n deps = [\n ...deps,\n ...Object.keys((json.peerDependencies as T | undefined) || {}),\n ];\n }\n\n return deps;\n } catch (e) {\n console.warn('[WARN] package.json is broken');\n return [];\n }\n};\n"]}
@@ -1,42 +1,17 @@
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 stdin_exports = {};
19
- __export(stdin_exports, {
20
- getDtsConfig: () => getDtsConfig,
21
- mergeDefaultBaseConfig: () => mergeDefaultBaseConfig,
22
- validBuildTypeAndFormat: () => validBuildTypeAndFormat,
23
- validPartialBuildConfig: () => validPartialBuildConfig
24
- });
25
- module.exports = __toCommonJS(stdin_exports);
26
1
  var __create = Object.create;
27
- var __defProp2 = Object.defineProperty;
2
+ var __defProp = Object.defineProperty;
28
3
  var __defProps = Object.defineProperties;
29
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
30
5
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
31
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
32
7
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
33
8
  var __getProtoOf = Object.getPrototypeOf;
34
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
35
10
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
36
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
37
12
  var __spreadValues = (a, b) => {
38
13
  for (var prop in b || (b = {}))
39
- if (__hasOwnProp2.call(b, prop))
14
+ if (__hasOwnProp.call(b, prop))
40
15
  __defNormalProp(a, prop, b[prop]);
41
16
  if (__getOwnPropSymbols)
42
17
  for (var prop of __getOwnPropSymbols(b)) {
@@ -46,18 +21,23 @@ var __spreadValues = (a, b) => {
46
21
  return a;
47
22
  };
48
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
49
- var __copyProps2 = (to, from, except, desc) => {
24
+ var __export = (target, all) => {
25
+ for (var name in all)
26
+ __defProp(target, name, { get: all[name], enumerable: true });
27
+ };
28
+ var __copyProps = (to, from, except, desc) => {
50
29
  if (from && typeof from === "object" || typeof from === "function") {
51
- for (let key of __getOwnPropNames2(from))
52
- if (!__hasOwnProp2.call(to, key) && key !== except)
53
- __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
30
+ for (let key of __getOwnPropNames(from))
31
+ if (!__hasOwnProp.call(to, key) && key !== except)
32
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
54
33
  }
55
34
  return to;
56
35
  };
57
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
58
- isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
37
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
59
38
  mod
60
39
  ));
40
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
61
41
  var __async = (__this, __arguments, generator) => {
62
42
  return new Promise((resolve, reject) => {
63
43
  var fulfilled = (value) => {
@@ -78,6 +58,14 @@ var __async = (__this, __arguments, generator) => {
78
58
  step((generator = generator.apply(__this, __arguments)).next());
79
59
  });
80
60
  };
61
+ var config_exports = {};
62
+ __export(config_exports, {
63
+ getDtsConfig: () => getDtsConfig,
64
+ mergeDefaultBaseConfig: () => mergeDefaultBaseConfig,
65
+ validBuildTypeAndFormat: () => validBuildTypeAndFormat,
66
+ validPartialBuildConfig: () => validPartialBuildConfig
67
+ });
68
+ module.exports = __toCommonJS(config_exports);
81
69
  const validPartialBuildConfig = (config) => {
82
70
  if (Array.isArray(config)) {
83
71
  for (const c of config) {
@@ -168,5 +156,12 @@ const getDtsConfig = (userDTS, defaultDTS) => __async(void 0, null, function* ()
168
156
  }
169
157
  return userDTS;
170
158
  });
159
+ // Annotate the CommonJS export names for ESM import in node:
160
+ 0 && (module.exports = {
161
+ getDtsConfig,
162
+ mergeDefaultBaseConfig,
163
+ validBuildTypeAndFormat,
164
+ validPartialBuildConfig
165
+ });
171
166
 
172
167
  //# sourceMappingURL=config.js.map