@modern-js/app-tools 1.8.1 → 1.8.4

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,63 @@
1
1
  # @modern-js/app-tools
2
2
 
3
+ ## 1.8.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 3c20a5e: fix: `@modern-js/app-tools` export fields
8
+
9
+ fix: 修复 `@modern-js/app-tools` 导出字段路径
10
+
11
+ - Updated dependencies [79e83ef]
12
+ - Updated dependencies [5f1a231]
13
+ - Updated dependencies [3c20a5e]
14
+ - Updated dependencies [22f4dca]
15
+ - Updated dependencies [7b9067f]
16
+ - @modern-js/utils@1.9.0
17
+ - @modern-js/webpack@1.12.4
18
+ - @modern-js/node-bundle-require@1.3.8
19
+ - @modern-js/core@1.14.0
20
+ - @modern-js/plugin-jarvis@1.2.14
21
+ - @modern-js/prod-server@1.2.2
22
+ - @modern-js/server@1.6.0
23
+
24
+ ## 1.8.3
25
+
26
+ ### Patch Changes
27
+
28
+ - f4822c0: feat(app-tools): start and inspect command support specify config file
29
+
30
+ feat(app-tools): start 和 inspect 命令支持指定配置文件
31
+
32
+ - Updated dependencies [4f1889d]
33
+ - Updated dependencies [c423820]
34
+ - Updated dependencies [f4822c0]
35
+ - @modern-js/utils@1.8.1
36
+ - @modern-js/types@1.6.2
37
+ - @modern-js/core@1.13.3
38
+ - @modern-js/webpack@1.12.3
39
+ - @modern-js/prod-server@1.2.2
40
+ - @modern-js/server@1.6.0
41
+ - @modern-js/plugin-jarvis@1.2.14
42
+
43
+ ## 1.8.2
44
+
45
+ ### Patch Changes
46
+
47
+ - 44e3bb1: feat: support response headers
48
+ feat: 支持设置响应头
49
+ - Updated dependencies [0e28456]
50
+ - Updated dependencies [bfc1264]
51
+ - Updated dependencies [9a173a7]
52
+ - Updated dependencies [44e3bb1]
53
+ - @modern-js/prod-server@1.2.2
54
+ - @modern-js/core@1.13.2
55
+ - @modern-js/webpack@1.12.3
56
+ - @modern-js/types@1.6.1
57
+ - @modern-js/plugin-jarvis@1.2.14
58
+ - @modern-js/server@1.6.0
59
+ - @modern-js/utils@1.8.0
60
+
3
61
  ## 1.8.1
4
62
 
5
63
  ### Patch Changes
@@ -124,13 +124,18 @@ const collectHtmlRoutes = (entrypoints, appContext, config) => {
124
124
  let htmlRoutes = entrypoints.reduce((previous, {
125
125
  entryName
126
126
  }) => {
127
- const isSSR = Boolean(getEntryOptions(entryName, ssr, ssrByEntries, packageName));
127
+ const entryOptions = getEntryOptions(entryName, ssr, ssrByEntries, packageName);
128
+ const isSSR = Boolean(entryOptions);
129
+ const {
130
+ resHeaders
131
+ } = (routes === null || routes === void 0 ? void 0 : routes[entryName]) || {};
128
132
  let route = {
129
133
  urlPath: `/${entryName === MAIN_ENTRY_NAME ? '' : entryName}`,
130
134
  entryName,
131
135
  entryPath: removeLeadingSlash(path.posix.normalize(`${htmlPath}/${entryName}${disableHtmlFolder ? '.html' : '/index.html'}`)),
132
136
  isSPA: true,
133
137
  isSSR,
138
+ responseHeaders: resHeaders,
134
139
  enableModernMode: Boolean(enableModernMode),
135
140
  bundle: isSSR ? `${SERVER_BUNDLE_DIRECTORY}/${entryName}.js` : undefined
136
141
  };
@@ -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");
@@ -136,13 +136,18 @@ const collectHtmlRoutes = (entrypoints, appContext, config) => {
136
136
  let htmlRoutes = entrypoints.reduce((previous, {
137
137
  entryName
138
138
  }) => {
139
- const isSSR = Boolean((0, _utils.getEntryOptions)(entryName, ssr, ssrByEntries, packageName));
139
+ const entryOptions = (0, _utils.getEntryOptions)(entryName, ssr, ssrByEntries, packageName);
140
+ const isSSR = Boolean(entryOptions);
141
+ const {
142
+ resHeaders
143
+ } = (routes === null || routes === void 0 ? void 0 : routes[entryName]) || {};
140
144
  let route = {
141
145
  urlPath: `/${entryName === _utils.MAIN_ENTRY_NAME ? '' : entryName}`,
142
146
  entryName,
143
147
  entryPath: (0, _utils.removeLeadingSlash)(_path.default.posix.normalize(`${htmlPath}/${entryName}${disableHtmlFolder ? '.html' : '/index.html'}`)),
144
148
  isSPA: true,
145
149
  isSSR,
150
+ responseHeaders: resHeaders,
146
151
  enableModernMode: Boolean(enableModernMode),
147
152
  bundle: isSSR ? `${_utils.SERVER_BUNDLE_DIRECTORY}/${entryName}.js` : undefined
148
153
  };
@@ -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")));
@@ -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.1",
14
+ "version": "1.8.4",
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,17 +56,17 @@
57
56
  },
58
57
  "dependencies": {
59
58
  "@babel/runtime": "^7.18.0",
60
- "@modern-js/core": "^1.13.1",
59
+ "@modern-js/core": "^1.14.0",
61
60
  "@modern-js/new-action": "^1.4.0",
62
- "@modern-js/node-bundle-require": "^1.3.7",
61
+ "@modern-js/node-bundle-require": "^1.3.8",
63
62
  "@modern-js/plugin": "^1.4.1",
64
63
  "@modern-js/plugin-i18n": "^1.3.0",
65
64
  "@modern-js/plugin-jarvis": "^1.2.14",
66
- "@modern-js/prod-server": "^1.2.1",
65
+ "@modern-js/prod-server": "^1.2.2",
67
66
  "@modern-js/server": "^1.6.0",
68
- "@modern-js/types": "^1.6.0",
69
- "@modern-js/utils": "^1.8.0",
70
- "@modern-js/webpack": "^1.12.2",
67
+ "@modern-js/types": "^1.6.2",
68
+ "@modern-js/utils": "^1.9.0",
69
+ "@modern-js/webpack": "^1.12.4",
71
70
  "@babel/parser": "^7.18.0",
72
71
  "@babel/traverse": "^7.18.0",
73
72
  "@babel/types": "^7.18.0"