@modern-js/core 1.15.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @modern-js/core
2
2
 
3
+ ## 1.18.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 60a2e3a: feat: add compiler option for server
8
+ feat: 为 server 添加编译选项
9
+ - 66ad36f: feat: add source.enableAsyncEntry config
10
+
11
+ feat: 新增 source.enableAsyncEntry 配置项
12
+
13
+ - Updated dependencies [8280920]
14
+ - Updated dependencies [5227370]
15
+ - Updated dependencies [7928bae]
16
+ - @modern-js/utils@1.18.0
17
+ - @modern-js/node-bundle-require@1.18.0
18
+ - @modern-js/plugin@1.18.0
19
+
20
+ ## 1.17.0
21
+
22
+ ### Patch Changes
23
+
24
+ - 367405a: fix(core): missing BabelConfig type
25
+
26
+ fix(core): 修复未导出 BabelConfig 类型的问题
27
+
28
+ - 9f4e5ce: fix(core): cli -c option not work
29
+
30
+ fix(core): 修复命令行中 -c 选项不生效的问题
31
+
32
+ - 58c53a7: fix: add merge check
33
+ fix: 添加合并属性的检查
34
+ - Updated dependencies [1b9176f]
35
+ - Updated dependencies [77d3a38]
36
+ - Updated dependencies [151329d]
37
+ - Updated dependencies [5af9472]
38
+ - Updated dependencies [6b6a534]
39
+ - Updated dependencies [6b43a2b]
40
+ - Updated dependencies [a7be124]
41
+ - Updated dependencies [31547b4]
42
+ - @modern-js/utils@1.17.0
43
+ - @modern-js/node-bundle-require@1.17.0
44
+ - @modern-js/plugin@1.17.0
45
+
46
+ ## 1.16.0
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [641592f52]
51
+ - Updated dependencies [3904b30a5]
52
+ - Updated dependencies [1100dd58c]
53
+ - Updated dependencies [e04e6e76a]
54
+ - Updated dependencies [81c66e4a4]
55
+ - Updated dependencies [2c305b6f5]
56
+ - @modern-js/utils@1.16.0
57
+ - @modern-js/node-bundle-require@1.16.0
58
+ - @modern-js/plugin@1.16.0
59
+
3
60
  ## 1.15.0
4
61
 
5
62
  ### Patch Changes
@@ -17,7 +74,7 @@
17
74
 
18
75
  ### Minor Changes
19
76
 
20
- - 7b9067f: add babel plugin for web builder
77
+ - 7b9067f: add babel plugin for webpack-builder
21
78
 
22
79
  ### Patch Changes
23
80
 
package/dist/bin.js CHANGED
@@ -34,7 +34,8 @@ const SUPPORT_CONFIG_PARAM_COMMANDS = [
34
34
  'start',
35
35
  'inspect',
36
36
  ];
