weapp-ide-cli 2.0.2 → 2.0.4
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/LICENSE +1 -1
- package/dist/{chunk-IVTZB4KY.js → chunk-NRSAANGI.js} +16 -15
- package/dist/cli.cjs +28 -27
- package/dist/cli.js +1 -1
- package/dist/index.cjs +25 -24
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/package.json +6 -5
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/defaults.ts
|
|
2
|
-
import path from "node:path";
|
|
3
2
|
import os from "node:os";
|
|
3
|
+
import path from "pathe";
|
|
4
4
|
var homedir = os.homedir();
|
|
5
5
|
var SupportedPlatformsMap = {
|
|
6
6
|
Windows_NT: "Windows_NT",
|
|
@@ -81,10 +81,23 @@ function createPathCompat(option) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// src/parse.ts
|
|
84
|
-
import readline from "node:readline";
|
|
85
84
|
import process2 from "node:process";
|
|
85
|
+
import readline from "node:readline";
|
|
86
86
|
import fs2 from "fs-extra";
|
|
87
87
|
|
|
88
|
+
// src/compose.ts
|
|
89
|
+
function compose(...funcs) {
|
|
90
|
+
if (funcs.length === 0) {
|
|
91
|
+
return (arg) => arg;
|
|
92
|
+
}
|
|
93
|
+
if (funcs.length === 1) {
|
|
94
|
+
return funcs[0];
|
|
95
|
+
}
|
|
96
|
+
return funcs.reduce(
|
|
97
|
+
(a, b) => (...args) => a(b(...args))
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
88
101
|
// src/config.ts
|
|
89
102
|
import fs from "fs-extra";
|
|
90
103
|
async function createCustomConfig(params) {
|
|
@@ -113,6 +126,7 @@ async function getConfig() {
|
|
|
113
126
|
encoding: "utf8"
|
|
114
127
|
});
|
|
115
128
|
const config = JSON.parse(content);
|
|
129
|
+
logger_default.log("> \u5168\u5C40\u914D\u7F6E\u6587\u4EF6\u8DEF\u5F84\uFF1A", defaultCustomConfigFilePath);
|
|
116
130
|
logger_default.log("> \u81EA\u5B9A\u4E49cli\u8DEF\u5F84\uFF1A", config.cliPath);
|
|
117
131
|
return config;
|
|
118
132
|
} else {
|
|
@@ -122,19 +136,6 @@ async function getConfig() {
|
|
|
122
136
|
}
|
|
123
137
|
}
|
|
124
138
|
|
|
125
|
-
// src/compose.ts
|
|
126
|
-
function compose(...funcs) {
|
|
127
|
-
if (funcs.length === 0) {
|
|
128
|
-
return (arg) => arg;
|
|
129
|
-
}
|
|
130
|
-
if (funcs.length === 1) {
|
|
131
|
-
return funcs[0];
|
|
132
|
-
}
|
|
133
|
-
return funcs.reduce(
|
|
134
|
-
(a, b) => (...args) => a(b(...args))
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
139
|
// src/parse.ts
|
|
139
140
|
var rl = readline.createInterface({
|
|
140
141
|
input: process2.stdin,
|
package/dist/cli.cjs
CHANGED
|
@@ -25,14 +25,34 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
// src/cli.ts
|
|
26
26
|
var import_node_process3 = __toESM(require("process"), 1);
|
|
27
27
|
|
|
28
|
+
// src/logger.ts
|
|
29
|
+
var import_logger = __toESM(require("@weapp-core/logger"), 1);
|
|
30
|
+
var logger_default = import_logger.default;
|
|
31
|
+
|
|
28
32
|
// src/parse.ts
|
|
29
|
-
var import_node_readline = __toESM(require("readline"), 1);
|
|
30
33
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
34
|
+
var import_node_readline = __toESM(require("readline"), 1);
|
|
31
35
|
var import_fs_extra2 = __toESM(require("fs-extra"), 1);
|
|
32
36
|
|
|
37
|
+
// src/compose.ts
|
|
38
|
+
function compose(...funcs) {
|
|
39
|
+
if (funcs.length === 0) {
|
|
40
|
+
return (arg) => arg;
|
|
41
|
+
}
|
|
42
|
+
if (funcs.length === 1) {
|
|
43
|
+
return funcs[0];
|
|
44
|
+
}
|
|
45
|
+
return funcs.reduce(
|
|
46
|
+
(a, b) => (...args) => a(b(...args))
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/config.ts
|
|
51
|
+
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
52
|
+
|
|
33
53
|
// src/defaults.ts
|
|
34
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
35
54
|
var import_node_os = __toESM(require("os"), 1);
|
|
55
|
+
var import_pathe = __toESM(require("pathe"), 1);
|
|
36
56
|
var homedir = import_node_os.default.homedir();
|
|
37
57
|
var SupportedPlatformsMap = {
|
|
38
58
|
Windows_NT: "Windows_NT",
|
|
@@ -43,20 +63,13 @@ var defaultPathMap = {
|
|
|
43
63
|
[SupportedPlatformsMap.Darwin]: "/Applications/wechatwebdevtools.app/Contents/MacOS/cli"
|
|
44
64
|
};
|
|
45
65
|
var operatingSystemName = import_node_os.default.type();
|
|
46
|
-
var defaultCustomConfigDirPath =
|
|
47
|
-
var defaultCustomConfigFilePath =
|
|
66
|
+
var defaultCustomConfigDirPath = import_pathe.default.join(homedir, ".weapp-ide-cli");
|
|
67
|
+
var defaultCustomConfigFilePath = import_pathe.default.join(
|
|
48
68
|
defaultCustomConfigDirPath,
|
|
49
69
|
"config.json"
|
|
50
70
|
);
|
|
51
71
|
var defaultPath = defaultPathMap[operatingSystemName];
|
|
52
72
|
|
|
53
|
-
// src/config.ts
|
|
54
|
-
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
55
|
-
|
|
56
|
-
// src/logger.ts
|
|
57
|
-
var import_logger = __toESM(require("@weapp-core/logger"), 1);
|
|
58
|
-
var logger_default = import_logger.default;
|
|
59
|
-
|
|
60
73
|
// src/config.ts
|
|
61
74
|
async function createCustomConfig(params) {
|
|
62
75
|
const isExisted = await import_fs_extra.default.exists(defaultCustomConfigDirPath);
|
|
@@ -84,6 +97,7 @@ async function getConfig() {
|
|
|
84
97
|
encoding: "utf8"
|
|
85
98
|
});
|
|
86
99
|
const config = JSON.parse(content);
|
|
100
|
+
logger_default.log("> \u5168\u5C40\u914D\u7F6E\u6587\u4EF6\u8DEF\u5F84\uFF1A", defaultCustomConfigFilePath);
|
|
87
101
|
logger_default.log("> \u81EA\u5B9A\u4E49cli\u8DEF\u5F84\uFF1A", config.cliPath);
|
|
88
102
|
return config;
|
|
89
103
|
} else {
|
|
@@ -95,7 +109,7 @@ async function getConfig() {
|
|
|
95
109
|
|
|
96
110
|
// src/utils.ts
|
|
97
111
|
var import_node_process = __toESM(require("process"), 1);
|
|
98
|
-
var
|
|
112
|
+
var import_pathe2 = __toESM(require("pathe"), 1);
|
|
99
113
|
async function execute(cliPath, argv2) {
|
|
100
114
|
const { execa } = await import("execa");
|
|
101
115
|
const task = execa(cliPath, argv2);
|
|
@@ -103,10 +117,10 @@ async function execute(cliPath, argv2) {
|
|
|
103
117
|
await task;
|
|
104
118
|
}
|
|
105
119
|
function resolvePath(filePath) {
|
|
106
|
-
if (
|
|
120
|
+
if (import_pathe2.default.isAbsolute(filePath)) {
|
|
107
121
|
return filePath;
|
|
108
122
|
} else {
|
|
109
|
-
return
|
|
123
|
+
return import_pathe2.default.resolve(import_node_process.default.cwd(), filePath);
|
|
110
124
|
}
|
|
111
125
|
}
|
|
112
126
|
function alias(argv2, entry) {
|
|
@@ -151,19 +165,6 @@ function createPathCompat(option) {
|
|
|
151
165
|
};
|
|
152
166
|
}
|
|
153
167
|
|
|
154
|
-
// src/compose.ts
|
|
155
|
-
function compose(...funcs) {
|
|
156
|
-
if (funcs.length === 0) {
|
|
157
|
-
return (arg) => arg;
|
|
158
|
-
}
|
|
159
|
-
if (funcs.length === 1) {
|
|
160
|
-
return funcs[0];
|
|
161
|
-
}
|
|
162
|
-
return funcs.reduce(
|
|
163
|
-
(a, b) => (...args) => a(b(...args))
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
168
|
// src/parse.ts
|
|
168
169
|
var rl = import_node_readline.default.createInterface({
|
|
169
170
|
input: import_node_process2.default.stdin,
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -42,14 +42,9 @@ __export(src_exports, {
|
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(src_exports);
|
|
44
44
|
|
|
45
|
-
// src/parse.ts
|
|
46
|
-
var import_node_readline = __toESM(require("readline"), 1);
|
|
47
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
|
48
|
-
var import_fs_extra2 = __toESM(require("fs-extra"), 1);
|
|
49
|
-
|
|
50
45
|
// src/defaults.ts
|
|
51
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
52
46
|
var import_node_os = __toESM(require("os"), 1);
|
|
47
|
+
var import_pathe = __toESM(require("pathe"), 1);
|
|
53
48
|
var homedir = import_node_os.default.homedir();
|
|
54
49
|
var SupportedPlatformsMap = {
|
|
55
50
|
Windows_NT: "Windows_NT",
|
|
@@ -60,13 +55,31 @@ var defaultPathMap = {
|
|
|
60
55
|
[SupportedPlatformsMap.Darwin]: "/Applications/wechatwebdevtools.app/Contents/MacOS/cli"
|
|
61
56
|
};
|
|
62
57
|
var operatingSystemName = import_node_os.default.type();
|
|
63
|
-
var defaultCustomConfigDirPath =
|
|
64
|
-
var defaultCustomConfigFilePath =
|
|
58
|
+
var defaultCustomConfigDirPath = import_pathe.default.join(homedir, ".weapp-ide-cli");
|
|
59
|
+
var defaultCustomConfigFilePath = import_pathe.default.join(
|
|
65
60
|
defaultCustomConfigDirPath,
|
|
66
61
|
"config.json"
|
|
67
62
|
);
|
|
68
63
|
var defaultPath = defaultPathMap[operatingSystemName];
|
|
69
64
|
|
|
65
|
+
// src/parse.ts
|
|
66
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
67
|
+
var import_node_readline = __toESM(require("readline"), 1);
|
|
68
|
+
var import_fs_extra2 = __toESM(require("fs-extra"), 1);
|
|
69
|
+
|
|
70
|
+
// src/compose.ts
|
|
71
|
+
function compose(...funcs) {
|
|
72
|
+
if (funcs.length === 0) {
|
|
73
|
+
return (arg) => arg;
|
|
74
|
+
}
|
|
75
|
+
if (funcs.length === 1) {
|
|
76
|
+
return funcs[0];
|
|
77
|
+
}
|
|
78
|
+
return funcs.reduce(
|
|
79
|
+
(a, b) => (...args) => a(b(...args))
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
70
83
|
// src/config.ts
|
|
71
84
|
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
72
85
|
|
|
@@ -101,6 +114,7 @@ async function getConfig() {
|
|
|
101
114
|
encoding: "utf8"
|
|
102
115
|
});
|
|
103
116
|
const config = JSON.parse(content);
|
|
117
|
+
logger_default.log("> \u5168\u5C40\u914D\u7F6E\u6587\u4EF6\u8DEF\u5F84\uFF1A", defaultCustomConfigFilePath);
|
|
104
118
|
logger_default.log("> \u81EA\u5B9A\u4E49cli\u8DEF\u5F84\uFF1A", config.cliPath);
|
|
105
119
|
return config;
|
|
106
120
|
} else {
|
|
@@ -112,7 +126,7 @@ async function getConfig() {
|
|
|
112
126
|
|
|
113
127
|
// src/utils.ts
|
|
114
128
|
var import_node_process = __toESM(require("process"), 1);
|
|
115
|
-
var
|
|
129
|
+
var import_pathe2 = __toESM(require("pathe"), 1);
|
|
116
130
|
async function execute(cliPath, argv) {
|
|
117
131
|
const { execa } = await import("execa");
|
|
118
132
|
const task = execa(cliPath, argv);
|
|
@@ -120,10 +134,10 @@ async function execute(cliPath, argv) {
|
|
|
120
134
|
await task;
|
|
121
135
|
}
|
|
122
136
|
function resolvePath(filePath) {
|
|
123
|
-
if (
|
|
137
|
+
if (import_pathe2.default.isAbsolute(filePath)) {
|
|
124
138
|
return filePath;
|
|
125
139
|
} else {
|
|
126
|
-
return
|
|
140
|
+
return import_pathe2.default.resolve(import_node_process.default.cwd(), filePath);
|
|
127
141
|
}
|
|
128
142
|
}
|
|
129
143
|
function alias(argv, entry) {
|
|
@@ -168,19 +182,6 @@ function createPathCompat(option) {
|
|
|
168
182
|
};
|
|
169
183
|
}
|
|
170
184
|
|
|
171
|
-
// src/compose.ts
|
|
172
|
-
function compose(...funcs) {
|
|
173
|
-
if (funcs.length === 0) {
|
|
174
|
-
return (arg) => arg;
|
|
175
|
-
}
|
|
176
|
-
if (funcs.length === 1) {
|
|
177
|
-
return funcs[0];
|
|
178
|
-
}
|
|
179
|
-
return funcs.reduce(
|
|
180
|
-
(a, b) => (...args) => a(b(...args))
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
185
|
// src/parse.ts
|
|
185
186
|
var rl = import_node_readline.default.createInterface({
|
|
186
187
|
input: import_node_process2.default.stdin,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
declare const operatingSystemName: string;
|
|
2
|
+
declare const defaultCustomConfigDirPath: string;
|
|
3
|
+
declare const defaultCustomConfigFilePath: string;
|
|
4
|
+
declare const defaultPath: string;
|
|
5
|
+
|
|
6
|
+
declare function parse(argv: string[]): Promise<void>;
|
|
7
|
+
|
|
1
8
|
interface BaseConfig {
|
|
2
9
|
cliPath: string;
|
|
3
10
|
}
|
|
@@ -6,13 +13,6 @@ interface AliasEntry {
|
|
|
6
13
|
replacement: string;
|
|
7
14
|
}
|
|
8
15
|
|
|
9
|
-
declare function parse(argv: string[]): Promise<void>;
|
|
10
|
-
|
|
11
|
-
declare const operatingSystemName: string;
|
|
12
|
-
declare const defaultCustomConfigDirPath: string;
|
|
13
|
-
declare const defaultCustomConfigFilePath: string;
|
|
14
|
-
declare const defaultPath: string;
|
|
15
|
-
|
|
16
16
|
declare function execute(cliPath: string, argv: string[]): Promise<void>;
|
|
17
17
|
declare function resolvePath(filePath: string): string;
|
|
18
18
|
declare function createAlias(entry: AliasEntry): (argv: string[]) => string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
declare const operatingSystemName: string;
|
|
2
|
+
declare const defaultCustomConfigDirPath: string;
|
|
3
|
+
declare const defaultCustomConfigFilePath: string;
|
|
4
|
+
declare const defaultPath: string;
|
|
5
|
+
|
|
6
|
+
declare function parse(argv: string[]): Promise<void>;
|
|
7
|
+
|
|
1
8
|
interface BaseConfig {
|
|
2
9
|
cliPath: string;
|
|
3
10
|
}
|
|
@@ -6,13 +13,6 @@ interface AliasEntry {
|
|
|
6
13
|
replacement: string;
|
|
7
14
|
}
|
|
8
15
|
|
|
9
|
-
declare function parse(argv: string[]): Promise<void>;
|
|
10
|
-
|
|
11
|
-
declare const operatingSystemName: string;
|
|
12
|
-
declare const defaultCustomConfigDirPath: string;
|
|
13
|
-
declare const defaultCustomConfigFilePath: string;
|
|
14
|
-
declare const defaultPath: string;
|
|
15
|
-
|
|
16
16
|
declare function execute(cliPath: string, argv: string[]): Promise<void>;
|
|
17
17
|
declare function resolvePath(filePath: string): string;
|
|
18
18
|
declare function createAlias(entry: AliasEntry): (argv: string[]) => string[];
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-ide-cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.4",
|
|
5
5
|
"description": "让微信开发者工具,用起来更加方便!",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/sonofmagic/weapp-tailwindcss",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/weapp-vite/weapp-vite.git",
|
|
12
|
+
"directory": "packages/weapp-ide-cli"
|
|
12
13
|
},
|
|
13
14
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/weapp-vite/weapp-vite/issues"
|
|
15
16
|
},
|
|
16
17
|
"keywords": [
|
|
17
18
|
"weapp",
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"registry": "https://registry.npmjs.org/"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"execa": "9.
|
|
52
|
+
"execa": "9.4.0",
|
|
52
53
|
"fs-extra": "^11.2.0",
|
|
53
54
|
"pathe": "^1.1.2",
|
|
54
55
|
"@weapp-core/logger": "^1.0.1"
|