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

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 (123) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/dist/build.d.ts +3 -0
  3. package/dist/build.js +73 -0
  4. package/dist/build.js.map +1 -0
  5. package/dist/builder/build.js +55 -51
  6. package/dist/builder/build.js.map +1 -1
  7. package/dist/builder/clear.js +17 -24
  8. package/dist/builder/clear.js.map +1 -1
  9. package/dist/builder/copy.d.ts +2 -0
  10. package/dist/builder/copy.js +45 -56
  11. package/dist/builder/copy.js.map +1 -1
  12. package/dist/builder/dts/index.js +8 -3
  13. package/dist/builder/dts/index.js.map +1 -1
  14. package/dist/builder/dts/rollup.js +39 -52
  15. package/dist/builder/dts/rollup.js.map +1 -1
  16. package/dist/builder/dts/tsc.js +28 -35
  17. package/dist/builder/dts/tsc.js.map +1 -1
  18. package/dist/builder/index.js +15 -31
  19. package/dist/builder/index.js.map +1 -1
  20. package/dist/builder/platform.js +74 -68
  21. package/dist/builder/platform.js.map +1 -1
  22. package/dist/cli.js +16 -24
  23. package/dist/cli.js.map +1 -1
  24. package/dist/command.js +47 -60
  25. package/dist/command.js.map +1 -1
  26. package/dist/config/defineConfig.js +7 -3
  27. package/dist/config/defineConfig.js.map +1 -1
  28. package/dist/config/normalize.js +32 -41
  29. package/dist/config/normalize.js.map +1 -1
  30. package/dist/config/schema.d.ts +4 -4
  31. package/dist/config/schema.js +12 -4
  32. package/dist/config/schema.js.map +1 -1
  33. package/dist/constants/build-presets.js +51 -34
  34. package/dist/constants/build-presets.js.map +1 -1
  35. package/dist/constants/build.js +11 -4
  36. package/dist/constants/build.js.map +1 -1
  37. package/dist/constants/colors.js +9 -3
  38. package/dist/constants/colors.js.map +1 -1
  39. package/dist/constants/dts.js +10 -3
  40. package/dist/constants/dts.js.map +1 -1
  41. package/dist/constants/file.js +9 -3
  42. package/dist/constants/file.js.map +1 -1
  43. package/dist/constants/legacy-build-presets.js +31 -22
  44. package/dist/constants/legacy-build-presets.js.map +1 -1
  45. package/dist/constants/log.js +10 -3
  46. package/dist/constants/log.js.map +1 -1
  47. package/dist/dev.d.ts +1 -1
  48. package/dist/dev.js +26 -35
  49. package/dist/dev.js.map +1 -1
  50. package/dist/error.js +12 -3
  51. package/dist/error.js.map +1 -1
  52. package/dist/hooks/build.d.ts +5 -8
  53. package/dist/hooks/build.js +8 -4
  54. package/dist/hooks/build.js.map +1 -1
  55. package/dist/hooks/dev.d.ts +1 -1
  56. package/dist/hooks/dev.js +8 -4
  57. package/dist/hooks/dev.js.map +1 -1
  58. package/dist/hooks/index.d.ts +6 -9
  59. package/dist/hooks/index.js +21 -19
  60. package/dist/hooks/index.js.map +1 -1
  61. package/dist/hooks/misc.js +7 -3
  62. package/dist/hooks/misc.js.map +1 -1
  63. package/dist/index.js +9 -4
  64. package/dist/index.js.map +1 -1
  65. package/dist/locale/en.d.ts +1 -0
  66. package/dist/locale/en.js +11 -4
  67. package/dist/locale/en.js.map +1 -1
  68. package/dist/locale/index.d.ts +2 -0
  69. package/dist/locale/index.js +8 -3
  70. package/dist/locale/index.js.map +1 -1
  71. package/dist/locale/zh.d.ts +1 -0
  72. package/dist/locale/zh.js +11 -4
  73. package/dist/locale/zh.js.map +1 -1
  74. package/dist/plugins.js +7 -3
  75. package/dist/plugins.js.map +1 -1
  76. package/dist/types/color.js +17 -0
  77. package/dist/types/color.js.map +1 -0
  78. package/dist/types/command.d.ts +2 -1
  79. package/dist/types/command.js +17 -0
  80. package/dist/types/command.js.map +1 -0
  81. package/dist/types/config/index.d.ts +3 -6
  82. package/dist/types/config/index.js +3 -3
  83. package/dist/types/config/index.js.map +1 -1
  84. package/dist/types/config/style.js +17 -0
  85. package/dist/types/config/style.js.map +1 -0
  86. package/dist/types/context.js +17 -0
  87. package/dist/types/context.js.map +1 -0
  88. package/dist/types/copy.js +17 -0
  89. package/dist/types/copy.js.map +1 -0
  90. package/dist/types/dts.js +17 -0
  91. package/dist/types/dts.js.map +1 -0
  92. package/dist/types/hooks.d.ts +2 -2
  93. package/dist/types/hooks.js +17 -0
  94. package/dist/types/hooks.js.map +1 -0
  95. package/dist/types/index.js +7 -7
  96. package/dist/types/index.js.map +1 -1
  97. package/dist/types/utils.js +17 -0
  98. package/dist/types/utils.js.map +1 -0
  99. package/dist/utils/builder.js +13 -26
  100. package/dist/utils/builder.js.map +1 -1
  101. package/dist/utils/config.js +33 -38
  102. package/dist/utils/config.js.map +1 -1
  103. package/dist/utils/context.js +14 -22
  104. package/dist/utils/context.js.map +1 -1
  105. package/dist/utils/dts.js +39 -50
  106. package/dist/utils/dts.js.map +1 -1
  107. package/dist/utils/input.js +19 -30
  108. package/dist/utils/input.js.map +1 -1
  109. package/dist/utils/language.js +17 -24
  110. package/dist/utils/language.js.map +1 -1
  111. package/dist/utils/libuild-plugins.js +16 -23
  112. package/dist/utils/libuild-plugins.js.map +1 -1
  113. package/dist/utils/log.js +15 -23
  114. package/dist/utils/log.js.map +1 -1
  115. package/dist/utils/onExit.js +14 -22
  116. package/dist/utils/onExit.js.map +1 -1
  117. package/dist/utils/path.js +11 -25
  118. package/dist/utils/path.js.map +1 -1
  119. package/dist/utils/style.js +20 -25
  120. package/dist/utils/style.js.map +1 -1
  121. package/dist/utils/tspaths-transform.js +7 -3
  122. package/dist/utils/tspaths-transform.js.map +1 -1
  123. package/package.json +13 -15
