@modern-js/app-tools 1.8.2 → 1.15.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,74 @@
1
1
  # @modern-js/app-tools
2
2
 
3
+ ## 1.15.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d85a20d: fix(app-tools): should not modify entry when using disableDefaultEntries
8
+
9
+ fix(app-tools): 修复开启 disableDefaultEntries 后 entry 名称被修改的问题
10
+
11
+ - 37cd159: feat(webpack): log more detailed error messages
12
+ - Updated dependencies [8658a78]
13
+ - Updated dependencies [0df4970]
14
+ - Updated dependencies [05d4a4f]
15
+ - Updated dependencies [b1f7000]
16
+ - Updated dependencies [ad05af9]
17
+ - Updated dependencies [5d53d1c]
18
+ - Updated dependencies [c087148]
19
+ - Updated dependencies [37cd159]
20
+ - @modern-js/utils@1.15.0
21
+ - @modern-js/webpack@1.15.0
22
+ - @modern-js/server@1.15.0
23
+ - @modern-js/types@1.15.0
24
+ - @modern-js/prod-server@1.15.0
25
+ - @modern-js/new-action@1.15.0
26
+ - @modern-js/core@1.15.0
27
+ - @modern-js/plugin-i18n@1.15.0
28
+ - @modern-js/plugin-jarvis@1.15.0
29
+ - @modern-js/node-bundle-require@1.15.0
30
+ - @modern-js/plugin@1.15.0
31
+
32
+ ## 1.8.4
33
+
34
+ ### Patch Changes
35
+
36
+ - 3c20a5e: fix: `@modern-js/app-tools` export fields
37
+
38
+ fix: 修复 `@modern-js/app-tools` 导出字段路径
39
+
40
+ - Updated dependencies [79e83ef]
41
+ - Updated dependencies [5f1a231]
42
+ - Updated dependencies [3c20a5e]
43
+ - Updated dependencies [22f4dca]
44
+ - Updated dependencies [7b9067f]
45
+ - @modern-js/utils@1.9.0
46
+ - @modern-js/webpack@1.12.4
47
+ - @modern-js/node-bundle-require@1.3.8
48
+ - @modern-js/core@1.14.0
49
+ - @modern-js/plugin-jarvis@1.2.14
50
+ - @modern-js/prod-server@1.2.2
51
+ - @modern-js/server@1.6.0
52
+
53
+ ## 1.8.3
54
+
55
+ ### Patch Changes
56
+
57
+ - f4822c0: feat(app-tools): start and inspect command support specify config file
58
+
59
+ feat(app-tools): start 和 inspect 命令支持指定配置文件
60
+
61
+ - Updated dependencies [4f1889d]
62
+ - Updated dependencies [c423820]
63
+ - Updated dependencies [f4822c0]
64
+ - @modern-js/utils@1.8.1
65
+ - @modern-js/types@1.6.2
66
+ - @modern-js/core@1.13.3
67
+ - @modern-js/webpack@1.12.3
68
+ - @modern-js/prod-server@1.2.2
69
+ - @modern-js/server@1.6.0
70
+ - @modern-js/plugin-jarvis@1.2.14
71
+
3
72
  ## 1.8.2
4
73
 
5
74
  ### Patch Changes
@@ -59,14 +59,17 @@ export const getBundleEntry = (appContext, config) => {
59
59
  defaults.push(entrypoint);
60
60
  }
61
61
  });
62
- } // find main entry point which server route is '/'.
62
+ }
63
63
 
64
+ if (!disableDefaultEntries) {
65
+ // find main entry point which server route is '/'.
66
+ const entriesDirAbs = ensureAbsolutePath(appDirectory, entriesDir);
67
+ const found = defaults.find(({
68
+ entryName,
69
+ entry
70
+ }) => entryName === packageName || path.dirname(entry) === entriesDirAbs);
71
+ found && (found.entryName = MAIN_ENTRY_NAME);
72
+ }
64
73
 
65
- const entriesDirAbs = ensureAbsolutePath(appDirectory, entriesDir);
66
- const found = defaults.find(({
67
- entryName,
68
- entry
69
- }) => entryName === packageName || path.dirname(entry) === entriesDirAbs);
70
- found && (found.entryName = MAIN_ENTRY_NAME);
71
74
  return defaults;
72
75
  };
