@wagq/wa-cli 0.2.0 → 0.3.1
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/lib/init/index.js +14 -2
- package/package.json +3 -3
package/lib/init/index.js
CHANGED
|
@@ -6,10 +6,14 @@ const log = require("../../utils/log.js");
|
|
|
6
6
|
const after = require("./after.js");
|
|
7
7
|
const { execSync } = require("child_process");
|
|
8
8
|
|
|
9
|
+
const viteBin = "npm create vite@latest";
|
|
10
|
+
const uniAppBin = "npm create snail-uni@latest";
|
|
11
|
+
|
|
9
12
|
const urls = {
|
|
10
13
|
vue单页面后台: { remote: "sdmu-gaoqi/vite-vue" },
|
|
11
14
|
vue多页面项目: { remote: "sdmu-gaoqi/vite-vue-multiple" },
|
|
12
|
-
vite: { bin:
|
|
15
|
+
vite: { bin: viteBin },
|
|
16
|
+
uniapp: { bin: uniAppBin },
|
|
13
17
|
"vscode插件-vue版": { remote: "sdmu-gaoqi/vscode-plugin#vue" },
|
|
14
18
|
"vscode插件-react版": { remote: "sdmu-gaoqi/vscode-plugin#react" },
|
|
15
19
|
};
|
|
@@ -37,7 +41,8 @@ const init = async () => {
|
|
|
37
41
|
const { remote, bin } = urls?.[selectMode];
|
|
38
42
|
await check(name);
|
|
39
43
|
|
|
40
|
-
const initByVite = bin;
|
|
44
|
+
const initByVite = bin === viteBin;
|
|
45
|
+
const initByUniApp = bin === uniAppBin;
|
|
41
46
|
|
|
42
47
|
if (initByVite) {
|
|
43
48
|
log.info("准备从vite创建");
|
|
@@ -46,6 +51,13 @@ const init = async () => {
|
|
|
46
51
|
cwd: process.cwd(),
|
|
47
52
|
shell: true,
|
|
48
53
|
});
|
|
54
|
+
} else if (initByUniApp) {
|
|
55
|
+
log.info("准备从snail-uni创建");
|
|
56
|
+
execSync(`${bin} ${name}`, {
|
|
57
|
+
stdio: "inherit",
|
|
58
|
+
cwd: process.cwd(),
|
|
59
|
+
shell: true,
|
|
60
|
+
});
|
|
49
61
|
} else {
|
|
50
62
|
if (!remote) {
|
|
51
63
|
throw new Error(`未找到${selectMode}模板`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wagq/wa-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "wa的脚手架",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"compare-versions": "^6.1.1",
|
|
27
27
|
"download-git-repo": "^3.0.2",
|
|
28
28
|
"glob": "^11.0.1",
|
|
29
|
-
"inquirer": "^12.4.1",
|
|
30
|
-
"ora": "^4.0.3",
|
|
31
29
|
"http-server": "^14.1.1",
|
|
30
|
+
"inquirer": "^12.4.1",
|
|
32
31
|
"minimist": "^1.2.8",
|
|
32
|
+
"ora": "^4.0.3",
|
|
33
33
|
"xlsx": "^0.18.5"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {},
|