stoneage-cli 0.0.0-stage → 0.1.7

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,3 +1,8 @@
1
- # Temporary Holding Version
1
+ # stoneage-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 石器时代 2.5 命令行(TUI)客户端。
4
+
5
+ npm i -g stoneage-cli # 安装后执行 stoneage
6
+ npx stoneage-cli # 免安装试玩
7
+
8
+ 支持 macOS(Intel / Apple 芯片)、Linux x64(glibc)、Windows x64。
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ // 石器时代命令行客户端的启动器(STAGE-98)。主包只负责找到当前平台的子包,把子包里的二进制当子进程跑:
3
+ // 参数、终端和退出码原样转交,所以 TUI 照常工作。子包由 build.mjs 生成,不要手改这里的包名规则。
4
+ 'use strict';
5
+
6
+ const { spawnSync } = require('node:child_process');
7
+
8
+ const exe = process.platform === 'win32' ? 'stoneage.exe' : 'stoneage';
9
+ // 包名里 Windows 写 windows(见 build.mjs 的 slug)。
10
+ const platform = process.platform === 'win32' ? 'windows' : process.platform;
11
+ const pkg = `stoneage-cli-${platform}-${process.arch}`;
12
+
13
+ let bin;
14
+ try {
15
+ bin = require.resolve(`${pkg}/bin/${exe}`);
16
+ } catch {
17
+ console.error(`石器时代客户端没有 ${process.platform}-${process.arch} 的预编译包(${pkg})。`);
18
+ console.error('如果安装时带了 --omit=optional 或 --no-optional,去掉它重装;否则请用 cargo install 从源码构建。');
19
+ process.exit(1);
20
+ }
21
+
22
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
23
+ if (result.error) {
24
+ console.error(result.error.message);
25
+ process.exit(1);
26
+ }
27
+ if (result.signal) process.kill(process.pid, result.signal);
28
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "stoneage-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.7",
4
+ "description": "石器时代 2.5 命令行(TUI)客户端",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/athlan20/stoneage.git"
8
+ },
9
+ "bin": {
10
+ "stoneage": "bin/stoneage.js"
11
+ },
12
+ "files": [
13
+ "bin/",
14
+ "README.md"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "optionalDependencies": {
20
+ "stoneage-cli-darwin-arm64": "0.1.7",
21
+ "stoneage-cli-darwin-x64": "0.1.7",
22
+ "stoneage-cli-linux-x64": "0.1.7",
23
+ "stoneage-cli-windows-x64": "0.1.7"
24
+ }
25
+ }