@@ -3,7 +3,7 @@ export declare const registerHook: {
3
3
  modifyLibuild: import("@modern-js/plugin").AsyncPipeline<import("@modern-js/libuild").CLIConfig, import("@modern-js/libuild").CLIConfig>;
4
4
  registerDev: import("@modern-js/plugin").ParallelWorkflow<void, import("..").DevToolData>;
5
5
  beforeDev: import("@modern-js/plugin").ParallelWorkflow<import("..").DevToolData[], void>;
6
- beforeDevMenu: import("@modern-js/plugin").ParallelWorkflow<any, any>;
6
+ beforeDevMenu: import("@modern-js/plugin").AsyncWaterfall<any>;
7
7
  afterDevMenu: import("@modern-js/plugin").ParallelWorkflow<{
8
8
  result: import("..").PromptResult;
9
9
  devTools: import("..").DevToolData[];
@@ -12,18 +12,15 @@ export declare const registerHook: {
12
12
  afterDev: import("@modern-js/plugin").ParallelWorkflow<void, void>;
13
13
  beforeBuild: import("@modern-js/plugin").ParallelWorkflow<{
14
14
  config: import("..").BuildConfig;
15
- options: import("..").BuildCommandOptions;
16
- }, import("..").BuildConfig>;
17
- beforeBuildTask: import("@modern-js/plugin").AsyncPipeline<{
18
- config: import("..").BaseBuildConfig;
19
- options: import("..").BuildCommandOptions;
20
- }, import("..").BaseBuildConfig>;
15
+ cliOptions: import("..").BuildCommandOptions;
16
+ }, void>;
17
+ beforeBuildTask: import("@modern-js/plugin").AsyncWaterfall<import("..").BaseBuildConfig>;
21
18
  afterBuildTask: import("@modern-js/plugin").ParallelWorkflow<import("..").BuildTaskResult, void>;
22
19
  afterBuild: import("@modern-js/plugin").ParallelWorkflow<import("..").BuildResult, void>;
23
20
  registerBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<void, import("@modern-js/core").RegisterBuildPlatformResult>;
24
21
  beforeBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<import("@modern-js/core").RegisterBuildPlatformResult[], void>;
25
22
  buildPlatform: import("@modern-js/plugin").ParallelWorkflow<{
26
23
  platform: string;
27
- }, Pick<import("@modern-js/core").RegisterBuildPlatformResult, "build">>;
28
- afterBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<void, import("..").BuildPlatformResult>;
24
+ }, void>;
25
+ afterBuildPlatform: import("@modern-js/plugin").ParallelWorkflow<import("..").BuildPlatformResult, void>;
29
26
  };
