@modern-js/app-tools 1.8.0 → 1.8.3
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,50 @@
|
|
|
1
1
|
# @modern-js/app-tools
|
|
2
2
|
|
|
3
|
+
## 1.8.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f4822c0: feat(app-tools): start and inspect command support specify config file
|
|
8
|
+
|
|
9
|
+
feat(app-tools): start 和 inspect 命令支持指定配置文件
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [4f1889d]
|
|
12
|
+
- Updated dependencies [c423820]
|
|
13
|
+
- Updated dependencies [f4822c0]
|
|
14
|
+
- @modern-js/utils@1.8.1
|
|
15
|
+
- @modern-js/types@1.6.2
|
|
16
|
+
- @modern-js/core@1.13.3
|
|
17
|
+
- @modern-js/webpack@1.12.3
|
|
18
|
+
- @modern-js/prod-server@1.2.2
|
|
19
|
+
- @modern-js/server@1.6.0
|
|
20
|
+
- @modern-js/plugin-jarvis@1.2.14
|
|
21
|
+
|
|
22
|
+
## 1.8.2
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 44e3bb1: feat: support response headers
|
|
27
|
+
feat: 支持设置响应头
|
|
28
|
+
- Updated dependencies [0e28456]
|
|
29
|
+
- Updated dependencies [bfc1264]
|
|
30
|
+
- Updated dependencies [9a173a7]
|
|
31
|
+
- Updated dependencies [44e3bb1]
|
|
32
|
+
- @modern-js/prod-server@1.2.2
|
|
33
|
+
- @modern-js/core@1.13.2
|
|
34
|
+
- @modern-js/webpack@1.12.3
|
|
35
|
+
- @modern-js/types@1.6.1
|
|
36
|
+
- @modern-js/plugin-jarvis@1.2.14
|
|
37
|
+
- @modern-js/server@1.6.0
|
|
38
|
+
- @modern-js/utils@1.8.0
|
|
39
|
+
|
|
40
|
+
## 1.8.1
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- 102b5e098: fix: fix not found `analyze/cli` when change config
|
|
45
|
+
|
|
46
|
+
fix: 修复修改配置重启时找不到 `analyze/cli`
|
|
47
|
+
|
|
3
48
|
## 1.8.0
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
|
@@ -124,13 +124,18 @@ const collectHtmlRoutes = (entrypoints, appContext, config) => {
|
|
|
124
124
|
let htmlRoutes = entrypoints.reduce((previous, {
|
|
125
125
|
entryName
|
|
126
126
|
}) => {
|
|
127
|
-
const
|
|
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
|
};
|
package/dist/js/modern/index.js
CHANGED
|
@@ -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");
|
|
@@ -99,7 +99,7 @@ export default (() => ({
|
|
|
99
99
|
},
|
|
100
100
|
|
|
101
101
|
async beforeRestart() {
|
|
102
|
-
cleanRequireCache([require.resolve("./analyze
|
|
102
|
+
cleanRequireCache([require.resolve("./analyze")]);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
};
|
|
@@ -136,13 +136,18 @@ const collectHtmlRoutes = (entrypoints, appContext, config) => {
|
|
|
136
136
|
let htmlRoutes = entrypoints.reduce((previous, {
|
|
137
137
|
entryName
|
|
138
138
|
}) => {
|
|
139
|
-
const
|
|
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
|
};
|
package/dist/js/node/index.js
CHANGED
|
@@ -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")));
|
|
@@ -128,7 +128,7 @@ var _default = () => ({
|
|
|
128
128
|
},
|
|
129
129
|
|
|
130
130
|
async beforeRestart() {
|
|
131
|
-
(0, _utils.cleanRequireCache)([require.resolve("./analyze
|
|
131
|
+
(0, _utils.cleanRequireCache)([require.resolve("./analyze")]);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.8.
|
|
14
|
+
"version": "1.8.3",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@babel/runtime": "^7.18.0",
|
|
60
|
-
"@modern-js/core": "^1.13.
|
|
60
|
+
"@modern-js/core": "^1.13.3",
|
|
61
61
|
"@modern-js/new-action": "^1.4.0",
|
|
62
62
|
"@modern-js/node-bundle-require": "^1.3.7",
|
|
63
63
|
"@modern-js/plugin": "^1.4.1",
|
|
64
64
|
"@modern-js/plugin-i18n": "^1.3.0",
|
|
65
65
|
"@modern-js/plugin-jarvis": "^1.2.14",
|
|
66
|
-
"@modern-js/prod-server": "^1.2.
|
|
66
|
+
"@modern-js/prod-server": "^1.2.2",
|
|
67
67
|
"@modern-js/server": "^1.6.0",
|
|
68
|
-
"@modern-js/types": "^1.6.
|
|
69
|
-
"@modern-js/utils": "^1.8.
|
|
70
|
-
"@modern-js/webpack": "^1.12.
|
|
68
|
+
"@modern-js/types": "^1.6.2",
|
|
69
|
+
"@modern-js/utils": "^1.8.1",
|
|
70
|
+
"@modern-js/webpack": "^1.12.3",
|
|
71
71
|
"@babel/parser": "^7.18.0",
|
|
72
72
|
"@babel/traverse": "^7.18.0",
|
|
73
73
|
"@babel/types": "^7.18.0"
|