@@ -42,7 +42,7 @@ export default (() => ({
42
42
 
43
43
  process.exit(0);
44
44
  });
45
- program.command('start').usage('[options]').description(i18n.t(localeKeys.command.start.describe)).option('--api-only', i18n.t(localeKeys.command.dev.apiOnly)).action(async () => {
45
+ program.command('start').usage('[options]').description(i18n.t(localeKeys.command.start.describe)).option('--api-only', i18n.t(localeKeys.command.dev.apiOnly)).option('-c --config <config>', i18n.t(localeKeys.command.shared.config)).action(async () => {
46
46
  const {
47
47
  start
48
48
  } = await import("./commands/start");
@@ -68,7 +68,7 @@ export default (() => ({
68
68
  locale
69
69
  }));
70
70
  });
71
- program.command('inspect').description('inspect internal webpack config').option(`--env <env>`, i18n.t(localeKeys.command.inspect.env), 'development').option('--output <output>', i18n.t(localeKeys.command.inspect.output), '/').option('--no-console', i18n.t(localeKeys.command.inspect.noConsole)).option('--verbose', i18n.t(localeKeys.command.inspect.verbose)).action(async options => {
71
+ program.command('inspect').description('inspect internal webpack config').option(`--env <env>`, i18n.t(localeKeys.command.inspect.env), 'development').option('--output <output>', i18n.t(localeKeys.command.inspect.output), '/').option('--no-console', i18n.t(localeKeys.command.inspect.noConsole)).option('--verbose', i18n.t(localeKeys.command.inspect.verbose)).option('-c --config <config>', i18n.t(localeKeys.command.shared.config)).action(async options => {
72
72
  const {
73
73
  inspect
74
74
  } = await import("./commands/inspect");
@@ -24,10 +24,7 @@ export const createCompiler = async ({
24
24
  });
25
25
  compiler.hooks.done.tap('done', async stats => {
26
26
  const statsData = stats.toJson({
27
- all: false,
28
- warnings: true,
29
- errors: true,
30
- timings: true
27
+ preset: 'errors-warnings'
31
28
  });
32
29
  const {
33
30
  errors,
@@ -71,15 +71,18 @@ const getBundleEntry = (appContext, config) => {
71
71
  defaults.push(entrypoint);
72
72
  }
73
73
  });
74
- } // find main entry point which server route is '/'.
74
+ }
75
75
 
76
+ if (!disableDefaultEntries) {
77
+ // find main entry point which server route is '/'.
78
+ const entriesDirAbs = (0, _utils.ensureAbsolutePath)(appDirectory, entriesDir);
79
+ const found = defaults.find(({
80
+ entryName,
81
+ entry
82
+ }) => entryName === packageName || _path.default.dirname(entry) === entriesDirAbs);
83
+ found && (found.entryName = _utils.MAIN_ENTRY_NAME);
84
+ }
76
85
 
77
- const entriesDirAbs = (0, _utils.ensureAbsolutePath)(appDirectory, entriesDir);
78
- const found = defaults.find(({
79
- entryName,
80
- entry
81
- }) => entryName === packageName || _path.default.dirname(entry) === entriesDirAbs);
82
- found && (found.entryName = _utils.MAIN_ENTRY_NAME);
83
86
  return defaults;
84
87
  };
85
88
 
@@ -70,7 +70,7 @@ var _default = () => ({
70
70
 
71
71
  process.exit(0);
72
72
  });
73
- program.command('start').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.start.describe)).option('--api-only', _locale.i18n.t(_locale.localeKeys.command.dev.apiOnly)).action(async () => {
73
+ program.command('start').usage('[options]').description(_locale.i18n.t(_locale.localeKeys.command.start.describe)).option('--api-only', _locale.i18n.t(_locale.localeKeys.command.dev.apiOnly)).option('-c --config <config>', _locale.i18n.t(_locale.localeKeys.command.shared.config)).action(async () => {
74
74
  const {
75
75
  start
76
76
  } = await Promise.resolve().then(() => _interopRequireWildcard(require("./commands/start")));
@@ -96,7 +96,7 @@ var _default = () => ({
96
96
  locale
97
97
  }));
98
98
  });
99
- program.command('inspect').description('inspect internal webpack config').option(`--env <env>`, _locale.i18n.t(_locale.localeKeys.command.inspect.env), 'development').option('--output <output>', _locale.i18n.t(_locale.localeKeys.command.inspect.output), '/').option('--no-console', _locale.i18n.t(_locale.localeKeys.command.inspect.noConsole)).option('--verbose', _locale.i18n.t(_locale.localeKeys.command.inspect.verbose)).action(async options => {
99
+ program.command('inspect').description('inspect internal webpack config').option(`--env <env>`, _locale.i18n.t(_locale.localeKeys.command.inspect.env), 'development').option('--output <output>', _locale.i18n.t(_locale.localeKeys.command.inspect.output), '/').option('--no-console', _locale.i18n.t(_locale.localeKeys.command.inspect.noConsole)).option('--verbose', _locale.i18n.t(_locale.localeKeys.command.inspect.verbose)).option('-c --config <config>', _locale.i18n.t(_locale.localeKeys.command.shared.config)).action(async options => {
100
100
  const {
101
101
  inspect
102
102
  } = await Promise.resolve().then(() => _interopRequireWildcard(require("./commands/inspect")));
@@ -35,10 +35,7 @@ const createCompiler = async ({
35
35
  });
36
36
  compiler.hooks.done.tap('done', async stats => {
37
37
  const statsData = stats.toJson({
38
- all: false,
39
- warnings: true,
40
- errors: true,
41
- timings: true
38
+ preset: 'errors-warnings'
42
39
  });
43
40
  const {
44
41
  errors,
@@ -3,5 +3,5 @@ import type { PluginAPI, NormalizedConfig, IAppContext } from '@modern-js/core';
3
3
  import type { InspectOptions } from '../utils/types';
4
4
  export declare const formatWebpackConfig: (config: Configuration, verbose?: boolean) => string;
5
5
  export declare const inspect: (api: PluginAPI, options: InspectOptions) => void;
6
- export declare const getTagByWebpackTarget: (webpackTarget: WebpackConfigTarget) => "modern" | "client" | "ssr";
6
+ export declare const getTagByWebpackTarget: (webpackTarget: WebpackConfigTarget) => "client" | "modern" | "ssr";
7
7
  export declare const printInspectResult: (webpackTarget: WebpackConfigTarget, appContext: IAppContext, resolvedConfig: NormalizedConfig, options: InspectOptions) => string;
package/package.json CHANGED
@@ -11,11 +11,10 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.8.2",
14
+ "version": "1.15.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
18
- "module": "./dist/js/treeshaking/index.js",
19
18
  "jsnext:modern": "./dist/js/modern/index.js",
20
19
  "exports": {
21
20
  ".": {
@@ -24,7 +23,7 @@
24
23
  "import": "./dist/js/modern/index.js",
25
24
  "require": "./dist/js/node/index.js"
26
25
  },
27
- "default": "./dist/js/treeshaking/index.js"
26
+ "default": "./dist/js/node/index.js"
28
27
  },
29
28
  "./cli": {
30
29
  "jsnext:source": "./src/index.ts",
@@ -57,26 +56,26 @@
57
56
  },
58
57
  "dependencies": {
59
58
  "@babel/runtime": "^7.18.0",
60
- "@modern-js/core": "^1.13.2",
61
- "@modern-js/new-action": "^1.4.0",
62
- "@modern-js/node-bundle-require": "^1.3.7",
63
- "@modern-js/plugin": "^1.4.1",
64
- "@modern-js/plugin-i18n": "^1.3.0",
65
- "@modern-js/plugin-jarvis": "^1.2.14",
66
- "@modern-js/prod-server": "^1.2.2",
67
- "@modern-js/server": "^1.6.0",
68
- "@modern-js/types": "^1.6.1",
69
- "@modern-js/utils": "^1.8.0",
70
- "@modern-js/webpack": "^1.12.3",
59
+ "@modern-js/core": "1.15.0",
60
+ "@modern-js/new-action": "1.15.0",
61
+ "@modern-js/node-bundle-require": "1.15.0",
62
+ "@modern-js/plugin": "1.15.0",
63
+ "@modern-js/plugin-i18n": "1.15.0",
64
+ "@modern-js/plugin-jarvis": "1.15.0",
65
+ "@modern-js/prod-server": "1.15.0",
66
+ "@modern-js/server": "1.15.0",
67
+ "@modern-js/types": "1.15.0",
68
+ "@modern-js/utils": "1.15.0",
69
+ "@modern-js/webpack": "1.15.0",
71
70
  "@babel/parser": "^7.18.0",
72
71
  "@babel/traverse": "^7.18.0",
73
72
  "@babel/types": "^7.18.0"
74
73
  },
75
74
  "devDependencies": {
76
- "@modern-js/server-core": "1.4.1",
75
+ "@modern-js/server-core": "1.15.0",
77
76
  "@types/babel__traverse": "^7.14.2",
78
- "@scripts/build": "0.0.0",
79
- "@scripts/jest-config": "0.0.0",
77
+ "@scripts/build": "1.15.0",
78
+ "@scripts/jest-config": "1.15.0",
80
79
  "@types/jest": "^27",
81
80
  "@types/node": "^14",
82
81
  "@types/react": "^17",