@@ -1,7 +1,21 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
5
19
  var __export = (target, all) => {
6
20
  for (var name in all)
7
21
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -15,30 +29,18 @@ var __copyProps = (to, from, except, desc) => {
15
29
  return to;
16
30
  };
17
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var stdin_exports = {};
19
- __export(stdin_exports, {
32
+ var hooks_exports = {};
33
+ __export(hooks_exports, {
20
34
  registerHook: () => registerHook
21
35
  });
22
- module.exports = __toCommonJS(stdin_exports);
36
+ module.exports = __toCommonJS(hooks_exports);
23
37
  var import_build = require("./build");
24
38
  var import_dev = require("./dev");
25
39
  var import_misc = require("./misc");
26
- var __defProp2 = Object.defineProperty;
27
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
28
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
29
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
30
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
31
- var __spreadValues = (a, b) => {
32
- for (var prop in b || (b = {}))
33
- if (__hasOwnProp2.call(b, prop))
34
- __defNormalProp(a, prop, b[prop]);
35
- if (__getOwnPropSymbols)
36
- for (var prop of __getOwnPropSymbols(b)) {
37
- if (__propIsEnum.call(b, prop))
38
- __defNormalProp(a, prop, b[prop]);
39
- }
40
- return a;
41
- };
42
40
  const registerHook = __spreadValues(__spreadValues(__spreadValues({}, import_build.buildHooks), import_dev.devHooks), import_misc.miscHooks);
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ registerHook
44
+ });
43
45
 
44
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mBAA2B;AAC3B,iBAAyB;AACzB,kBAA0B;;;;;;;;;;;;;;;;;AAEnB,MAAM,eAAe,iDACvB,0BACA,sBACA;","names":[],"sources":["../../src/hooks/index.ts"],"sourcesContent":["import { buildHooks } from './build';\nimport { devHooks } from './dev';\nimport { miscHooks } from './misc';\n\nexport const registerHook = {\n ...buildHooks,\n ...devHooks,\n ...miscHooks,\n};\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAC3B,iBAAyB;AACzB,kBAA0B;AAEnB,MAAM,eAAe,iDACvB,0BACA,sBACA;;;;;","names":[],"sources":["../../src/hooks/index.ts"],"sourcesContent":["import { buildHooks } from './build';\nimport { devHooks } from './dev';\nimport { miscHooks } from './misc';\n\nexport const registerHook = {\n ...buildHooks,\n ...devHooks,\n ...miscHooks,\n};\n"]}
@@ -15,15 +15,19 @@ 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 misc_exports = {};
19
+ __export(misc_exports, {
20
20
  miscHooks: () => miscHooks
21
21
  });
22
- module.exports = __toCommonJS(stdin_exports);
22
+ module.exports = __toCommonJS(misc_exports);
23
23
  var import_plugin = require("@modern-js/plugin");
24
24
  const miscHooks = {
25
25
  addRuntimeExports: (0, import_plugin.createAsyncWaterfall)(),
26
26
  modifyLibuild: (0, import_plugin.createAsyncPipeline)()
27
27
  };
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ miscHooks
31
+ });
28
32
 
