weapp-ide-cli 5.1.0 → 5.1.2
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/dist/cli-g8B8r0xg.js +1467 -0
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +17 -21
- package/dist/commands-BwCMEmX-.js +375 -0
- package/dist/index.d.ts +142 -90
- package/dist/index.js +3 -136
- package/package.json +6 -5
- package/dist/chunk-C2MXNGAM.js +0 -1472
- package/dist/chunk-NSYCXXXT.js +0 -427
- package/dist/commands-QGH4FNJB.js +0 -34
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import * as execa from
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import * as miniprogram_automator_out_MiniProgram0 from "miniprogram-automator/out/MiniProgram";
|
|
3
|
+
import * as execa from "execa";
|
|
4
4
|
|
|
5
|
+
//#region src/cli/automator.d.ts
|
|
5
6
|
interface AutomatorOptions {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
projectPath: string;
|
|
8
|
+
timeout?: number;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* @description Check if error is a DevTools HTTP port error
|
|
@@ -21,13 +22,14 @@ declare function formatAutomatorLoginError(error: unknown): string;
|
|
|
21
22
|
/**
|
|
22
23
|
* @description Launch automator with default options
|
|
23
24
|
*/
|
|
24
|
-
declare function launchAutomator(options: AutomatorOptions): Promise<
|
|
25
|
-
|
|
25
|
+
declare function launchAutomator(options: AutomatorOptions): Promise<miniprogram_automator_out_MiniProgram0.default>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/cli/automator-argv.d.ts
|
|
26
28
|
interface ParsedAutomatorArgs {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
projectPath: string;
|
|
30
|
+
timeout?: number;
|
|
31
|
+
json: boolean;
|
|
32
|
+
positionals: string[];
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* @description 解析 automator 命令通用参数与位置参数。
|
|
@@ -41,41 +43,53 @@ declare function readOptionValue(argv: readonly string[], optionName: string): s
|
|
|
41
43
|
* @description 删除参数中的指定选项(同时支持 --opt value 与 --opt=value)。
|
|
42
44
|
*/
|
|
43
45
|
declare function removeOption(argv: readonly string[], optionName: string): string[];
|
|
44
|
-
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/cli/automator-session.d.ts
|
|
45
48
|
interface AutomatorSessionOptions {
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
projectPath: string;
|
|
50
|
+
timeout?: number;
|
|
51
|
+
}
|
|
52
|
+
interface MiniProgramEventMap {
|
|
53
|
+
console: (payload: unknown) => void;
|
|
54
|
+
exception: (payload: unknown) => void;
|
|
48
55
|
}
|
|
49
56
|
interface MiniProgramElement {
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
tap: () => Promise<void>;
|
|
58
|
+
input?: (value: string) => Promise<void>;
|
|
52
59
|
}
|
|
53
60
|
interface MiniProgramPage {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
path?: string;
|
|
62
|
+
query?: Record<string, unknown>;
|
|
63
|
+
data: (path?: string) => Promise<unknown>;
|
|
64
|
+
$: (selector: string) => Promise<MiniProgramElement | null>;
|
|
58
65
|
}
|
|
59
66
|
interface MiniProgramLike {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
navigateTo: (url: string) => Promise<unknown>;
|
|
68
|
+
redirectTo: (url: string) => Promise<unknown>;
|
|
69
|
+
navigateBack: () => Promise<unknown>;
|
|
70
|
+
reLaunch: (url: string) => Promise<unknown>;
|
|
71
|
+
switchTab: (url: string) => Promise<unknown>;
|
|
72
|
+
pageStack: () => Promise<MiniProgramPage[]>;
|
|
73
|
+
currentPage: () => Promise<MiniProgramPage>;
|
|
74
|
+
systemInfo: () => Promise<unknown>;
|
|
75
|
+
pageScrollTo: (scrollTop: number) => Promise<unknown>;
|
|
76
|
+
stopAudits: () => Promise<unknown>;
|
|
77
|
+
screenshot: () => Promise<string | Buffer>;
|
|
78
|
+
remote: (enable?: boolean) => Promise<unknown>;
|
|
79
|
+
close: () => Promise<void>;
|
|
80
|
+
on: <TEvent extends keyof MiniProgramEventMap>(event: TEvent, listener: MiniProgramEventMap[TEvent]) => MiniProgramLike;
|
|
81
|
+
off?: <TEvent extends keyof MiniProgramEventMap>(event: TEvent, listener: MiniProgramEventMap[TEvent]) => MiniProgramLike;
|
|
73
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* @description 建立 automator 会话,并统一处理常见连接错误提示。
|
|
85
|
+
*/
|
|
86
|
+
declare function connectMiniProgram(options: AutomatorSessionOptions): Promise<MiniProgramLike>;
|
|
74
87
|
/**
|
|
75
88
|
* @description 统一管理 automator 会话生命周期与常见连接错误提示。
|
|
76
89
|
*/
|
|
77
90
|
declare function withMiniProgram<T>(options: AutomatorSessionOptions, runner: (miniProgram: MiniProgramLike) => Promise<T>): Promise<T>;
|
|
78
|
-
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/cli/command-catalog.d.ts
|
|
79
93
|
declare const WECHAT_CLI_COMMAND_NAMES: readonly ["open", "login", "islogin", "preview", "auto-preview", "upload", "build-npm", "auto", "auto-replay", "reset-fileutils", "close", "quit", "cache", "engine", "open-other", "build-ipa", "build-apk", "cloud"];
|
|
80
94
|
declare const MINIDEV_NAMESPACE_COMMAND_NAMES: readonly ["alipay", "ali", "minidev"];
|
|
81
95
|
declare const CONFIG_COMMAND_NAME: "config";
|
|
@@ -84,46 +98,45 @@ declare const WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES: string[];
|
|
|
84
98
|
* @description 判断是否为 weapp-ide-cli 支持的顶层命令。
|
|
85
99
|
*/
|
|
86
100
|
declare function isWeappIdeTopLevelCommand(command: string | undefined): boolean;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/cli/commands.d.ts
|
|
103
|
+
interface AutomatorCommandOptions extends AutomatorSessionOptions {}
|
|
90
104
|
interface NavigateOptions extends AutomatorCommandOptions {
|
|
91
|
-
|
|
105
|
+
url: string;
|
|
92
106
|
}
|
|
93
107
|
interface PageInfoOptions extends AutomatorCommandOptions {
|
|
94
|
-
|
|
108
|
+
json?: boolean;
|
|
95
109
|
}
|
|
96
110
|
interface PageDataOptions extends PageInfoOptions {
|
|
97
|
-
|
|
111
|
+
path?: string;
|
|
98
112
|
}
|
|
99
113
|
interface SelectorOptions extends AutomatorCommandOptions {
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
interface TapOptions extends SelectorOptions {
|
|
114
|
+
selector: string;
|
|
103
115
|
}
|
|
116
|
+
interface TapOptions extends SelectorOptions {}
|
|
104
117
|
interface InputOptions extends SelectorOptions {
|
|
105
|
-
|
|
118
|
+
value: string;
|
|
106
119
|
}
|
|
107
120
|
interface ScrollOptions extends AutomatorCommandOptions {
|
|
108
|
-
|
|
121
|
+
scrollTop: number;
|
|
109
122
|
}
|
|
110
123
|
interface AuditOptions extends AutomatorCommandOptions {
|
|
111
|
-
|
|
124
|
+
outputPath?: string;
|
|
112
125
|
}
|
|
113
126
|
interface ScreenshotOptions extends AutomatorCommandOptions {
|
|
114
|
-
|
|
115
|
-
|
|
127
|
+
outputPath?: string;
|
|
128
|
+
page?: string;
|
|
116
129
|
}
|
|
117
130
|
interface ScreenshotResult {
|
|
118
|
-
|
|
119
|
-
|
|
131
|
+
base64?: string;
|
|
132
|
+
path?: string;
|
|
120
133
|
}
|
|
121
134
|
interface RemoteOptions extends AutomatorCommandOptions {
|
|
122
|
-
|
|
135
|
+
enable?: boolean;
|
|
123
136
|
}
|
|
124
137
|
interface PageSnapshot {
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
path: string;
|
|
139
|
+
query: Record<string, unknown> | undefined;
|
|
127
140
|
}
|
|
128
141
|
declare function navigateTo(options: NavigateOptions): Promise<void>;
|
|
129
142
|
declare function redirectTo(options: NavigateOptions): Promise<void>;
|
|
@@ -140,32 +153,58 @@ declare function scrollTo(options: ScrollOptions): Promise<void>;
|
|
|
140
153
|
declare function audit(options: AuditOptions): Promise<unknown>;
|
|
141
154
|
declare function takeScreenshot(options: ScreenshotOptions): Promise<ScreenshotResult>;
|
|
142
155
|
declare function remote(options: RemoteOptions): Promise<void>;
|
|
143
|
-
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/cli/config-command.d.ts
|
|
144
158
|
/**
|
|
145
159
|
* @description 处理 config 子命令。
|
|
146
160
|
*/
|
|
147
161
|
declare function handleConfigCommand(argv: string[]): Promise<void>;
|
|
148
|
-
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/cli/forwardConsole.d.ts
|
|
164
|
+
type ForwardConsoleLogLevel = 'debug' | 'log' | 'info' | 'warn' | 'error';
|
|
165
|
+
interface ForwardConsoleEvent {
|
|
166
|
+
level: ForwardConsoleLogLevel;
|
|
167
|
+
message: string;
|
|
168
|
+
raw: unknown;
|
|
169
|
+
}
|
|
170
|
+
interface ForwardConsoleOptions extends AutomatorSessionOptions {
|
|
171
|
+
logLevels?: ForwardConsoleLogLevel[];
|
|
172
|
+
unhandledErrors?: boolean;
|
|
173
|
+
onLog?: (event: ForwardConsoleEvent) => void;
|
|
174
|
+
onReady?: () => void;
|
|
175
|
+
}
|
|
176
|
+
interface ForwardConsoleSession {
|
|
177
|
+
close: () => Promise<void>;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* @description 启动小程序控制台日志转发,并保持 automator 会话常驻。
|
|
181
|
+
*/
|
|
182
|
+
declare function startForwardConsole(options: ForwardConsoleOptions): Promise<ForwardConsoleSession>;
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/cli/minidev.d.ts
|
|
149
185
|
/**
|
|
150
186
|
* @description 运行支付宝小程序 CLI(minidev)
|
|
151
187
|
*/
|
|
152
188
|
declare function runMinidev(argv: readonly string[]): Promise<void>;
|
|
153
|
-
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/cli/prompt.d.ts
|
|
154
191
|
/**
|
|
155
192
|
* @description 交互式提示并保存 CLI 路径
|
|
156
193
|
*/
|
|
157
194
|
declare function promptForCliPath(): Promise<string | null>;
|
|
158
|
-
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/cli/resolver.d.ts
|
|
159
197
|
/**
|
|
160
198
|
* @description 解析 CLI 路径并校验可用性
|
|
161
199
|
*/
|
|
162
200
|
declare function resolveCliPath(): Promise<{
|
|
163
|
-
|
|
164
|
-
|
|
201
|
+
cliPath: string | null;
|
|
202
|
+
source: ConfigSource;
|
|
165
203
|
}>;
|
|
166
|
-
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/cli/retry.d.ts
|
|
167
206
|
interface RetryKeypressOptions {
|
|
168
|
-
|
|
207
|
+
timeoutMs?: number;
|
|
169
208
|
}
|
|
170
209
|
type RetryPromptResult = 'retry' | 'cancel' | 'timeout';
|
|
171
210
|
/**
|
|
@@ -184,8 +223,8 @@ declare function formatWechatIdeLoginRequiredError(error: unknown): string;
|
|
|
184
223
|
* @description 创建登录失效专用错误,并携带退出码语义。
|
|
185
224
|
*/
|
|
186
225
|
declare function createWechatIdeLoginRequiredExitError(error: unknown, reason?: string): Error & {
|
|
187
|
-
|
|
188
|
-
|
|
226
|
+
code: number;
|
|
227
|
+
exitCode: number;
|
|
189
228
|
};
|
|
190
229
|
/**
|
|
191
230
|
* @description 交互等待用户按键重试,按 r 重试,按 q 或 Ctrl+C 取消。
|
|
@@ -195,12 +234,14 @@ declare function waitForRetryKeypress(options?: RetryKeypressOptions): Promise<R
|
|
|
195
234
|
* @description 生成重试按键提示,并高亮关键热键。
|
|
196
235
|
*/
|
|
197
236
|
declare function formatRetryHotkeyPrompt(timeoutMs?: number): string;
|
|
198
|
-
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/cli/run.d.ts
|
|
199
239
|
/**
|
|
200
240
|
* @description CLI 入口解析与分发。
|
|
201
241
|
*/
|
|
202
242
|
declare function parse(argv: string[]): Promise<void>;
|
|
203
|
-
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/cli/run-automator.d.ts
|
|
204
245
|
declare const AUTOMATOR_COMMAND_NAMES: string[];
|
|
205
246
|
/**
|
|
206
247
|
* @description 判断是否属于 automator 子命令。
|
|
@@ -214,13 +255,15 @@ declare function runAutomatorCommand(command: string, argv: string[]): Promise<v
|
|
|
214
255
|
* @description 获取 automator 命令帮助文本。
|
|
215
256
|
*/
|
|
216
257
|
declare function getAutomatorCommandHelp(command: string): string | undefined;
|
|
217
|
-
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/cli/run-login.d.ts
|
|
218
260
|
type LoginRetryMode = 'never' | 'once' | 'always';
|
|
219
261
|
/**
|
|
220
262
|
* @description 运行微信开发者工具 CLI,并在登录失效时允许按键重试。
|
|
221
263
|
*/
|
|
222
264
|
declare function runWechatCliWithRetry(cliPath: string, argv: string[]): Promise<void>;
|
|
223
|
-
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/cli/screenshot.d.ts
|
|
224
267
|
/**
|
|
225
268
|
* @description Print help for screenshot command
|
|
226
269
|
*/
|
|
@@ -229,18 +272,20 @@ declare function printScreenshotHelp(): void;
|
|
|
229
272
|
* @description Parse command line arguments for screenshot command
|
|
230
273
|
*/
|
|
231
274
|
declare function parseScreenshotArgs(argv: string[]): ScreenshotOptions;
|
|
232
|
-
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/cli/wechat-command-schema.d.ts
|
|
233
277
|
/**
|
|
234
278
|
* @description 在调用官方微信 CLI 前做轻量参数校验。
|
|
235
279
|
*/
|
|
236
280
|
declare function validateWechatCliCommandArgs(argv: readonly string[]): void;
|
|
237
|
-
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/types.d.ts
|
|
238
283
|
/**
|
|
239
284
|
* @description 基础配置
|
|
240
285
|
*/
|
|
241
286
|
interface BaseConfig {
|
|
242
|
-
|
|
243
|
-
|
|
287
|
+
cliPath: string;
|
|
288
|
+
locale?: 'zh' | 'en';
|
|
244
289
|
}
|
|
245
290
|
/**
|
|
246
291
|
* @description 配置来源
|
|
@@ -250,19 +295,20 @@ type ConfigSource = 'custom' | 'default' | 'missing';
|
|
|
250
295
|
* @description 解析后的配置
|
|
251
296
|
*/
|
|
252
297
|
interface ResolvedConfig extends BaseConfig {
|
|
253
|
-
|
|
298
|
+
source: ConfigSource;
|
|
254
299
|
}
|
|
255
300
|
/**
|
|
256
301
|
* @description CLI 参数别名配置
|
|
257
302
|
*/
|
|
258
303
|
interface AliasEntry {
|
|
259
|
-
|
|
260
|
-
|
|
304
|
+
find: string;
|
|
305
|
+
replacement: string;
|
|
261
306
|
}
|
|
262
|
-
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/config/custom.d.ts
|
|
263
309
|
interface CustomConfigFile {
|
|
264
|
-
|
|
265
|
-
|
|
310
|
+
cliPath?: string;
|
|
311
|
+
locale?: 'zh' | 'en';
|
|
266
312
|
}
|
|
267
313
|
/**
|
|
268
314
|
* @description 写入自定义 CLI 路径配置
|
|
@@ -284,7 +330,8 @@ declare function overwriteCustomConfig(config: CustomConfigFile): Promise<void>;
|
|
|
284
330
|
* @description 读取原始自定义配置。
|
|
285
331
|
*/
|
|
286
332
|
declare function readCustomConfig(): Promise<CustomConfigFile>;
|
|
287
|
-
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/config/paths.d.ts
|
|
288
335
|
/**
|
|
289
336
|
* @description 默认自定义配置目录
|
|
290
337
|
*/
|
|
@@ -293,7 +340,8 @@ declare const defaultCustomConfigDirPath: string;
|
|
|
293
340
|
* @description 默认自定义配置文件路径
|
|
294
341
|
*/
|
|
295
342
|
declare const defaultCustomConfigFilePath: string;
|
|
296
|
-
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/config/resolver.d.ts
|
|
297
345
|
/**
|
|
298
346
|
* @description 读取并解析 CLI 配置(自定义优先)
|
|
299
347
|
*/
|
|
@@ -302,15 +350,16 @@ declare function getConfig(): Promise<ResolvedConfig>;
|
|
|
302
350
|
* @description 获取用户配置的语言偏好。
|
|
303
351
|
*/
|
|
304
352
|
declare function getConfiguredLocale(): Promise<"zh" | "en" | undefined>;
|
|
305
|
-
|
|
353
|
+
//#endregion
|
|
354
|
+
//#region src/runtime/platform.d.ts
|
|
306
355
|
/**
|
|
307
356
|
* @description 官方微信开发者工具只支持 Windows、macOS,Linux 只有社区版
|
|
308
357
|
* https://github.com/msojocs/wechat-web-devtools-linux
|
|
309
358
|
*/
|
|
310
359
|
declare const SupportedPlatformsMap: {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
360
|
+
readonly Windows_NT: "Windows_NT";
|
|
361
|
+
readonly Darwin: "Darwin";
|
|
362
|
+
readonly Linux: "Linux";
|
|
314
363
|
};
|
|
315
364
|
/**
|
|
316
365
|
* @description 支持的系统类型
|
|
@@ -328,7 +377,8 @@ declare const operatingSystemName: string;
|
|
|
328
377
|
* @description 获取默认 CLI 路径(按系统)
|
|
329
378
|
*/
|
|
330
379
|
declare function getDefaultCliPath(targetOs?: string): Promise<string | undefined>;
|
|
331
|
-
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/utils/argv.d.ts
|
|
332
382
|
/**
|
|
333
383
|
* @description argv 处理函数
|
|
334
384
|
*/
|
|
@@ -345,19 +395,21 @@ declare function createAlias(entry: AliasEntry): ArgvTransform;
|
|
|
345
395
|
* @description 创建路径参数兼容转换器(补全或规范化路径)
|
|
346
396
|
*/
|
|
347
397
|
declare function createPathCompat(option: string): ArgvTransform;
|
|
348
|
-
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/utils/exec.d.ts
|
|
349
400
|
interface ExecuteOptions {
|
|
350
|
-
|
|
351
|
-
|
|
401
|
+
pipeStdout?: boolean;
|
|
402
|
+
pipeStderr?: boolean;
|
|
352
403
|
}
|
|
353
404
|
/**
|
|
354
405
|
* @description 执行 CLI 命令并透传输出
|
|
355
406
|
*/
|
|
356
407
|
declare function execute(cliPath: string, argv: string[], options?: ExecuteOptions): Promise<execa.Result<{}>>;
|
|
357
|
-
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/utils/path.d.ts
|
|
358
410
|
/**
|
|
359
411
|
* @description 解析为绝对路径(基于当前工作目录)
|
|
360
412
|
*/
|
|
361
413
|
declare function resolvePath(filePath: string): string;
|
|
362
|
-
|
|
363
|
-
export { AUTOMATOR_COMMAND_NAMES,
|
|
414
|
+
//#endregion
|
|
415
|
+
export { AUTOMATOR_COMMAND_NAMES, ArgvTransform, AuditOptions, AutomatorCommandOptions, AutomatorOptions, AutomatorSessionOptions, type BaseConfig, CONFIG_COMMAND_NAME, type ConfigSource, ForwardConsoleEvent, ForwardConsoleLogLevel, ForwardConsoleOptions, ForwardConsoleSession, InputOptions, LoginRetryMode, MINIDEV_NAMESPACE_COMMAND_NAMES, MiniProgramElement, MiniProgramEventMap, MiniProgramLike, MiniProgramPage, NavigateOptions, PageDataOptions, PageInfoOptions, ParsedAutomatorArgs, RemoteOptions, type ResolvedConfig, RetryKeypressOptions, RetryPromptResult, type ScreenshotOptions, type ScreenshotResult, ScrollOptions, SelectorOptions, SupportedPlatform, SupportedPlatformsMap, TapOptions, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, audit, connectMiniProgram, createAlias, createCustomConfig, createLocaleConfig, createPathCompat, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getConfig, getConfiguredLocale, getDefaultCliPath, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isDevtoolsHttpPortError, isOperatingSystemSupported, isWeappIdeTopLevelCommand, isWechatIdeLoginRequiredError, launchAutomator, navigateBack, navigateTo, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseScreenshotArgs, printScreenshotHelp, promptForCliPath, reLaunch, readCustomConfig, readOptionValue, redirectTo, remote, removeCustomConfigKey, removeOption, resolveCliPath, resolvePath, runAutomatorCommand, runMinidev, runWechatCliWithRetry, scrollTo, startForwardConsole, switchTab, systemInfo, takeScreenshot, tap, transformArgv, validateWechatCliCommandArgs, waitForRetryKeypress, withMiniProgram };
|
package/dist/index.js
CHANGED
|
@@ -1,136 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
MINIDEV_NAMESPACE_COMMAND_NAMES,
|
|
5
|
-
SupportedPlatformsMap,
|
|
6
|
-
WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES,
|
|
7
|
-
WECHAT_CLI_COMMAND_NAMES,
|
|
8
|
-
createAlias,
|
|
9
|
-
createCustomConfig,
|
|
10
|
-
createLocaleConfig,
|
|
11
|
-
createPathCompat,
|
|
12
|
-
createWechatIdeLoginRequiredExitError,
|
|
13
|
-
defaultCustomConfigDirPath,
|
|
14
|
-
defaultCustomConfigFilePath,
|
|
15
|
-
execute,
|
|
16
|
-
extractExecutionErrorText,
|
|
17
|
-
formatRetryHotkeyPrompt,
|
|
18
|
-
formatWechatIdeLoginRequiredError,
|
|
19
|
-
getAutomatorCommandHelp,
|
|
20
|
-
getConfig,
|
|
21
|
-
getConfiguredLocale,
|
|
22
|
-
getDefaultCliPath,
|
|
23
|
-
handleConfigCommand,
|
|
24
|
-
isAutomatorCommand,
|
|
25
|
-
isOperatingSystemSupported,
|
|
26
|
-
isWeappIdeTopLevelCommand,
|
|
27
|
-
isWechatIdeLoginRequiredError,
|
|
28
|
-
operatingSystemName,
|
|
29
|
-
overwriteCustomConfig,
|
|
30
|
-
parse,
|
|
31
|
-
parseAutomatorArgs,
|
|
32
|
-
parseScreenshotArgs,
|
|
33
|
-
printScreenshotHelp,
|
|
34
|
-
promptForCliPath,
|
|
35
|
-
readCustomConfig,
|
|
36
|
-
readOptionValue,
|
|
37
|
-
removeCustomConfigKey,
|
|
38
|
-
removeOption,
|
|
39
|
-
resolveCliPath,
|
|
40
|
-
resolvePath,
|
|
41
|
-
runAutomatorCommand,
|
|
42
|
-
runMinidev,
|
|
43
|
-
runWechatCliWithRetry,
|
|
44
|
-
transformArgv,
|
|
45
|
-
validateWechatCliCommandArgs,
|
|
46
|
-
waitForRetryKeypress
|
|
47
|
-
} from "./chunk-C2MXNGAM.js";
|
|
48
|
-
import {
|
|
49
|
-
audit,
|
|
50
|
-
currentPage,
|
|
51
|
-
formatAutomatorLoginError,
|
|
52
|
-
input,
|
|
53
|
-
isAutomatorLoginError,
|
|
54
|
-
isDevtoolsHttpPortError,
|
|
55
|
-
launchAutomator,
|
|
56
|
-
navigateBack,
|
|
57
|
-
navigateTo,
|
|
58
|
-
pageData,
|
|
59
|
-
pageStack,
|
|
60
|
-
reLaunch,
|
|
61
|
-
redirectTo,
|
|
62
|
-
remote,
|
|
63
|
-
scrollTo,
|
|
64
|
-
switchTab,
|
|
65
|
-
systemInfo,
|
|
66
|
-
takeScreenshot,
|
|
67
|
-
tap,
|
|
68
|
-
withMiniProgram
|
|
69
|
-
} from "./chunk-NSYCXXXT.js";
|
|
70
|
-
export {
|
|
71
|
-
AUTOMATOR_COMMAND_NAMES,
|
|
72
|
-
CONFIG_COMMAND_NAME,
|
|
73
|
-
MINIDEV_NAMESPACE_COMMAND_NAMES,
|
|
74
|
-
SupportedPlatformsMap,
|
|
75
|
-
WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES,
|
|
76
|
-
WECHAT_CLI_COMMAND_NAMES,
|
|
77
|
-
audit,
|
|
78
|
-
createAlias,
|
|
79
|
-
createCustomConfig,
|
|
80
|
-
createLocaleConfig,
|
|
81
|
-
createPathCompat,
|
|
82
|
-
createWechatIdeLoginRequiredExitError,
|
|
83
|
-
currentPage,
|
|
84
|
-
defaultCustomConfigDirPath,
|
|
85
|
-
defaultCustomConfigFilePath,
|
|
86
|
-
execute,
|
|
87
|
-
extractExecutionErrorText,
|
|
88
|
-
formatAutomatorLoginError,
|
|
89
|
-
formatRetryHotkeyPrompt,
|
|
90
|
-
formatWechatIdeLoginRequiredError,
|
|
91
|
-
getAutomatorCommandHelp,
|
|
92
|
-
getConfig,
|
|
93
|
-
getConfiguredLocale,
|
|
94
|
-
getDefaultCliPath,
|
|
95
|
-
handleConfigCommand,
|
|
96
|
-
input,
|
|
97
|
-
isAutomatorCommand,
|
|
98
|
-
isAutomatorLoginError,
|
|
99
|
-
isDevtoolsHttpPortError,
|
|
100
|
-
isOperatingSystemSupported,
|
|
101
|
-
isWeappIdeTopLevelCommand,
|
|
102
|
-
isWechatIdeLoginRequiredError,
|
|
103
|
-
launchAutomator,
|
|
104
|
-
navigateBack,
|
|
105
|
-
navigateTo,
|
|
106
|
-
operatingSystemName,
|
|
107
|
-
overwriteCustomConfig,
|
|
108
|
-
pageData,
|
|
109
|
-
pageStack,
|
|
110
|
-
parse,
|
|
111
|
-
parseAutomatorArgs,
|
|
112
|
-
parseScreenshotArgs,
|
|
113
|
-
printScreenshotHelp,
|
|
114
|
-
promptForCliPath,
|
|
115
|
-
reLaunch,
|
|
116
|
-
readCustomConfig,
|
|
117
|
-
readOptionValue,
|
|
118
|
-
redirectTo,
|
|
119
|
-
remote,
|
|
120
|
-
removeCustomConfigKey,
|
|
121
|
-
removeOption,
|
|
122
|
-
resolveCliPath,
|
|
123
|
-
resolvePath,
|
|
124
|
-
runAutomatorCommand,
|
|
125
|
-
runMinidev,
|
|
126
|
-
runWechatCliWithRetry,
|
|
127
|
-
scrollTo,
|
|
128
|
-
switchTab,
|
|
129
|
-
systemInfo,
|
|
130
|
-
takeScreenshot,
|
|
131
|
-
tap,
|
|
132
|
-
transformArgv,
|
|
133
|
-
validateWechatCliCommandArgs,
|
|
134
|
-
waitForRetryKeypress,
|
|
135
|
-
withMiniProgram
|
|
136
|
-
};
|
|
1
|
+
import { D as launchAutomator, E as isDevtoolsHttpPortError, T as isAutomatorLoginError, _ as connectMiniProgram, a as navigateBack, c as pageStack, d as remote, f as scrollTo, g as tap, h as takeScreenshot, i as input, l as reLaunch, m as systemInfo, o as navigateTo, p as switchTab, r as currentPage, s as pageData, t as audit, u as redirectTo, v as withMiniProgram, w as formatAutomatorLoginError } from "./commands-BwCMEmX-.js";
|
|
2
|
+
import { A as defaultCustomConfigDirPath, B as isAutomatorCommand, C as operatingSystemName, D as overwriteCustomConfig, E as createLocaleConfig, F as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, G as readOptionValue, H as parseScreenshotArgs, I as WECHAT_CLI_COMMAND_NAMES, K as removeOption, L as isWeappIdeTopLevelCommand, M as resolvePath, N as CONFIG_COMMAND_NAME, O as readCustomConfig, P as MINIDEV_NAMESPACE_COMMAND_NAMES, R as AUTOMATOR_COMMAND_NAMES, S as isOperatingSystemSupported, T as createCustomConfig, U as printScreenshotHelp, V as runAutomatorCommand, W as parseAutomatorArgs, _ as resolveCliPath, a as extractExecutionErrorText, b as SupportedPlatformsMap, c as isWechatIdeLoginRequiredError, d as execute, f as createAlias, g as handleConfigCommand, h as startForwardConsole, i as createWechatIdeLoginRequiredExitError, j as defaultCustomConfigFilePath, k as removeCustomConfigKey, l as waitForRetryKeypress, m as transformArgv, n as validateWechatCliCommandArgs, o as formatRetryHotkeyPrompt, p as createPathCompat, r as runWechatCliWithRetry, s as formatWechatIdeLoginRequiredError, t as parse, u as runMinidev, v as getConfig, w as promptForCliPath, x as getDefaultCliPath, y as getConfiguredLocale, z as getAutomatorCommandHelp } from "./cli-g8B8r0xg.js";
|
|
3
|
+
export { AUTOMATOR_COMMAND_NAMES, CONFIG_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, SupportedPlatformsMap, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, audit, connectMiniProgram, createAlias, createCustomConfig, createLocaleConfig, createPathCompat, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getConfig, getConfiguredLocale, getDefaultCliPath, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isDevtoolsHttpPortError, isOperatingSystemSupported, isWeappIdeTopLevelCommand, isWechatIdeLoginRequiredError, launchAutomator, navigateBack, navigateTo, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseScreenshotArgs, printScreenshotHelp, promptForCliPath, reLaunch, readCustomConfig, readOptionValue, redirectTo, remote, removeCustomConfigKey, removeOption, resolveCliPath, resolvePath, runAutomatorCommand, runMinidev, runWechatCliWithRetry, scrollTo, startForwardConsole, switchTab, systemInfo, takeScreenshot, tap, transformArgv, validateWechatCliCommandArgs, waitForRetryKeypress, withMiniProgram };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-ide-cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.2",
|
|
5
5
|
"description": "让微信开发者工具,用起来更加方便!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -63,17 +63,18 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"execa": "9.6.1",
|
|
66
|
-
"fs-extra": "^11.3.
|
|
66
|
+
"fs-extra": "^11.3.4",
|
|
67
67
|
"miniprogram-automator": "^0.12.1",
|
|
68
68
|
"pathe": "^2.0.3",
|
|
69
|
-
"@weapp-core/logger": "^3.1.
|
|
69
|
+
"@weapp-core/logger": "^3.1.1"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
|
-
"dev": "
|
|
73
|
-
"build": "
|
|
72
|
+
"dev": "tsdown -w --sourcemap",
|
|
73
|
+
"build": "tsdown",
|
|
74
74
|
"release": "node scripts/release.js",
|
|
75
75
|
"test:dev": "vitest",
|
|
76
76
|
"test": "vitest run",
|
|
77
|
+
"typecheck": "tsc --noEmit",
|
|
77
78
|
"weapp": "tsx src/cli.ts",
|
|
78
79
|
"debug": "tsx src/cli.ts config",
|
|
79
80
|
"raw": "node bin/weapp.js",
|