@zleap-ai/app-cli 0.10.0 → 0.12.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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @zleap-ai/app-cli
2
2
 
3
3
  zleapOS 云开发命令行工具 `zleap-app` 的 npm 发行版。安装时 npm 只会下载与你的系统匹配的那一个预编译二进制
4
- (`@zleap-ai/app-cli-<os>-<arch>`),不需要 Go 环境。
4
+ (`@zleap-ai/app-cli-darwin` / `-linux-x64` / `-linux-arm64` / `-win32-x64`),不需要 Go 环境。
5
5
 
6
6
  ```bash
7
7
  npx @zleap-ai/app-cli # 查看版本与命令列表
@@ -9,7 +9,7 @@ npm i -D @zleap-ai/app-cli # 作为项目开发依赖(脚手架默
9
9
  npx zleap-app check ./dist
10
10
  ```
11
11
 
12
- 支持平台:macOS(arm64 / x64)、Linux(x64 / arm64)、Windows(x64 / arm64)。
12
+ 支持平台:macOS(arm64 / x64,同一个通用二进制)、Linux(x64 / arm64)、Windows(x64;Windows 11 on ARM 用系统自带的 x64 仿真运行同一个包)。
13
13
 
14
14
  ## 常用命令
15
15
 
package/lib/resolve.js CHANGED
@@ -1,22 +1,26 @@
1
1
  'use strict';
2
2
  // 解析当前平台对应的 zleap-app 预编译二进制。
3
3
  // 查找顺序:ZLEAP_APP_BINARY 环境变量 → 平台子包(optionalDependencies)→ 报错并给出修复建议。
4
- // 不在安装阶段联网下载,也不回退到其他平台的二进制。
4
+ // 不在安装阶段联网下载;除下表明确列出的仿真运行外,不回退到其他平台的二进制。
5
5
 
6
6
  const fs = require('node:fs');
7
7
  const path = require('node:path');
8
8
 
9
- // 平台子包命名为「主包名-平台-架构」,主包改名(kit.config.json)时自动跟随。
9
+ // 平台子包命名为「主包名-<key>」,主包改名(kit.config.json)时自动跟随。
10
10
  const BASE = require('../package.json').name;
11
11
 
12
- const SUPPORTED = new Set([
13
- 'darwin-arm64',
14
- 'darwin-x64',
15
- 'linux-x64',
16
- 'linux-arm64',
17
- 'win32-x64',
18
- 'win32-arm64',
19
- ]);
12
+ // 运行平台 → 平台子包 key。与 kit.config.json 的 platforms 对应(npm run check 会核对):
13
+ // macOS 两种架构共用一个通用二进制;Windows 11 on ARM 用自带的 x64 仿真跑 win32-x64。
14
+ const PACKAGES = {
15
+ 'darwin-arm64': 'darwin',
16
+ 'darwin-x64': 'darwin',
17
+ 'linux-x64': 'linux-x64',
18
+ 'linux-arm64': 'linux-arm64',
19
+ 'win32-x64': 'win32-x64',
20
+ 'win32-arm64': 'win32-x64',
21
+ };
22
+
23
+ const SUPPORTED = new Set(Object.keys(PACKAGES));
20
24
 
21
25
  function platformKey(platform = process.platform, arch = process.arch) {
22
26
  return `${platform}-${arch}`;
@@ -27,7 +31,8 @@ function binaryName(platform = process.platform) {
27
31
  }
28
32
 
29
33
  function platformPackage(platform = process.platform, arch = process.arch) {
30
- return `${BASE}-${platformKey(platform, arch)}`;
34
+ const key = platformKey(platform, arch);
35
+ return `${BASE}-${PACKAGES[key] || key}`;
31
36
  }
32
37
 
33
38
  class BinaryNotFoundError extends Error {
@@ -77,4 +82,4 @@ function resolveBinary(options = {}) {
77
82
  return binary;
78
83
  }
79
84
 
80
- module.exports = { resolveBinary, platformKey, platformPackage, binaryName, BinaryNotFoundError, SUPPORTED };
85
+ module.exports = { resolveBinary, platformKey, platformPackage, binaryName, BinaryNotFoundError, SUPPORTED, PACKAGES };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@zleap-ai/app-cli",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "zleapOS 云开发命令行工具 zleap-app(init / check / pack / publish / install / prepare / test / MCP),按平台自动选用预编译二进制",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/zleap-ai/zleap-app-kit.git",
8
+ "url": "git+https://github.com/RuoFeng2015/zleap-app-kit.git",
9
9
  "directory": "packages/app-cli"
10
10
  },
11
11
  "type": "commonjs",
@@ -22,12 +22,10 @@
22
22
  "node": ">=18"
23
23
  },
24
24
  "optionalDependencies": {
25
- "@zleap-ai/app-cli-darwin-arm64": "0.10.0",
26
- "@zleap-ai/app-cli-darwin-x64": "0.10.0",
27
- "@zleap-ai/app-cli-linux-x64": "0.10.0",
28
- "@zleap-ai/app-cli-linux-arm64": "0.10.0",
29
- "@zleap-ai/app-cli-win32-x64": "0.10.0",
30
- "@zleap-ai/app-cli-win32-arm64": "0.10.0"
25
+ "@zleap-ai/app-cli-darwin": "0.12.0",
26
+ "@zleap-ai/app-cli-linux-x64": "0.12.0",
27
+ "@zleap-ai/app-cli-linux-arm64": "0.12.0",
28
+ "@zleap-ai/app-cli-win32-x64": "0.12.0"
31
29
  },
32
30
  "keywords": [
33
31
  "zleap",