29
33
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0D;AAGnD,MAAM,YAAY;AAAA,EACvB,uBAAmB,oCAAqB;AAAA,EACxC,mBAAe,mCAA0C;AAC3D;","names":[],"sources":["../../src/hooks/misc.ts"],"sourcesContent":["import { createAsyncPipeline, createAsyncWaterfall } from '@modern-js/plugin';\nimport type { CLIConfig } from '@modern-js/libuild';\n\nexport const miscHooks = {\n addRuntimeExports: createAsyncWaterfall(),\n modifyLibuild: createAsyncPipeline<CLIConfig, CLIConfig>(),\n};\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0D;AAGnD,MAAM,YAAY;AAAA,EACvB,uBAAmB,oCAAqB;AAAA,EACxC,mBAAe,mCAA0C;AAC3D;;;;;","names":[],"sources":["../../src/hooks/misc.ts"],"sourcesContent":["import { createAsyncPipeline, createAsyncWaterfall } from '@modern-js/plugin';\nimport type { CLIConfig } from '@modern-js/libuild';\n\nexport const miscHooks = {\n addRuntimeExports: createAsyncWaterfall(),\n modifyLibuild: createAsyncPipeline<CLIConfig, CLIConfig>(),\n};\n"]}
package/dist/index.js CHANGED
@@ -16,17 +16,22 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var stdin_exports = {};
20
- __export(stdin_exports, {
19
+ var src_exports = {};
20
+ __export(src_exports, {
21
21
  default: () => src_default,
22
22
  defineConfig: () => import_defineConfig.defineConfig,
23
23
  legacyPresets: () => import_legacy_build_presets.legacyPresets
24
24
  });
25
- module.exports = __toCommonJS(stdin_exports);
25
+ module.exports = __toCommonJS(src_exports);
26
26
  var import_cli = require("./cli");
27
27
  var import_defineConfig = require("./config/defineConfig");
28
28
  var import_legacy_build_presets = require("./constants/legacy-build-presets");
29
- __reExport(stdin_exports, require("./types"), module.exports);
29
+ __reExport(src_exports, require("./types"), module.exports);
30
30
  var src_default = import_cli.cli;
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ defineConfig,
34
+ legacyPresets
35
+ });
31
36
 
32
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAoB;AAEpB,0BAA6B;AAC7B,kCAA8B;AAC9B,0BAAc,oBAJd;AAKA,IAAO,cAAQ;","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { cli } from './cli';\n\nexport { defineConfig } from './config/defineConfig';\nexport { legacyPresets } from './constants/legacy-build-presets';\nexport * from './types';\nexport default cli;\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAoB;AAEpB,0BAA6B;AAC7B,kCAA8B;AAC9B,wBAAc,oBAJd;AAKA,IAAO,cAAQ;;;;;;","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { cli } from './cli';\n\nexport { defineConfig } from './config/defineConfig';\nexport { legacyPresets } from './constants/legacy-build-presets';\nexport * from './types';\nexport default cli;\n"]}
@@ -13,6 +13,7 @@ export declare const EN_LOCALE: {
13
13
  };
14
14
  dev: {
15
15
  describe: string;
16
+ tsconfig: string;
16
17
  };
