qdmp-cli 0.1.17 → 0.1.18
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/README.md +3 -0
- package/actions.js +16 -1
- package/npm-shrinkwrap.json +4487 -0
- package/package.json +11 -3
- package/.claude/settings.local.json +0 -9
package/README.md
CHANGED
package/actions.js
CHANGED
|
@@ -174,6 +174,20 @@ export const initConfigAction = async (option) => {
|
|
|
174
174
|
error(e.message);
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
|
+
const assertCompilerNodeVersion = (version = process.versions.node) => {
|
|
178
|
+
const [major, minor] = version.split(".").map(Number);
|
|
179
|
+
const supported =
|
|
180
|
+
(major === 22 && minor >= 12) ||
|
|
181
|
+
(major === 24 && minor >= 11) ||
|
|
182
|
+
major >= 26;
|
|
183
|
+
|
|
184
|
+
if (!supported) {
|
|
185
|
+
throw new Error(
|
|
186
|
+
`当前 Node.js ${version} 不受 EMP 编译器支持,请使用 Node.js 22.12+、24.11+ 或 26+`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
177
191
|
export const buildAction = async () => {
|
|
178
192
|
try {
|
|
179
193
|
const qdmpJsonPath = `${process.cwd()}/qdmp.json`;
|
|
@@ -184,6 +198,7 @@ export const buildAction = async () => {
|
|
|
184
198
|
const config = JSON.parse(fs.readFileSync(qdmpJsonPath, "utf8"));
|
|
185
199
|
switch (config.loader) {
|
|
186
200
|
case "EMP":
|
|
201
|
+
assertCompilerNodeVersion();
|
|
187
202
|
info("开始构建...");
|
|
188
203
|
const buildResult = shell.exec("npm run build");
|
|
189
204
|
if (buildResult.code !== 0) {
|
|
@@ -212,7 +227,7 @@ export const buildAction = async () => {
|
|
|
212
227
|
);
|
|
213
228
|
} catch (e) {
|
|
214
229
|
throw new Error(
|
|
215
|
-
|
|
230
|
+
`EMP 编译器执行失败,请根据上方原始日志排查依赖或构建产物:${e?.message || "未知错误"}`,
|
|
216
231
|
);
|
|
217
232
|
}
|
|
218
233
|
success("构建完成");
|