weapp-ide-cli 5.0.0 → 5.0.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +66 -2
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -1,56 +1,120 @@
1
+ /**
2
+ * @description 运行支付宝小程序 CLI(minidev)
3
+ */
1
4
  declare function runMinidev(argv: readonly string[]): Promise<void>;
2
5
 
6
+ /**
7
+ * @description 交互式提示并保存 CLI 路径
8
+ */
3
9
  declare function promptForCliPath(): Promise<string | null>;
4
10
 
11
+ /**
12
+ * @description 解析 CLI 路径并校验可用性
13
+ */
5
14
  declare function resolveCliPath(): Promise<{
6
15
  cliPath: string | null;
7
16
  source: ConfigSource;
8
17
  }>;
9
18
 
19
+ /**
20
+ * @description CLI 入口解析与分发
21
+ */
10
22
  declare function parse(argv: string[]): Promise<void>;
11
23
 
24
+ /**
25
+ * @description 基础配置
26
+ */
12
27
  interface BaseConfig {
13
28
  cliPath: string;
14
29
  }
30
+ /**
31
+ * @description 配置来源
32
+ */
15
33
  type ConfigSource = 'custom' | 'default' | 'missing';
34
+ /**
35
+ * @description 解析后的配置
36
+ */
16
37
  interface ResolvedConfig extends BaseConfig {
17
38
  source: ConfigSource;
18
39
  }
40
+ /**
41
+ * @description CLI 参数别名配置
42
+ */
19
43
  interface AliasEntry {
20
44
  find: string;
21
45
  replacement: string;
22
46
  }
23
47
 
48
+ /**
49
+ * @description 写入自定义 CLI 路径配置
50
+ */
24
51
  declare function createCustomConfig(params: BaseConfig): Promise<string>;
25
52
 
53
+ /**
54
+ * @description 默认自定义配置目录
55
+ */
26
56
  declare const defaultCustomConfigDirPath: string;
57
+ /**
58
+ * @description 默认自定义配置文件路径
59
+ */
27
60
  declare const defaultCustomConfigFilePath: string;
28
61
 
62
+ /**
63
+ * @description 读取并解析 CLI 配置(自定义优先)
64
+ */
29
65
  declare function getConfig(): Promise<ResolvedConfig>;
30
66
 
31
67
  /**
32
- * 官方微信开发者工具只支持 Windows、macOS, Linux只有社区版 https://github.com/msojocs/wechat-web-devtools-linux
68
+ * @description 官方微信开发者工具只支持 Windows、macOS,Linux 只有社区版
69
+ * https://github.com/msojocs/wechat-web-devtools-linux
33
70
  */
34
71
  declare const SupportedPlatformsMap: {
35
72
  readonly Windows_NT: "Windows_NT";
36
73
  readonly Darwin: "Darwin";
37
74
  readonly Linux: "Linux";
38
75
  };
76
+ /**
77
+ * @description 支持的系统类型
78
+ */
39
79
  type SupportedPlatform = (typeof SupportedPlatformsMap)[keyof typeof SupportedPlatformsMap];
80
+ /**
81
+ * @description 判断当前系统是否支持微信开发者工具
82
+ */
40
83
  declare function isOperatingSystemSupported(osName?: string): osName is SupportedPlatform;
84
+ /**
85
+ * @description 当前系统名称
86
+ */
41
87
  declare const operatingSystemName: string;
88
+ /**
89
+ * @description 获取默认 CLI 路径(按系统)
90
+ */
42
91
  declare function getDefaultCliPath(targetOs?: string): Promise<string | undefined>;
43
92
 
93
+ /**
94
+ * @description argv 处理函数
95
+ */
44
96
  type ArgvTransform = (argv: readonly string[]) => string[];
45
97
  /**
46
- * Apply a list of argv transforms in order while keeping the original argv untouched.
98
+ * @description 依次应用 argv 处理函数(不修改原始 argv
47
99
  */
48
100
  declare function transformArgv(argv: readonly string[], transforms: readonly ArgvTransform[]): string[];
101
+ /**
102
+ * @description 创建参数别名转换器
103
+ */
49
104
  declare function createAlias(entry: AliasEntry): ArgvTransform;
105
+ /**
106
+ * @description 创建路径参数兼容转换器(补全或规范化路径)
107
+ */
50
108
  declare function createPathCompat(option: string): ArgvTransform;
51
109
 
110
+ /**
111
+ * @description 执行 CLI 命令并透传输出
112
+ */
52
113
  declare function execute(cliPath: string, argv: string[]): Promise<void>;
53
114
 
115
+ /**
116
+ * @description 解析为绝对路径(基于当前工作目录)
117
+ */
54
118
  declare function resolvePath(filePath: string): string;
55
119
 
56
120
  export { type ArgvTransform, type BaseConfig, type ConfigSource, type ResolvedConfig, type SupportedPlatform, SupportedPlatformsMap, createAlias, createCustomConfig, createPathCompat, defaultCustomConfigDirPath, defaultCustomConfigFilePath, execute, getConfig, getDefaultCliPath, isOperatingSystemSupported, operatingSystemName, parse, promptForCliPath, resolveCliPath, resolvePath, runMinidev, transformArgv };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-ide-cli",
3
3
  "type": "module",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "description": "让微信开发者工具,用起来更加方便!",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "execa": "9.6.1",
66
66
  "fs-extra": "^11.3.3",
67
67
  "pathe": "^2.0.3",
68
- "@weapp-core/logger": "^3.0.0"
68
+ "@weapp-core/logger": "^3.0.3"
69
69
  },
70
70
  "scripts": {
71
71
  "dev": "tsup --watch --sourcemap",