qdmp-cli 0.1.20 → 0.1.24
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/package.json +42 -42
- package/utils/common.js +13 -5
package/package.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
2
|
+
"name": "qdmp-cli",
|
|
3
|
+
"version": "0.1.24",
|
|
4
|
+
"description": "qdmp-cli",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"actions.js",
|
|
9
|
+
"api.js",
|
|
10
|
+
"constants.js",
|
|
11
|
+
"index.js",
|
|
12
|
+
"utils/"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "node --test",
|
|
16
|
+
"postinstall": "node utils/compilerRuntime.js"
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"qdmp": "index.js",
|
|
20
|
+
"qdmp-cli": "index.js"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"千岛小程序",
|
|
24
|
+
"千岛小程序脚手架"
|
|
25
|
+
],
|
|
26
|
+
"author": "zhangyanran",
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@dimina/compiler": "1.0.17",
|
|
30
|
+
"adm-zip": "^0.5.16",
|
|
31
|
+
"chalk": "^5.4.1",
|
|
32
|
+
"commander": "^14.0.0",
|
|
33
|
+
"figlet": "^1.8.1",
|
|
34
|
+
"inquirer": "^12.6.3",
|
|
35
|
+
"is-unicode-supported": "^2.1.0",
|
|
36
|
+
"ora": "^8.2.0",
|
|
37
|
+
"shelljs": "^0.10.0",
|
|
38
|
+
"table": "^6.9.0"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/utils/common.js
CHANGED
|
@@ -253,7 +253,15 @@ export async function preUpload(loader, targetName, appId, code) {
|
|
|
253
253
|
return false;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
// 3.
|
|
256
|
+
// 3. 复制 qdmp.json 到产物目录
|
|
257
|
+
const qdmpJsonPath = path.resolve(process.cwd(), "qdmp.json");
|
|
258
|
+
if (fs.existsSync(qdmpJsonPath)) {
|
|
259
|
+
const distDir = loader === "EMP" ? "dist" : "h5";
|
|
260
|
+
fs.copyFileSync(qdmpJsonPath, path.join(WORKSPACE_DIR, distDir, "qdmp.json"));
|
|
261
|
+
info("已将 qdmp.json 复制到产物目录");
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// 4. 压缩项目
|
|
257
265
|
if (!(await compressProject(targetName, WORKSPACE_DIR, loader, appId))) {
|
|
258
266
|
error("压缩项目失败");
|
|
259
267
|
return false;
|
|
@@ -263,8 +271,8 @@ export async function preUpload(loader, targetName, appId, code) {
|
|
|
263
271
|
const zipFilePath = `./${WORKSPACE_DIR}/${targetName}.zip`;
|
|
264
272
|
success(`预上传准备完成`);
|
|
265
273
|
return zipFilePath;
|
|
266
|
-
} catch (
|
|
267
|
-
error(`预上传过程出错: ${
|
|
274
|
+
} catch (err) {
|
|
275
|
+
error(`预上传过程出错: ${err.message}`);
|
|
268
276
|
return false;
|
|
269
277
|
}
|
|
270
278
|
}
|
|
@@ -281,8 +289,8 @@ async function copyAndRenameDistFolder() {
|
|
|
281
289
|
}
|
|
282
290
|
|
|
283
291
|
return renameDistFolder(`${WORKSPACE_DIR}/dist`, `${WORKSPACE_DIR}/h5`);
|
|
284
|
-
} catch (
|
|
285
|
-
error("复制并重命名文件夹过程出错:",
|
|
292
|
+
} catch (err) {
|
|
293
|
+
error("复制并重命名文件夹过程出错:", err);
|
|
286
294
|
return false;
|
|
287
295
|
}
|
|
288
296
|
}
|