37
- if (SUPPORT_CONFIG_PARAM_COMMANDS.includes(command) && cliParams.config) {
38
- runOptions.configFile = cliParams.config;
37
+ const customConfigFile = cliParams.config || cliParams.c;
38
+ if (SUPPORT_CONFIG_PARAM_COMMANDS.includes(command) && customConfigFile) {
39
+ runOptions.configFile = customConfigFile;
39
40
  }
40
41
  _1.cli.run(process.argv.slice(2), runOptions);
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaults = void 0;
4
4
  const sourceDefaults = {
5
5
  entries: undefined,
6
+ enableAsyncEntry: false,
6
7
  disableDefaultEntries: false,
7
8
  entriesDir: './src',
8
9
  configDir: './config',
@@ -12,8 +12,8 @@ const utils_1 = require("@modern-js/utils");
12
12
  const mergeConfig = (configs) => (0, lodash_1.mergeWith)({}, ...configs, (target, source, key) => {
13
13
  // Do not use the following merge logic for source.designSystem and tools.tailwind(css)
14
14
  if (key === 'designSystem' ||
15
- key === 'tailwind' ||
16
- key === 'tailwindcss' ||
15
+ (key === 'tailwind' && typeof source === 'object') ||
16
+ (key === 'tailwindcss' && typeof source === 'object') ||
17
17
  key === 'devServer') {
18
18
  return (0, lodash_1.mergeWith)({}, target !== null && target !== void 0 ? target : {}, source !== null && source !== void 0 ? source : {});
19
19
  }
@@ -45,6 +45,9 @@ export declare const patchSchema: (pluginSchemas: Array<PluginValidateSchema | P
45
45
  alias: {
46
46
  typeof: string[];
47
47
  };
48
+ enableAsyncEntry: {
49
+ type: string;
50
+ };
48
51
  disableDefaultEntries: {
49
52
  type: string;
50
53
  };
@@ -400,6 +403,9 @@ export declare const patchSchema: (pluginSchemas: Array<PluginValidateSchema | P
400
403
  watchOptions: {
401
404
  type: string;
402
405
  };
406
+ compiler: {
407
+ type: string;
408
+ };
403
409
  };
404
410
  };
405
411
  deploy: {
@@ -184,5 +184,8 @@ export declare const server: {
184
184
  watchOptions: {
185
185
  type: string;
186
186
  };
187
+ compiler: {
188
+ type: string;
189
+ };
187
190
  };
188
191
  };
@@ -105,5 +105,6 @@ exports.server = {
105
105
  proxy: { type: 'object' },
106
106
  enableMicroFrontendDebug: { type: 'boolean' },
107
107
  watchOptions: { type: 'object' },
108
+ compiler: { type: 'string' },
108
109
  },
109
110
  };
@@ -36,6 +36,9 @@ export declare const source: {
36
36
  alias: {
37
37
  typeof: string[];
38
38
  };
39
+ enableAsyncEntry: {
40
+ type: string;
41
+ };
39
42
  disableDefaultEntries: {
40
43
  type: string;
41
44
  };
@@ -26,6 +26,7 @@ exports.source = {
26
26
  },
27
27
  preEntry: { type: ['string', 'array'] },
28
28
  alias: { typeof: ['object', 'function'] },
29
+ enableAsyncEntry: { type: 'boolean' },
29
30
  disableDefaultEntries: { type: 'boolean' },
30
31
  envVars: { type: 'array' },
31
32
  globalVars: { type: 'object' },
@@ -23,7 +23,7 @@ declare type AutoprefixerOptions = autoprefixer.Options;
23
23
  declare type TerserOptions = BasePluginOptions & {
24
24
  terserOptions?: Partial<RawTerserOptions>;
25
25
  };
26
- export type { TestConfig, JestConfig, UnbundleConfig, SassConfig, SassLoaderOptions, LessConfig, LessLoaderOptions, SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions, TransformOptions, AutoprefixerOptions, TerserOptions, };
26
+ export type { TestConfig, JestConfig, BabelConfig, UnbundleConfig, SassConfig, SassLoaderOptions, LessConfig, LessLoaderOptions, SSGConfig, SSGRouteOptions, SSGMultiEntryOptions, SSGSingleEntryOptions, TransformOptions, AutoprefixerOptions, TerserOptions, };
27
27
  export interface SourceConfig {
28
28
  entries?: Record<string, string | {
29
29
  entry: string;
@@ -31,6 +31,7 @@ export interface SourceConfig {
31
31
  disableMount?: boolean;
32
32
  }>;
33
33
  preEntry?: string | string[];
34
+ enableAsyncEntry?: boolean;
34
35
  disableDefaultEntries?: boolean;
35
36
  entriesDir?: string;
36
37
  configDir?: string;
@@ -119,6 +120,7 @@ export interface ServerConfig {
119
120
  metrics?: boolean | Record<string, any>;
120
121
  enableMicroFrontendDebug?: boolean;
121
122
  watchOptions?: WatchOptions;
123
+ compiler?: 'babel' | 'typescript';
122
124
  }
123
125
  export declare type DevProxyOptions = string | Record<string, string>;
124
126
  export interface DevConfig {
@@ -53,6 +53,10 @@ export interface Hooks {
53
53
  entrypoint: Entrypoint;
54
54
  code: string;
55
55
  }>;
56
+ modifyAsyncEntry: AsyncWaterfall<{
57
+ entrypoint: Entrypoint;
58
+ code: string;
59
+ }>;
56
60
  modifyFileSystemRoutes: AsyncWaterfall<{
57
61
  entrypoint: Entrypoint;
58
62
  routes: Route[];
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "modern",
11
11
  "modern.js"
12
12
  ],
13
- "version": "1.15.0",
13
+ "version": "1.18.0",
14
14
  "jsnext:source": "./src/index.ts",
15
15
  "types": "./dist/index.d.ts",
16
16
  "main": "./dist/index.js",
@@ -38,16 +38,16 @@
38
38
  }
39
39
  },
40
40
  "dependencies": {
41
- "@modern-js/node-bundle-require": "1.15.0",
42
- "@modern-js/plugin": "1.15.0",
43
- "@modern-js/utils": "1.15.0"
41
+ "@modern-js/node-bundle-require": "1.18.0",
42
+ "@modern-js/plugin": "1.18.0",
43
+ "@modern-js/utils": "1.18.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@jest/types": "^27.0.6",
47
- "@modern-js/babel-preset-app": "1.15.0",
48
- "@modern-js/types": "1.15.0",
49
- "@scripts/build": "1.15.0",
50
- "@scripts/jest-config": "1.15.0",
47
+ "@modern-js/babel-preset-app": "1.18.0",
48
+ "@modern-js/types": "1.18.0",
49
+ "@scripts/build": "1.18.0",
50
+ "@scripts/jest-config": "1.18.0",
51
51
  "@types/babel__code-frame": "^7.0.3",
52
52
  "@types/babel__core": "^7.1.16",
53
53
  "@types/jest": "^27",