17
18
  new: {
18
19
  describe: string;
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: {
@@ -33,7 +33,10 @@ const EN_LOCALE = {
33
33
  no_clear: "disable auto clear dist dir",
34
34
  config: "specify config file"
35
35
  },
36
- dev: { describe: "start dev server" },
36
+ dev: {
37
+ describe: "start dev server",
38
+ tsconfig: "Specify a path to the tsconfig.json file"
39
+ },
37
40
  new: {
38
41
  describe: "generator runner for modern project",
39
42
  debug: "using debug mode to log something",
@@ -43,5 +46,9 @@ const EN_LOCALE = {
43
46
  }
44
47
  }
45
48
  };
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ EN_LOCALE
52
+ });
46
53
 
47
54
  //# 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;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,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: {\n describe: 'start dev server',\n tsconfig: 'Specify a path to the tsconfig.json file',\n },\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"]}
@@ -14,6 +14,7 @@ declare const localeKeys: {
14
14
  };
15
15
  dev: {
16
16
  describe: string;
17
+ tsconfig: string;
17
18
  };
18
19
  new: {
19
20
  describe: string;
@@ -38,6 +39,7 @@ declare const localeKeys: {
38
39
  };
39
40
  dev: {
40
41
  describe: string;
42
+ tsconfig: string;
41
43
  };
42
44
  new: {
43
45
  describe: string;
@@ -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"]}
@@ -13,6 +13,7 @@ export declare const ZH_LOCALE: {
13
13
  };
14
14
  dev: {
15
15
  describe: string;
16
+ tsconfig: string;
16
17
  };
17
18
  new: {
18
19
  describe: string;
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: {
@@ -33,7 +33,10 @@ const ZH_LOCALE = {
33
33
  no_clear: "不清理产物目录",
34
34
  config: "指定配置文件路径,可以为相对路径或绝对路径"
35
35
  },
36
- dev: { describe: "本地开发命令" },
36
+ dev: {
37
+ describe: "本地开发命令",
38
+ tsconfig: "指定 tsconfig.json 文件的路径"
39
+ },
37
40
  new: {
38
41
  describe: "模块化工程方案中执行生成器",
39
42
  debug: "开启 Debug 模式,打印调试日志信息",
@@ -43,5 +46,9 @@ const ZH_LOCALE = {
43
46
  }
44
47
  }
45
48
  };
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ ZH_LOCALE
52
+ });
46
53
 
47
54
  //# 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;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,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: {\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 },\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"]}
@@ -1,8 +1,9 @@
1
1
  export interface DevCommandOptions {
2
2
  port?: string;
3
+ tsconfig: string;
3
4
  }
4
5
  export interface BuildCommandOptions {
5
- config: string;
6
+ config?: string;
6
7
  clear?: boolean;
7
8
  dts?: boolean;
8
9
  platform?: boolean | string[];
@@ -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 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,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 | {
@@ -48,7 +45,7 @@ export declare type PartialBaseBuildConfig = {
48
45
  copy?: CopyConfig;
49
46
  asset?: Asset;
50
47
  jsx?: JSX;
51
- outdir?: string;
48
+ outDir?: string;
52
49
  alias?: AliasOption;
53
50
  input?: Input;
54
51
  platform?: LibuildUserConfig['platform'];
@@ -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"]}
@@ -16,10 +16,10 @@ export interface BuildResult {
16
16
  }
17
17
  export interface BuildPlatformResult {
18
18
  status: 'success' | 'fail';
19
- message: string;
19
+ message: string | Error | null;
20
20
  }
21
21
  export declare type DevToolData = BaseDevToolData<DevCommandOptions>;
22
22
  export declare type PromptResult = {
23
- choiceDevTool: string | symbol;
23
+ choiceDevTool: string;
24
24
  } & Record<string, any>;
25
25
  export declare type ModuleToolsHooks = typeof registerHook;
@@ -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 | 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"]}