@modern-js/app-tools 2.2.0 → 2.3.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 +42 -0
- package/dist/js/modern/analyze/index.js +3 -2
- package/dist/js/modern/index.js +6 -2
- package/dist/js/modern/initialize/index.js +6 -2
- package/dist/js/node/analyze/index.js +2 -3
- package/dist/js/node/index.js +1 -2
- package/dist/js/node/initialize/index.js +1 -2
- package/dist/js/treeshaking/analyze/index.js +1 -2
- package/dist/js/treeshaking/index.js +1 -2
- package/dist/js/treeshaking/initialize/index.js +1 -2
- package/package.json +22 -22
- package/dist/js/modern/utils/commands.js +0 -13
- package/dist/js/node/utils/commands.js +0 -37
- package/dist/js/treeshaking/utils/commands.js +0 -10
- package/dist/types/utils/commands.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @modern-js/app-tools
|
|
2
2
|
|
|
3
|
+
## 2.3.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fd5a3ed: fix: failed to exit new command
|
|
8
|
+
|
|
9
|
+
fix: 修复 new 命令执行完成后未退出进程的问题
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [65f1322]
|
|
12
|
+
- Updated dependencies [7cd8185]
|
|
13
|
+
- Updated dependencies [fd5a3ed]
|
|
14
|
+
- Updated dependencies [362c9a8]
|
|
15
|
+
- Updated dependencies [67ba34a]
|
|
16
|
+
- Updated dependencies [2ad9fdf]
|
|
17
|
+
- Updated dependencies [7b2cdcb]
|
|
18
|
+
- Updated dependencies [1b0dd35]
|
|
19
|
+
- Updated dependencies [f9a26fe]
|
|
20
|
+
- Updated dependencies [6ca1c0b]
|
|
21
|
+
- Updated dependencies [89b6739]
|
|
22
|
+
- Updated dependencies [01e4a27]
|
|
23
|
+
- Updated dependencies [7736171]
|
|
24
|
+
- Updated dependencies [ff48fc2]
|
|
25
|
+
- Updated dependencies [b6c2eb8]
|
|
26
|
+
- Updated dependencies [3cdf48e]
|
|
27
|
+
- @modern-js/core@2.3.0
|
|
28
|
+
- @modern-js/builder@2.3.0
|
|
29
|
+
- @modern-js/builder-webpack-provider@2.3.0
|
|
30
|
+
- @modern-js/utils@2.3.0
|
|
31
|
+
- @modern-js/builder-shared@2.3.0
|
|
32
|
+
- @modern-js/server@2.3.0
|
|
33
|
+
- @modern-js/plugin-data-loader@2.3.0
|
|
34
|
+
- @modern-js/plugin-lint@2.3.0
|
|
35
|
+
- @modern-js/builder-plugin-esbuild@2.3.0
|
|
36
|
+
- @modern-js/builder-plugin-node-polyfill@2.3.0
|
|
37
|
+
- @modern-js/plugin-i18n@2.3.0
|
|
38
|
+
- @modern-js/new-action@2.3.0
|
|
39
|
+
- @modern-js/prod-server@2.3.0
|
|
40
|
+
- @modern-js/node-bundle-require@2.3.0
|
|
41
|
+
- @modern-js/upgrade@2.3.0
|
|
42
|
+
- @modern-js/plugin@2.3.0
|
|
43
|
+
- @modern-js/types@2.3.0
|
|
44
|
+
|
|
3
45
|
## 2.2.0
|
|
4
46
|
|
|
5
47
|
### Minor Changes
|
|
@@ -44,14 +44,15 @@ import {
|
|
|
44
44
|
fs,
|
|
45
45
|
getEntryOptions,
|
|
46
46
|
isApiOnly,
|
|
47
|
-
minimist
|
|
47
|
+
minimist,
|
|
48
|
+
getCommand,
|
|
49
|
+
isDevCommand
|
|
48
50
|
} from "@modern-js/utils";
|
|
49
51
|
import { cloneDeep } from "@modern-js/utils/lodash";
|
|
50
52
|
import { createBuilderForModern } from "../builder";
|
|
51
53
|
import { printInstructions } from "../utils/printInstructions";
|
|
52
54
|
import { generateRoutes } from "../utils/routes";
|
|
53
55
|
import { emitResolvedConfig } from "../utils/config";
|
|
54
|
-
import { getCommand, isDevCommand } from "../utils/commands";
|
|
55
56
|
import { getSelectedEntries } from "../utils/getSelectedEntries";
|
|
56
57
|
import { initialNormalizedConfig } from "../config";
|
|
57
58
|
import {
|
package/dist/js/modern/index.js
CHANGED
|
@@ -39,14 +39,18 @@ var __async = (__this, __arguments, generator) => {
|
|
|
39
39
|
};
|
|
40
40
|
import path from "path";
|
|
41
41
|
import lintPlugin from "@modern-js/plugin-lint";
|
|
42
|
-
import {
|
|
42
|
+
import {
|
|
43
|
+
cleanRequireCache,
|
|
44
|
+
emptyDir,
|
|
45
|
+
Import,
|
|
46
|
+
getCommand
|
|
47
|
+
} from "@modern-js/utils";
|
|
43
48
|
import { castArray } from "@modern-js/utils/lodash";
|
|
44
49
|
import analyzePlugin from "./analyze";
|
|
45
50
|
import initializePlugin from "./initialize";
|
|
46
51
|
import { hooks } from "./hooks";
|
|
47
52
|
import { i18n, localeKeys } from "./locale";
|
|
48
53
|
import { getLocaleLanguage } from "./utils/language";
|
|
49
|
-
import { getCommand } from "./utils/commands";
|
|
50
54
|
import { restart } from "./utils/restart";
|
|
51
55
|
import { generateWatchFiles } from "./utils/generateWatchFiles";
|
|
52
56
|
export * from "./defineConfig";
|
|
@@ -37,9 +37,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
37
37
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
ensureAbsolutePath,
|
|
42
|
+
getPort,
|
|
43
|
+
isDev,
|
|
44
|
+
isDevCommand
|
|
45
|
+
} from "@modern-js/utils";
|
|
41
46
|
import { legacySchema, schema } from "../schema";
|
|
42
|
-
import { isDevCommand } from "../utils/commands";
|
|
43
47
|
import { transformNormalizedConfig } from "../config/initial/transformNormalizedConfig";
|
|
44
48
|
import {
|
|
45
49
|
checkIsLegacyConfig,
|
|
@@ -70,7 +70,6 @@ var import_builder = require("../builder");
|
|
|
70
70
|
var import_printInstructions = require("../utils/printInstructions");
|
|
71
71
|
var import_routes = require("../utils/routes");
|
|
72
72
|
var import_config = require("../utils/config");
|
|
73
|
-
var import_commands = require("../utils/commands");
|
|
74
73
|
var import_getSelectedEntries = require("../utils/getSelectedEntries");
|
|
75
74
|
var import_config2 = require("../config");
|
|
76
75
|
var import_utils2 = require("./utils");
|
|
@@ -148,7 +147,7 @@ var analyze_default = () => ({
|
|
|
148
147
|
yield hookRunners.addDefineTypes();
|
|
149
148
|
debug(`add Define Types`);
|
|
150
149
|
let checkedEntries = entrypoints.map((point) => point.entryName);
|
|
151
|
-
if ((0,
|
|
150
|
+
if ((0, import_utils.isDevCommand)()) {
|
|
152
151
|
const { entry } = (0, import_utils.minimist)(process.argv.slice(2));
|
|
153
152
|
checkedEntries = yield (0, import_getSelectedEntries.getSelectedEntries)(
|
|
154
153
|
typeof entry === "string" ? entry.split(",") : entry,
|
|
@@ -163,7 +162,7 @@ var analyze_default = () => ({
|
|
|
163
162
|
htmlTemplates
|
|
164
163
|
});
|
|
165
164
|
api.setAppContext(appContext);
|
|
166
|
-
const command = (0,
|
|
165
|
+
const command = (0, import_utils.getCommand)();
|
|
167
166
|
const buildCommands = ["dev", "start", "build", "inspect", "deploy"];
|
|
168
167
|
if (buildCommands.includes(command)) {
|
|
169
168
|
let _b;
|
package/dist/js/node/index.js
CHANGED
|
@@ -75,7 +75,6 @@ var import_initialize = __toESM(require("./initialize"));
|
|
|
75
75
|
var import_hooks = require("./hooks");
|
|
76
76
|
var import_locale = require("./locale");
|
|
77
77
|
var import_language = require("./utils/language");
|
|
78
|
-
var import_commands = require("./utils/commands");
|
|
79
78
|
var import_restart = require("./utils/restart");
|
|
80
79
|
var import_generateWatchFiles = require("./utils/generateWatchFiles");
|
|
81
80
|
__reExport(src_exports, require("./defineConfig"), module.exports);
|
|
@@ -194,7 +193,7 @@ var src_default = () => ({
|
|
|
194
193
|
},
|
|
195
194
|
prepare() {
|
|
196
195
|
return __async(this, null, function* () {
|
|
197
|
-
const command = (0,
|
|
196
|
+
const command = (0, import_utils.getCommand)();
|
|
198
197
|
if (command === "dev" || command === "start" || command === "build") {
|
|
199
198
|
const appContext = api.useAppContext();
|
|
200
199
|
yield (0, import_utils.emptyDir)(appContext.distDirectory);
|
|
@@ -59,7 +59,6 @@ __export(initialize_exports, {
|
|
|
59
59
|
module.exports = __toCommonJS(initialize_exports);
|
|
60
60
|
var import_utils = require("@modern-js/utils");
|
|
61
61
|
var import_schema = require("../schema");
|
|
62
|
-
var import_commands = require("../utils/commands");
|
|
63
62
|
var import_transformNormalizedConfig = require("../config/initial/transformNormalizedConfig");
|
|
64
63
|
var import_config = require("../config");
|
|
65
64
|
var initialize_default = () => ({
|
|
@@ -125,7 +124,7 @@ var initialize_default = () => ({
|
|
|
125
124
|
function getServerPort(config) {
|
|
126
125
|
return __async(this, null, function* () {
|
|
127
126
|
const prodPort = config.server.port || 8080;
|
|
128
|
-
if ((0, import_utils.isDev)() && (0,
|
|
127
|
+
if ((0, import_utils.isDev)() && (0, import_utils.isDevCommand)()) {
|
|
129
128
|
return (0, import_utils.getPort)(config.dev.port || prodPort);
|
|
130
129
|
}
|
|
131
130
|
return prodPort;
|
|
@@ -221,13 +221,12 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
import * as path from "path";
|
|
224
|
-
import { createDebugger, findExists, fs, getEntryOptions, isApiOnly, minimist } from "@modern-js/utils";
|
|
224
|
+
import { createDebugger, findExists, fs, getEntryOptions, isApiOnly, minimist, getCommand, isDevCommand } from "@modern-js/utils";
|
|
225
225
|
import { cloneDeep } from "@modern-js/utils/lodash";
|
|
226
226
|
import { createBuilderForModern } from "../builder";
|
|
227
227
|
import { printInstructions } from "../utils/printInstructions";
|
|
228
228
|
import { generateRoutes } from "../utils/routes";
|
|
229
229
|
import { emitResolvedConfig } from "../utils/config";
|
|
230
|
-
import { getCommand, isDevCommand } from "../utils/commands";
|
|
231
230
|
import { getSelectedEntries } from "../utils/getSelectedEntries";
|
|
232
231
|
import { initialNormalizedConfig } from "../config";
|
|
233
232
|
import { getServerLoadersFile, isPageComponentFile, parseModule, replaceWithAlias } from "./utils";
|
|
@@ -176,14 +176,13 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
176
176
|
};
|
|
177
177
|
import path from "path";
|
|
178
178
|
import lintPlugin from "@modern-js/plugin-lint";
|
|
179
|
-
import { cleanRequireCache, emptyDir, Import } from "@modern-js/utils";
|
|
179
|
+
import { cleanRequireCache, emptyDir, Import, getCommand } from "@modern-js/utils";
|
|
180
180
|
import { castArray } from "@modern-js/utils/lodash";
|
|
181
181
|
import analyzePlugin from "./analyze";
|
|
182
182
|
import initializePlugin from "./initialize";
|
|
183
183
|
import { hooks } from "./hooks";
|
|
184
184
|
import { i18n, localeKeys } from "./locale";
|
|
185
185
|
import { getLocaleLanguage } from "./utils/language";
|
|
186
|
-
import { getCommand } from "./utils/commands";
|
|
187
186
|
import { restart } from "./utils/restart";
|
|
188
187
|
import { generateWatchFiles } from "./utils/generateWatchFiles";
|
|
189
188
|
export * from "./defineConfig";
|
|
@@ -174,9 +174,8 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
|
-
import { ensureAbsolutePath, getPort, isDev } from "@modern-js/utils";
|
|
177
|
+
import { ensureAbsolutePath, getPort, isDev, isDevCommand } from "@modern-js/utils";
|
|
178
178
|
import { legacySchema, schema } from "../schema";
|
|
179
|
-
import { isDevCommand } from "../utils/commands";
|
|
180
179
|
import { transformNormalizedConfig } from "../config/initial/transformNormalizedConfig";
|
|
181
180
|
import { checkIsLegacyConfig, createDefaultConfig, createLegacyDefaultConfig } from "../config";
|
|
182
181
|
var initialize_default = function() {
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.3.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -65,23 +65,23 @@
|
|
|
65
65
|
"@babel/types": "^7.18.0",
|
|
66
66
|
"es-module-lexer": "^1.1.0",
|
|
67
67
|
"esbuild": "0.15.7",
|
|
68
|
-
"@modern-js/builder": "2.
|
|
69
|
-
"@modern-js/builder-plugin-esbuild": "2.
|
|
70
|
-
"@modern-js/builder-plugin-node-polyfill": "2.
|
|
71
|
-
"@modern-js/builder-shared": "2.
|
|
72
|
-
"@modern-js/builder-webpack-provider": "2.
|
|
73
|
-
"@modern-js/core": "2.
|
|
74
|
-
"@modern-js/new-action": "2.
|
|
75
|
-
"@modern-js/node-bundle-require": "2.
|
|
76
|
-
"@modern-js/plugin": "2.
|
|
77
|
-
"@modern-js/plugin-data-loader": "2.
|
|
78
|
-
"@modern-js/plugin-i18n": "2.
|
|
79
|
-
"@modern-js/plugin-lint": "2.
|
|
80
|
-
"@modern-js/prod-server": "2.
|
|
81
|
-
"@modern-js/server": "2.
|
|
82
|
-
"@modern-js/types": "2.
|
|
83
|
-
"@modern-js/upgrade": "2.
|
|
84
|
-
"@modern-js/utils": "2.
|
|
68
|
+
"@modern-js/builder": "2.3.0",
|
|
69
|
+
"@modern-js/builder-plugin-esbuild": "2.3.0",
|
|
70
|
+
"@modern-js/builder-plugin-node-polyfill": "2.3.0",
|
|
71
|
+
"@modern-js/builder-shared": "2.3.0",
|
|
72
|
+
"@modern-js/builder-webpack-provider": "2.3.0",
|
|
73
|
+
"@modern-js/core": "2.3.0",
|
|
74
|
+
"@modern-js/new-action": "2.3.0",
|
|
75
|
+
"@modern-js/node-bundle-require": "2.3.0",
|
|
76
|
+
"@modern-js/plugin": "2.3.0",
|
|
77
|
+
"@modern-js/plugin-data-loader": "2.3.0",
|
|
78
|
+
"@modern-js/plugin-i18n": "2.3.0",
|
|
79
|
+
"@modern-js/plugin-lint": "2.3.0",
|
|
80
|
+
"@modern-js/prod-server": "2.3.0",
|
|
81
|
+
"@modern-js/server": "2.3.0",
|
|
82
|
+
"@modern-js/types": "2.3.0",
|
|
83
|
+
"@modern-js/upgrade": "2.3.0",
|
|
84
|
+
"@modern-js/utils": "2.3.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/babel__traverse": "^7.14.2",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"jest": "^27",
|
|
91
91
|
"typescript": "^4",
|
|
92
92
|
"webpack": "^5.75.0",
|
|
93
|
-
"@modern-js/builder-plugin-swc": "2.
|
|
94
|
-
"@modern-js/server-core": "2.
|
|
95
|
-
"@scripts/jest-config": "2.
|
|
96
|
-
"@scripts/build": "2.
|
|
93
|
+
"@modern-js/builder-plugin-swc": "2.3.0",
|
|
94
|
+
"@modern-js/server-core": "2.3.0",
|
|
95
|
+
"@scripts/jest-config": "2.3.0",
|
|
96
|
+
"@scripts/build": "2.3.0"
|
|
97
97
|
},
|
|
98
98
|
"sideEffects": false,
|
|
99
99
|
"publishConfig": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const getCommand = () => {
|
|
2
|
-
const args = process.argv.slice(2);
|
|
3
|
-
const command = args[0];
|
|
4
|
-
return command;
|
|
5
|
-
};
|
|
6
|
-
const isDevCommand = () => {
|
|
7
|
-
const command = getCommand();
|
|
8
|
-
return command === "dev" || command === "start";
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
getCommand,
|
|
12
|
-
isDevCommand
|
|
13
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var commands_exports = {};
|
|
19
|
-
__export(commands_exports, {
|
|
20
|
-
getCommand: () => getCommand,
|
|
21
|
-
isDevCommand: () => isDevCommand
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(commands_exports);
|
|
24
|
-
const getCommand = () => {
|
|
25
|
-
const args = process.argv.slice(2);
|
|
26
|
-
const command = args[0];
|
|
27
|
-
return command;
|
|
28
|
-
};
|
|
29
|
-
const isDevCommand = () => {
|
|
30
|
-
const command = getCommand();
|
|
31
|
-
return command === "dev" || command === "start";
|
|
32
|
-
};
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
getCommand,
|
|
36
|
-
isDevCommand
|
|
37
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var getCommand = function() {
|
|
2
|
-
var args = process.argv.slice(2);
|
|
3
|
-
var command = args[0];
|
|
4
|
-
return command;
|
|
5
|
-
};
|
|
6
|
-
var isDevCommand = function() {
|
|
7
|
-
var command = getCommand();
|
|
8
|
-
return command === "dev" || command === "start";
|
|
9
|
-
};
|
|
10
|
-
export { getCommand, isDevCommand };
|