@weapp-vite/miniprogram-automator 1.4.0 → 1.5.0
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/index.d.mts +0 -50
- package/dist/index.mjs +48 -89
- package/dist/{launch-ElaGbFxh.mjs → launch-DuW7r68J.mjs} +1063 -932
- package/dist/operation.d.mts +1 -7
- package/dist/operation.mjs +3 -6
- package/package.json +3 -3
package/dist/operation.d.mts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
//#region src/operation/errors.d.ts
|
|
2
1
|
export declare const OPERATION_TIMEOUT_CODE = "DEVTOOLS_OPERATION_TIMEOUT";
|
|
3
2
|
export type OperationErrorCategory = 'invalid-path' | 'login-required' | 'service-unavailable' | 'connection-transient' | 'protocol-rejected' | 'timeout' | 'canceled' | 'unknown';
|
|
4
3
|
/** 根据原始错误链分类;未知错误默认不重试,路径和登录错误优先。 */
|
|
5
4
|
export declare function classifyOperationError(error: unknown): OperationErrorCategory;
|
|
6
5
|
export declare function isRecoverableOperationError(error: unknown): boolean;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/operation/login.d.ts
|
|
9
6
|
/** 只采用原生 CLI 明确且不矛盾的 login 布尔字段,不推断日志语义。 */
|
|
10
7
|
export declare function readWechatLoginState(stdout: string): boolean | undefined;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/operation/index.d.ts
|
|
13
8
|
export interface OperationStepOptions<T> {
|
|
14
9
|
stage?: string;
|
|
15
10
|
waitForExit?: boolean;
|
|
@@ -60,5 +55,4 @@ export declare class OperationLifecycle {
|
|
|
60
55
|
pause(ms: number): Promise<void>;
|
|
61
56
|
private cleanup;
|
|
62
57
|
run<T>(factory: (lifecycle: OperationLifecycle) => Promise<T>): Promise<T>;
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
58
|
+
}
|
package/dist/operation.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stripVTControlCharacters } from "node:util";
|
|
2
|
-
|
|
2
|
+
// src/operation/errors.ts
|
|
3
3
|
const OPERATION_TIMEOUT_CODE = "DEVTOOLS_OPERATION_TIMEOUT";
|
|
4
4
|
/** 根据原始错误链分类;未知错误默认不重试,路径和登录错误优先。 */
|
|
5
5
|
function classifyOperationError(error) {
|
|
@@ -35,8 +35,7 @@ function isRecoverableOperationError(error) {
|
|
|
35
35
|
const category = classifyOperationError(error);
|
|
36
36
|
return category === "connection-transient" || category === "service-unavailable" || category === "timeout";
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
//#region src/operation/login.ts
|
|
38
|
+
// src/operation/login.ts
|
|
40
39
|
/** 只采用原生 CLI 明确且不矛盾的 login 布尔字段,不推断日志语义。 */
|
|
41
40
|
function readWechatLoginState(stdout) {
|
|
42
41
|
const results = /* @__PURE__ */ new Set();
|
|
@@ -46,8 +45,7 @@ function readWechatLoginState(stdout) {
|
|
|
46
45
|
} catch {}
|
|
47
46
|
return results.size === 1 ? [...results][0] : void 0;
|
|
48
47
|
}
|
|
49
|
-
|
|
50
|
-
//#region src/operation/index.ts
|
|
48
|
+
// src/operation/index.ts
|
|
51
49
|
const errorDiagnostics = /* @__PURE__ */ new WeakMap();
|
|
52
50
|
/** 一次操作共享绝对截止时间;超时取消底层 I/O,并隔离迟到结果。 */
|
|
53
51
|
var OperationLifecycle = class OperationLifecycle {
|
|
@@ -229,5 +227,4 @@ var OperationLifecycle = class OperationLifecycle {
|
|
|
229
227
|
}
|
|
230
228
|
}
|
|
231
229
|
};
|
|
232
|
-
//#endregion
|
|
233
230
|
export { OPERATION_TIMEOUT_CODE, OperationLifecycle, classifyOperationError, isRecoverableOperationError, readWechatLoginState };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/miniprogram-automator",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "完全兼容微信 miniprogram-automator 的现代化替代实现",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": "^
|
|
48
|
+
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@weapp-vite/qr": "1.
|
|
51
|
+
"@weapp-vite/qr": "1.2.0",
|
|
52
52
|
"obug": "^3.0.0",
|
|
53
53
|
"ws": "^8.22.0"
|
|
54
54
|
},
|