weapp-ide-cli 5.2.4 → 5.2.5
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 +47 -0
- package/dist/{cli-CfovXw-V.js → cli-D7gUmbTG.js} +1068 -210
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +358 -9
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -65,9 +65,13 @@ interface ParsedAutomatorArgs {
|
|
|
65
65
|
*/
|
|
66
66
|
declare function parseAutomatorArgs(argv: readonly string[]): ParsedAutomatorArgs;
|
|
67
67
|
/**
|
|
68
|
-
* @description
|
|
68
|
+
* @description 读取选项值,支持多个别名,以及 --option value 与 --option=value。
|
|
69
69
|
*/
|
|
70
|
-
declare function readOptionValue(argv: readonly string[],
|
|
70
|
+
declare function readOptionValue(argv: readonly string[], ...optionNames: string[]): string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* @description 读取布尔选项,支持裸 flag、--flag=true/false 与 --flag true/false。
|
|
73
|
+
*/
|
|
74
|
+
declare function readBooleanOption(argv: readonly string[], ...optionNames: string[]): boolean | undefined;
|
|
71
75
|
/**
|
|
72
76
|
* @description 删除参数中的指定选项(同时支持 --opt value 与 --opt=value)。
|
|
73
77
|
*/
|
|
@@ -254,6 +258,66 @@ declare function parseCompareArgs(argv: string[]): CompareOptions;
|
|
|
254
258
|
*/
|
|
255
259
|
declare function handleConfigCommand(argv: string[]): Promise<void>;
|
|
256
260
|
//#endregion
|
|
261
|
+
//#region src/cli/http.d.ts
|
|
262
|
+
interface WechatDevtoolsHttpCommandOptions {
|
|
263
|
+
port?: number;
|
|
264
|
+
timeoutMs?: number;
|
|
265
|
+
}
|
|
266
|
+
interface WechatDevtoolsEngineBuildResult {
|
|
267
|
+
msg?: string;
|
|
268
|
+
status?: string;
|
|
269
|
+
}
|
|
270
|
+
interface StartWechatIdeEngineBuildResult {
|
|
271
|
+
body: string;
|
|
272
|
+
}
|
|
273
|
+
interface PollWechatIdeEngineBuildResult extends WechatDevtoolsEngineBuildResult {
|
|
274
|
+
body: string;
|
|
275
|
+
done: boolean;
|
|
276
|
+
failed: boolean;
|
|
277
|
+
}
|
|
278
|
+
declare function requestWechatDevtoolsHttp(pathname: string, query: Record<string, string>, options?: WechatDevtoolsHttpCommandOptions): Promise<string>;
|
|
279
|
+
/**
|
|
280
|
+
* @description 通过微信开发者工具 HTTP 服务端口重新打开项目;若项目已打开,开发者工具会刷新当前项目。
|
|
281
|
+
*/
|
|
282
|
+
declare function openWechatIdeProjectByHttp(projectPath: string, options?: WechatDevtoolsHttpCommandOptions): Promise<string>;
|
|
283
|
+
/**
|
|
284
|
+
* @description 通过微信开发者工具 HTTP 服务端口重置当前项目的 fileutils 状态。
|
|
285
|
+
*/
|
|
286
|
+
declare function resetWechatIdeFileUtilsByHttp(projectPath: string, options?: WechatDevtoolsHttpCommandOptions): Promise<string>;
|
|
287
|
+
/**
|
|
288
|
+
* @description 通过微信开发者工具 HTTP 服务端口触发 engine build。
|
|
289
|
+
*/
|
|
290
|
+
declare function startWechatIdeEngineBuildByHttp(projectPath: string, options?: WechatDevtoolsHttpCommandOptions): Promise<StartWechatIdeEngineBuildResult>;
|
|
291
|
+
/**
|
|
292
|
+
* @description 轮询微信开发者工具 engine build 状态。
|
|
293
|
+
*/
|
|
294
|
+
declare function pollWechatIdeEngineBuildResultByHttp(options?: WechatDevtoolsHttpCommandOptions): Promise<PollWechatIdeEngineBuildResult>;
|
|
295
|
+
declare const WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES: {
|
|
296
|
+
readonly BUILDING: "BUILDING";
|
|
297
|
+
readonly END: "END";
|
|
298
|
+
readonly ERROR: "ERROR";
|
|
299
|
+
readonly NOT_START: "NOT_START";
|
|
300
|
+
readonly OPEN_PROJECT: "OPEN_PROJECT";
|
|
301
|
+
};
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/cli/engine.d.ts
|
|
304
|
+
interface RunWechatIdeEngineBuildByHttpOptions extends WechatDevtoolsHttpCommandOptions {
|
|
305
|
+
onProgress?: (result: PollWechatIdeEngineBuildResult) => void;
|
|
306
|
+
overallTimeoutMs?: number;
|
|
307
|
+
pollIntervalMs?: number;
|
|
308
|
+
}
|
|
309
|
+
interface RunWechatIdeEngineBuildOptions extends RunWechatIdeEngineBuildByHttpOptions {
|
|
310
|
+
logPath?: string;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* @description 通过开发者工具 HTTP 服务端口执行 engine build,并轮询直到构建结束。
|
|
314
|
+
*/
|
|
315
|
+
declare function runWechatIdeEngineBuildByHttp(projectPath: string, options?: RunWechatIdeEngineBuildByHttpOptions): Promise<PollWechatIdeEngineBuildResult>;
|
|
316
|
+
/**
|
|
317
|
+
* @description 以更接近官方 CLI 的方式执行 engine build,并支持将构建日志写入文件。
|
|
318
|
+
*/
|
|
319
|
+
declare function runWechatIdeEngineBuild(projectPath: string, options?: RunWechatIdeEngineBuildOptions): Promise<PollWechatIdeEngineBuildResult>;
|
|
320
|
+
//#endregion
|
|
257
321
|
//#region src/cli/forwardConsole.d.ts
|
|
258
322
|
type ForwardConsoleLogLevel = 'debug' | 'log' | 'info' | 'warn' | 'error';
|
|
259
323
|
interface ForwardConsoleEvent {
|
|
@@ -275,6 +339,31 @@ interface ForwardConsoleSession {
|
|
|
275
339
|
*/
|
|
276
340
|
declare function startForwardConsole(options: ForwardConsoleOptions): Promise<ForwardConsoleSession>;
|
|
277
341
|
//#endregion
|
|
342
|
+
//#region src/cli/inputCoordinator.d.ts
|
|
343
|
+
interface SharedInputSessionOptions {
|
|
344
|
+
onData?: (chunk: string | Uint8Array) => void;
|
|
345
|
+
onKeypress?: (str: string, key: {
|
|
346
|
+
name?: string;
|
|
347
|
+
ctrl?: boolean;
|
|
348
|
+
} | undefined) => void;
|
|
349
|
+
}
|
|
350
|
+
interface SharedInputSession {
|
|
351
|
+
close: () => void;
|
|
352
|
+
resume: () => void;
|
|
353
|
+
suspend: () => void;
|
|
354
|
+
}
|
|
355
|
+
interface ExclusiveKeypressOptions<T> {
|
|
356
|
+
ignoreInitialMs?: number;
|
|
357
|
+
timeoutMs?: number;
|
|
358
|
+
onKeypress: (str: string, key: {
|
|
359
|
+
name?: string;
|
|
360
|
+
ctrl?: boolean;
|
|
361
|
+
} | undefined) => T | undefined;
|
|
362
|
+
}
|
|
363
|
+
declare function createSharedInputSession(options: SharedInputSessionOptions): SharedInputSession | undefined;
|
|
364
|
+
declare function waitForExclusiveKeypress<T>(options: ExclusiveKeypressOptions<T>): Promise<T | 'timeout'>;
|
|
365
|
+
declare function runWithSuspendedSharedInput<T>(runner: () => Promise<T>): Promise<T>;
|
|
366
|
+
//#endregion
|
|
278
367
|
//#region src/cli/minidev.d.ts
|
|
279
368
|
/**
|
|
280
369
|
* @description 运行支付宝小程序 CLI(minidev)
|
|
@@ -300,15 +389,36 @@ declare function resolveCliPath(): Promise<{
|
|
|
300
389
|
interface RetryKeypressOptions {
|
|
301
390
|
timeoutMs?: number;
|
|
302
391
|
}
|
|
392
|
+
interface RetryPromptOptions extends RetryKeypressOptions {
|
|
393
|
+
logger: {
|
|
394
|
+
info: (message: string) => void;
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
interface RetryLogger {
|
|
398
|
+
error: (message: string) => void;
|
|
399
|
+
info: (message: string) => void;
|
|
400
|
+
warn: (message: string) => void;
|
|
401
|
+
}
|
|
402
|
+
interface WechatIdeLoginRetryOptions {
|
|
403
|
+
allowRetry?: boolean;
|
|
404
|
+
cancelLevel?: 'info' | 'warn';
|
|
405
|
+
error: unknown;
|
|
406
|
+
logger: RetryLogger;
|
|
407
|
+
promptOpenIdeLogin?: boolean;
|
|
408
|
+
retryTimeoutMs?: number;
|
|
409
|
+
}
|
|
303
410
|
type RetryPromptResult = 'retry' | 'cancel' | 'timeout';
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
declare function isWechatIdeLoginRequiredError(error: unknown): boolean;
|
|
411
|
+
declare const RETRY_PROMPT_INITIAL_IGNORE_MS = 300;
|
|
412
|
+
declare const RETRY_CONFIRM_KEYS: readonly ["y"];
|
|
413
|
+
declare const RETRY_CANCEL_KEYS: readonly ["q", "Esc", "Ctrl+C"];
|
|
308
414
|
/**
|
|
309
415
|
* @description 提取执行错误文本,便于统一匹配与提示。
|
|
310
416
|
*/
|
|
311
417
|
declare function extractExecutionErrorText(error: unknown): string;
|
|
418
|
+
/**
|
|
419
|
+
* @description 判断是否为微信开发者工具登录失效错误。
|
|
420
|
+
*/
|
|
421
|
+
declare function isWechatIdeLoginRequiredError(error: unknown): boolean;
|
|
312
422
|
/**
|
|
313
423
|
* @description 将登录失效错误格式化为更易读的摘要。
|
|
314
424
|
*/
|
|
@@ -321,13 +431,21 @@ declare function createWechatIdeLoginRequiredExitError(error: unknown, reason?:
|
|
|
321
431
|
exitCode: number;
|
|
322
432
|
};
|
|
323
433
|
/**
|
|
324
|
-
* @description
|
|
434
|
+
* @description 交互等待用户按 y 重试,按 q 或 Ctrl+C 取消。
|
|
325
435
|
*/
|
|
326
436
|
declare function waitForRetryKeypress(options?: RetryKeypressOptions): Promise<RetryPromptResult>;
|
|
327
437
|
/**
|
|
328
438
|
* @description 生成重试按键提示,并高亮关键热键。
|
|
329
439
|
*/
|
|
330
440
|
declare function formatRetryHotkeyPrompt(timeoutMs?: number): string;
|
|
441
|
+
/**
|
|
442
|
+
* @description 输出重试热键提示,并独占等待当前提示对应的按键输入。
|
|
443
|
+
*/
|
|
444
|
+
declare function promptRetryKeypress(options: RetryPromptOptions): Promise<RetryPromptResult>;
|
|
445
|
+
/**
|
|
446
|
+
* @description 统一处理微信开发者工具登录失效场景下的提示与重试交互。
|
|
447
|
+
*/
|
|
448
|
+
declare function promptWechatIdeLoginRetry(options: WechatIdeLoginRetryOptions): Promise<"cancel" | "retry">;
|
|
331
449
|
//#endregion
|
|
332
450
|
//#region src/cli/run.d.ts
|
|
333
451
|
/**
|
|
@@ -355,12 +473,26 @@ declare function getAutomatorCommandHelp(command: string): string | undefined;
|
|
|
355
473
|
declare function runAutomatorCommand(command: string, argv: string[]): Promise<void>;
|
|
356
474
|
//#endregion
|
|
357
475
|
//#region src/cli/run-login.d.ts
|
|
358
|
-
type LoginRetryMode = 'never' | 'once' | 'always';
|
|
359
476
|
/**
|
|
360
477
|
* @description 运行微信开发者工具 CLI,并在登录失效时允许按键重试。
|
|
361
478
|
*/
|
|
362
479
|
declare function runWechatCliWithRetry(cliPath: string, argv: string[]): Promise<void>;
|
|
363
480
|
//#endregion
|
|
481
|
+
//#region src/cli/run-login-executor.d.ts
|
|
482
|
+
interface RetryableCommandExecutorOptions<TResult, TPromptResult> {
|
|
483
|
+
createCancelError: (error: unknown) => Error;
|
|
484
|
+
execute: () => Promise<TResult>;
|
|
485
|
+
isRetryableResult: (result: TResult) => boolean;
|
|
486
|
+
onCancel?: (error: unknown) => void;
|
|
487
|
+
onRetry?: () => void;
|
|
488
|
+
promptRetry: (error: unknown, retryCount: number) => Promise<TPromptResult>;
|
|
489
|
+
shouldRetry: (result: TPromptResult) => boolean;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* @description 执行可重试命令循环,并将“是否可重试”与“如何提示重试”交给调用方定义。
|
|
493
|
+
*/
|
|
494
|
+
declare function runRetryableCommand<TResult, TPromptResult>(options: RetryableCommandExecutorOptions<TResult, TPromptResult>): Promise<TResult>;
|
|
495
|
+
//#endregion
|
|
364
496
|
//#region src/cli/screenshot.d.ts
|
|
365
497
|
/**
|
|
366
498
|
* @description Print help for screenshot command
|
|
@@ -377,6 +509,223 @@ declare function parseScreenshotArgs(argv: string[]): ScreenshotOptions;
|
|
|
377
509
|
*/
|
|
378
510
|
declare function validateWechatCliCommandArgs(argv: readonly string[]): void;
|
|
379
511
|
//#endregion
|
|
512
|
+
//#region src/cli/wechat-commands.d.ts
|
|
513
|
+
interface LoginWechatIdeOptions {
|
|
514
|
+
qrFormat?: 'base64' | 'image' | 'terminal';
|
|
515
|
+
qrOutput?: string;
|
|
516
|
+
qrSize?: string;
|
|
517
|
+
resultOutput?: string;
|
|
518
|
+
}
|
|
519
|
+
interface OpenWechatIdeOptions {
|
|
520
|
+
appid?: string;
|
|
521
|
+
extAppid?: string;
|
|
522
|
+
platform?: string;
|
|
523
|
+
projectPath?: string;
|
|
524
|
+
trustProject?: boolean;
|
|
525
|
+
}
|
|
526
|
+
interface BuildWechatIdeNpmOptions {
|
|
527
|
+
compileType?: string;
|
|
528
|
+
projectPath?: string;
|
|
529
|
+
}
|
|
530
|
+
interface PreviewWechatIdeOptions {
|
|
531
|
+
appid?: string;
|
|
532
|
+
compileCondition?: string;
|
|
533
|
+
extAppid?: string;
|
|
534
|
+
infoOutput?: string;
|
|
535
|
+
projectPath?: string;
|
|
536
|
+
qrFormat?: 'base64' | 'image' | 'terminal';
|
|
537
|
+
qrOutput?: string;
|
|
538
|
+
qrSize?: string;
|
|
539
|
+
}
|
|
540
|
+
interface AutoPreviewWechatIdeOptions {
|
|
541
|
+
appid?: string;
|
|
542
|
+
compileCondition?: string;
|
|
543
|
+
extAppid?: string;
|
|
544
|
+
infoOutput?: string;
|
|
545
|
+
projectPath?: string;
|
|
546
|
+
}
|
|
547
|
+
interface UploadWechatIdeOptions {
|
|
548
|
+
appid?: string;
|
|
549
|
+
desc: string;
|
|
550
|
+
extAppid?: string;
|
|
551
|
+
infoOutput?: string;
|
|
552
|
+
projectPath?: string;
|
|
553
|
+
version: string;
|
|
554
|
+
}
|
|
555
|
+
interface AutoWechatIdeOptions {
|
|
556
|
+
account?: string;
|
|
557
|
+
appid?: string;
|
|
558
|
+
extAppid?: string;
|
|
559
|
+
port?: string;
|
|
560
|
+
projectPath?: string;
|
|
561
|
+
testTicket?: string;
|
|
562
|
+
ticket?: string;
|
|
563
|
+
trustProject?: boolean;
|
|
564
|
+
}
|
|
565
|
+
interface AutoReplayWechatIdeOptions {
|
|
566
|
+
account?: string;
|
|
567
|
+
appid?: string;
|
|
568
|
+
extAppid?: string;
|
|
569
|
+
port?: string;
|
|
570
|
+
projectPath?: string;
|
|
571
|
+
replayAll?: boolean;
|
|
572
|
+
replayConfigPath?: string;
|
|
573
|
+
testTicket?: string;
|
|
574
|
+
ticket?: string;
|
|
575
|
+
trustProject?: boolean;
|
|
576
|
+
}
|
|
577
|
+
interface OpenWechatIdeOtherProjectOptions {
|
|
578
|
+
projectPath?: string;
|
|
579
|
+
}
|
|
580
|
+
interface ClearWechatIdeCacheOptions {
|
|
581
|
+
clean: 'all' | 'auth' | 'compile' | 'file' | 'network' | 'session' | 'storage';
|
|
582
|
+
}
|
|
583
|
+
interface ResetWechatIdeFileUtilsOptions {
|
|
584
|
+
projectPath: string;
|
|
585
|
+
}
|
|
586
|
+
interface WechatIdeAutomatorSessionOptions {
|
|
587
|
+
preferOpenedSession?: boolean;
|
|
588
|
+
projectPath: string;
|
|
589
|
+
sharedSession?: boolean;
|
|
590
|
+
timeout?: number;
|
|
591
|
+
}
|
|
592
|
+
interface CompileWechatIdeByAutomatorOptions extends WechatIdeAutomatorSessionOptions {
|
|
593
|
+
force?: boolean;
|
|
594
|
+
}
|
|
595
|
+
interface ClearWechatIdeCacheByAutomatorOptions extends WechatIdeAutomatorSessionOptions {
|
|
596
|
+
clean: 'all' | 'auth' | 'compile' | 'file' | 'network' | 'session' | 'storage';
|
|
597
|
+
}
|
|
598
|
+
interface SetWechatIdeTicketOptions extends WechatIdeAutomatorSessionOptions {
|
|
599
|
+
ticket: string;
|
|
600
|
+
}
|
|
601
|
+
interface BuildWechatIdeApkOptions {
|
|
602
|
+
desc?: string;
|
|
603
|
+
isUploadResourceBundle?: boolean;
|
|
604
|
+
keyAlias: string;
|
|
605
|
+
keyPass: string;
|
|
606
|
+
keyStore: string;
|
|
607
|
+
output: string;
|
|
608
|
+
resourceBundleDesc?: string;
|
|
609
|
+
resourceBundleVersion?: string;
|
|
610
|
+
storePass: string;
|
|
611
|
+
useAab?: boolean;
|
|
612
|
+
}
|
|
613
|
+
interface BuildWechatIdeIpaOptions {
|
|
614
|
+
certificateName?: string;
|
|
615
|
+
isDistribute: boolean;
|
|
616
|
+
isRemoteBuild?: boolean;
|
|
617
|
+
isUploadBeta?: boolean;
|
|
618
|
+
isUploadResourceBundle?: boolean;
|
|
619
|
+
output: string;
|
|
620
|
+
p12Password?: string;
|
|
621
|
+
p12Path?: string;
|
|
622
|
+
profilePath?: string;
|
|
623
|
+
resourceBundleDesc?: string;
|
|
624
|
+
resourceBundleVersion?: string;
|
|
625
|
+
tpnsProfilePath?: string;
|
|
626
|
+
versionCode?: number;
|
|
627
|
+
versionDesc?: string;
|
|
628
|
+
versionName?: string;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* @description 调用微信开发者工具 open 命令。
|
|
632
|
+
*/
|
|
633
|
+
declare function openWechatIde(options?: OpenWechatIdeOptions): Promise<void>;
|
|
634
|
+
/**
|
|
635
|
+
* @description 调用微信开发者工具 login 命令。
|
|
636
|
+
*/
|
|
637
|
+
declare function loginWechatIde(options?: LoginWechatIdeOptions): Promise<void>;
|
|
638
|
+
/**
|
|
639
|
+
* @description 调用微信开发者工具 islogin 命令。
|
|
640
|
+
*/
|
|
641
|
+
declare function isWechatIdeLoggedIn(): Promise<void>;
|
|
642
|
+
/**
|
|
643
|
+
* @description 调用微信开发者工具 build-npm 命令。
|
|
644
|
+
*/
|
|
645
|
+
declare function buildWechatIdeNpm(options?: BuildWechatIdeNpmOptions): Promise<void>;
|
|
646
|
+
/**
|
|
647
|
+
* @description 调用微信开发者工具 preview 命令。
|
|
648
|
+
*/
|
|
649
|
+
declare function previewWechatIde(options?: PreviewWechatIdeOptions): Promise<void>;
|
|
650
|
+
/**
|
|
651
|
+
* @description 调用微信开发者工具 auto-preview 命令。
|
|
652
|
+
*/
|
|
653
|
+
declare function autoPreviewWechatIde(options?: AutoPreviewWechatIdeOptions): Promise<void>;
|
|
654
|
+
/**
|
|
655
|
+
* @description 调用微信开发者工具 auto 命令。
|
|
656
|
+
*/
|
|
657
|
+
declare function autoWechatIde(options?: AutoWechatIdeOptions): Promise<void>;
|
|
658
|
+
/**
|
|
659
|
+
* @description 调用微信开发者工具 auto-replay 命令。
|
|
660
|
+
*/
|
|
661
|
+
declare function autoReplayWechatIde(options?: AutoReplayWechatIdeOptions): Promise<void>;
|
|
662
|
+
/**
|
|
663
|
+
* @description 调用微信开发者工具 upload 命令。
|
|
664
|
+
*/
|
|
665
|
+
declare function uploadWechatIde(options: UploadWechatIdeOptions): Promise<void>;
|
|
666
|
+
/**
|
|
667
|
+
* @description 调用微信开发者工具 close 命令。
|
|
668
|
+
*/
|
|
669
|
+
declare function closeWechatIdeProject(): Promise<void>;
|
|
670
|
+
/**
|
|
671
|
+
* @description 调用微信开发者工具 quit 命令。
|
|
672
|
+
*/
|
|
673
|
+
declare function quitWechatIde(): Promise<void>;
|
|
674
|
+
/**
|
|
675
|
+
* @description 调用微信开发者工具 cache 命令。
|
|
676
|
+
*/
|
|
677
|
+
declare function clearWechatIdeCache(options: ClearWechatIdeCacheOptions): Promise<void>;
|
|
678
|
+
/**
|
|
679
|
+
* @description 调用微信开发者工具 open-other 命令。
|
|
680
|
+
*/
|
|
681
|
+
declare function openWechatIdeOtherProject(_options?: OpenWechatIdeOtherProjectOptions): Promise<void>;
|
|
682
|
+
/**
|
|
683
|
+
* @description 通过微信开发者工具 HTTP 服务端口重置指定项目的 fileutils 状态。
|
|
684
|
+
*/
|
|
685
|
+
declare function resetWechatIdeFileUtils(options: ResetWechatIdeFileUtilsOptions): Promise<void>;
|
|
686
|
+
/**
|
|
687
|
+
* @description 通过已打开或新建的 automator 会话获取开发者工具基础信息。
|
|
688
|
+
*/
|
|
689
|
+
declare function getWechatIdeToolInfo(options: WechatIdeAutomatorSessionOptions): Promise<any>;
|
|
690
|
+
/**
|
|
691
|
+
* @description 通过已打开或新建的 automator 会话执行项目编译。
|
|
692
|
+
*/
|
|
693
|
+
declare function compileWechatIdeByAutomator(options: CompileWechatIdeByAutomatorOptions): Promise<any>;
|
|
694
|
+
/**
|
|
695
|
+
* @description 通过已打开或新建的 automator 会话清理开发者工具缓存。
|
|
696
|
+
*/
|
|
697
|
+
declare function clearWechatIdeCacheByAutomator(options: ClearWechatIdeCacheByAutomatorOptions): Promise<any>;
|
|
698
|
+
/**
|
|
699
|
+
* @description 通过已打开或新建的 automator 会话获取当前 ticket。
|
|
700
|
+
*/
|
|
701
|
+
declare function getWechatIdeTicket(options: WechatIdeAutomatorSessionOptions): Promise<any>;
|
|
702
|
+
/**
|
|
703
|
+
* @description 通过已打开或新建的 automator 会话设置 ticket。
|
|
704
|
+
*/
|
|
705
|
+
declare function setWechatIdeTicket(options: SetWechatIdeTicketOptions): Promise<void>;
|
|
706
|
+
/**
|
|
707
|
+
* @description 通过已打开或新建的 automator 会话刷新 ticket。
|
|
708
|
+
*/
|
|
709
|
+
declare function refreshWechatIdeTicket(options: WechatIdeAutomatorSessionOptions): Promise<void>;
|
|
710
|
+
/**
|
|
711
|
+
* @description 通过已打开或新建的 automator 会话获取测试账号列表。
|
|
712
|
+
*/
|
|
713
|
+
declare function getWechatIdeTestAccounts(options: WechatIdeAutomatorSessionOptions): Promise<any>;
|
|
714
|
+
/**
|
|
715
|
+
* @description 调用微信开发者工具 build-apk 命令。
|
|
716
|
+
*/
|
|
717
|
+
declare function buildWechatIdeApk(options: BuildWechatIdeApkOptions): Promise<void>;
|
|
718
|
+
/**
|
|
719
|
+
* @description 调用微信开发者工具 build-ipa 命令。
|
|
720
|
+
*/
|
|
721
|
+
declare function buildWechatIdeIpa(options: BuildWechatIdeIpaOptions): Promise<void>;
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region src/cli/wechat-dispatch.d.ts
|
|
724
|
+
/**
|
|
725
|
+
* @description 优先将高频官方命令分发到 weapp-ide-cli 的稳定 helper,实现更清晰的程序化命令层。
|
|
726
|
+
*/
|
|
727
|
+
declare function dispatchWechatCliCommand(argv: string[]): Promise<boolean>;
|
|
728
|
+
//#endregion
|
|
380
729
|
//#region src/cli/wechatDevtoolsSettings.d.ts
|
|
381
730
|
interface WechatDevtoolsSecuritySettings {
|
|
382
731
|
enableServicePort: boolean;
|
|
@@ -568,4 +917,4 @@ declare function execute(cliPath: string, argv: string[], options?: ExecuteOptio
|
|
|
568
917
|
*/
|
|
569
918
|
declare function resolvePath(filePath: string): string;
|
|
570
919
|
//#endregion
|
|
571
|
-
export { AUTOMATOR_COMMAND_NAMES, ArgvTransform, AuditOptions, AutomatorCommandOptions, AutomatorOptions, AutomatorSessionOptions, type BaseConfig, BootstrapWechatDevtoolsSettingsOptions, BootstrapWechatDevtoolsSettingsResult, CONFIG_COMMAND_NAME, type ConfigSource, DetectWechatDevtoolsServicePortOptions, DetectWechatDevtoolsServicePortResult, DetectedWechatDevtoolsServicePortSettings, ForwardConsoleEvent, ForwardConsoleLogLevel, ForwardConsoleOptions, ForwardConsoleSession, InputOptions,
|
|
920
|
+
export { AUTOMATOR_COMMAND_NAMES, ArgvTransform, AuditOptions, AutoPreviewWechatIdeOptions, AutoReplayWechatIdeOptions, AutoWechatIdeOptions, AutomatorCommandOptions, AutomatorOptions, AutomatorSessionOptions, type BaseConfig, BootstrapWechatDevtoolsSettingsOptions, BootstrapWechatDevtoolsSettingsResult, BuildWechatIdeApkOptions, BuildWechatIdeIpaOptions, BuildWechatIdeNpmOptions, CONFIG_COMMAND_NAME, ClearWechatIdeCacheByAutomatorOptions, ClearWechatIdeCacheOptions, CompileWechatIdeByAutomatorOptions, type ConfigSource, DetectWechatDevtoolsServicePortOptions, DetectWechatDevtoolsServicePortResult, DetectedWechatDevtoolsServicePortSettings, ExclusiveKeypressOptions, ForwardConsoleEvent, ForwardConsoleLogLevel, ForwardConsoleOptions, ForwardConsoleSession, InputOptions, LoginWechatIdeOptions, MINIDEV_NAMESPACE_COMMAND_NAMES, MiniProgramElement, MiniProgramEventMap, MiniProgramLike, MiniProgramPage, NavigateOptions, OpenWechatIdeOptions, OpenWechatIdeOtherProjectOptions, PageDataOptions, PageInfoOptions, ParsedAutomatorArgs, PollWechatIdeEngineBuildResult, PreviewWechatIdeOptions, RETRY_CANCEL_KEYS, RETRY_CONFIRM_KEYS, RETRY_PROMPT_INITIAL_IGNORE_MS, RemoteOptions, ResetWechatIdeFileUtilsOptions, type ResolvedConfig, RetryKeypressOptions, RetryLogger, RetryPromptOptions, RetryPromptResult, RetryableCommandExecutorOptions, RunWechatIdeEngineBuildByHttpOptions, RunWechatIdeEngineBuildOptions, type ScreenshotOptions, type ScreenshotResult, ScrollOptions, SelectorOptions, SetWechatIdeTicketOptions, SharedInputSession, SharedInputSessionOptions, StartWechatIdeEngineBuildResult, SupportedPlatform, SupportedPlatformsMap, TapOptions, UploadWechatIdeOptions, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, WechatDevtoolsEngineBuildResult, WechatDevtoolsHttpCommandOptions, WechatDevtoolsSecuritySettings, WechatIdeAutomatorSessionOptions, WechatIdeLoginRetryOptions, acquireSharedMiniProgram, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeSharedMiniProgram, closeWechatIdeProject, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, launchAutomator, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, pollWechatIdeEngineBuildResultByHttp, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readOptionValue, redirectTo, refreshWechatIdeTicket, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, runAutomatorCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setWechatIdeTicket, startForwardConsole, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, transformArgv, uploadWechatIde, validateWechatCliCommandArgs, waitForExclusiveKeypress, waitForRetryKeypress, withMiniProgram };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { $ as readCustomConfig, A as isAutomatorProtocolTimeoutError, B as getConfiguredLocale, D as formatAutomatorLoginError, E as connectOpenedAutomator, F as launchAutomator, G as operatingSystemName, H as SupportedPlatformsMap, I as bootstrapWechatDevtoolsSettings, J as createAutoBootstrapDevtoolsConfig, L as detectWechatDevtoolsServicePort, M as isDevtoolsExtensionContextInvalidatedError, N as isDevtoolsHttpPortError, O as getAutomatorProtocolTimeoutMethod, P as isRetryableAutomatorLaunchError, Q as overwriteCustomConfig, R as resolveCliPath, S as withMiniProgram, U as getDefaultCliPath, V as resolveDevtoolsAutomationDefaults, W as isOperatingSystemSupported, X as createCustomConfig, Y as createAutoTrustProjectConfig, Z as createLocaleConfig, _ as acquireSharedMiniProgram, a as navigateBack, b as getSharedMiniProgramSessionCount, c as pageStack, d as remote, et as removeCustomConfigKey, f as scrollTo, g as tap, h as takeScreenshot, i as input, j as isAutomatorWsConnectError, k as isAutomatorLoginError, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, nt as defaultCustomConfigFilePath, o as navigateTo, p as switchTab, r as currentPage, rt as resolvePath, s as pageData, t as audit, tt as defaultCustomConfigDirPath, u as redirectTo, v as closeSharedMiniProgram, x as releaseSharedMiniProgram, y as connectMiniProgram, z as getConfig } from "./commands-XD_wemcg.js";
|
|
2
|
-
import { A as
|
|
3
|
-
export { AUTOMATOR_COMMAND_NAMES, CONFIG_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, SupportedPlatformsMap, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, acquireSharedMiniProgram, audit, bootstrapWechatDevtoolsSettings, captureScreenshotBuffer, closeSharedMiniProgram, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getSharedMiniProgramSessionCount, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeLoginRequiredError, launchAutomator, navigateBack, navigateTo, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, printCompareHelp, printScreenshotHelp, promptForCliPath, reLaunch, readCustomConfig, readOptionValue, redirectTo, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, runAutomatorCommand, runMinidev, runWechatCliWithRetry, scrollTo, startForwardConsole, switchTab, systemInfo, takeScreenshot, tap, transformArgv, validateWechatCliCommandArgs, waitForRetryKeypress, withMiniProgram };
|
|
2
|
+
import { $ as resetWechatIdeFileUtilsByHttp, A as RETRY_CANCEL_KEYS, B as waitForRetryKeypress, C as refreshWechatIdeTicket, D as validateWechatCliCommandArgs, E as uploadWechatIde, F as formatRetryHotkeyPrompt, G as transformArgv, H as execute, I as formatWechatIdeLoginRequiredError, J as runWechatIdeEngineBuildByHttp, K as startForwardConsole, L as isWechatIdeLoginRequiredError, M as RETRY_PROMPT_INITIAL_IGNORE_MS, N as createWechatIdeLoginRequiredExitError, O as runWechatCliWithRetry, P as extractExecutionErrorText, Q as requestWechatDevtoolsHttp, R as promptRetryKeypress, S as quitWechatIde, St as removeOption, T as setWechatIdeTicket, U as createAlias, V as runMinidev, W as createPathCompat, X as openWechatIdeProjectByHttp, Y as WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, Z as pollWechatIdeEngineBuildResultByHttp, _ as isWechatIdeLoggedIn, _t as parseCompareArgs, a as autoReplayWechatIde, at as waitForExclusiveKeypress, b as openWechatIdeOtherProject, bt as readBooleanOption, c as buildWechatIdeIpa, ct as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, d as clearWechatIdeCacheByAutomator, dt as AUTOMATOR_COMMAND_NAMES, et as startWechatIdeEngineBuildByHttp, f as closeWechatIdeProject, ft as getAutomatorCommandHelp, g as getWechatIdeToolInfo, gt as printScreenshotHelp, h as getWechatIdeTicket, ht as parseScreenshotArgs, i as autoPreviewWechatIde, it as runWithSuspendedSharedInput, j as RETRY_CONFIRM_KEYS, k as runRetryableCommand, l as buildWechatIdeNpm, lt as WECHAT_CLI_COMMAND_NAMES, m as getWechatIdeTestAccounts, mt as runAutomatorCommand, n as parse, nt as promptForCliPath, o as autoWechatIde, ot as CONFIG_COMMAND_NAME, p as compileWechatIdeByAutomator, pt as isAutomatorCommand, q as runWechatIdeEngineBuild, r as dispatchWechatCliCommand, rt as createSharedInputSession, s as buildWechatIdeApk, st as MINIDEV_NAMESPACE_COMMAND_NAMES, t as createCli, tt as handleConfigCommand, u as clearWechatIdeCache, ut as isWeappIdeTopLevelCommand, v as loginWechatIde, vt as printCompareHelp, w as resetWechatIdeFileUtils, x as previewWechatIde, xt as readOptionValue, y as openWechatIde, yt as parseAutomatorArgs, z as promptWechatIdeLoginRetry } from "./cli-D7gUmbTG.js";
|
|
3
|
+
export { AUTOMATOR_COMMAND_NAMES, CONFIG_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, RETRY_CANCEL_KEYS, RETRY_CONFIRM_KEYS, RETRY_PROMPT_INITIAL_IGNORE_MS, SupportedPlatformsMap, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, acquireSharedMiniProgram, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeSharedMiniProgram, closeWechatIdeProject, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, launchAutomator, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, pollWechatIdeEngineBuildResultByHttp, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readOptionValue, redirectTo, refreshWechatIdeTicket, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, runAutomatorCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setWechatIdeTicket, startForwardConsole, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, transformArgv, uploadWechatIde, validateWechatCliCommandArgs, waitForExclusiveKeypress, 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.2.
|
|
4
|
+
"version": "5.2.5",
|
|
5
5
|
"description": "让微信开发者工具,用起来更加方便!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"pathe": "^2.0.3",
|
|
68
68
|
"pixelmatch": "^7.1.0",
|
|
69
69
|
"pngjs": "^7.0.0",
|
|
70
|
-
"@weapp-core/logger": "^3.1.1",
|
|
71
70
|
"@weapp-core/shared": "^3.0.4",
|
|
72
|
-
"@weapp-vite/miniprogram-automator": "1.0.
|
|
71
|
+
"@weapp-vite/miniprogram-automator": "1.0.4",
|
|
72
|
+
"@weapp-core/logger": "^3.1.1"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"dev": "tsdown -w --sourcemap",
|