@happy-creative/iroder 1.0.0 → 1.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.
@@ -1,7 +1,44 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "Read(//Users/neo/Infra/opencode/**)"
4
+ "Read(//Users/neo/Infra/opencode/**)",
5
+ "Bash(rm *)",
6
+ "Bash(cat)",
7
+ "Bash(\"name\": *)",
8
+ "Bash(\"version\": *)",
9
+ "Bash(\"license\": *)",
10
+ "Bash(\"bin\": *)",
11
+ "Bash(\"iroder\": *)",
12
+ "Bash(},)",
13
+ "Bash(\"scripts\": *)",
14
+ "Bash(\"postinstall\": *)",
15
+ "Bash(\"optionaldependencies\": *)",
16
+ "Bash(\"@happy-creative/iroder-darwin-arm64\": *)",
17
+ "Bash(\"@happy-creative/iroder-darwin-x64\": *)",
18
+ "Bash(\"@happy-creative/iroder-linux-arm64\": *)",
19
+ "Bash(\"@happy-creative/iroder-linux-x64\": *)",
20
+ "Bash(\"@happy-creative/iroder-windows-arm64\": *)",
21
+ "Bash(\"@happy-creative/iroder-windows-x64\": *)",
22
+ "Bash(})",
23
+ "Bash(eof)",
24
+ "Bash(cp *)",
25
+ "Bash(true)",
26
+ "Bash(npm publish *)",
27
+ "Bash(npm install *)",
28
+ "Bash(do)",
29
+ "Bash(npm view *)",
30
+ "Bash(done)",
31
+ "Bash(iroder *)",
32
+ "Bash(sudo *)",
33
+ "Bash(xattr *)",
34
+ "Bash(/users/neo/infra/opencode/packages/opencode/dist/@happy-creative/iroder-darwin-arm64/bin/iroder *)",
35
+ "Bash(codesign *)",
36
+ "Bash(file *)",
37
+ "Bash(otool *)",
38
+ "Bash(log *)",
39
+ "Bash(dmesg)",
40
+ "Bash(csrutil *)",
41
+ "Bash(plist *)"
5
42
  ]
6
43
  },
7
44
  "$version": 3
package/bin/iroder CHANGED
@@ -53,7 +53,7 @@ let arch = archMap[os.arch()]
53
53
  if (!arch) {
54
54
  arch = os.arch()
55
55
  }
56
- const base = "iroder-" + platform + "-" + arch
56
+ const base = "@happy-creative/iroder-" + platform + "-" + arch
57
57
  const binary = platform === "windows" ? "iroder.exe" : "iroder"
58
58
 
59
59
  function supportsAvx2() {
package/bunfig.toml ADDED
@@ -0,0 +1,7 @@
1
+ preload = ["@opentui/solid/preload"]
2
+
3
+ [test]
4
+ preload = ["@opentui/solid/preload", "./test/preload.ts"]
5
+ # timeout is not actually parsed from bunfig.toml (see src/bunfig.zig in oven-sh/bun)
6
+ # using --timeout in package.json scripts instead
7
+ # https://github.com/oven-sh/bun/issues/7789
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "name": "@happy-creative/iroder",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,6 +33,9 @@
33
33
  "bin": {
34
34
  "iroder": "./bin/iroder"
35
35
  },
36
+ "optionalDependencies": {
37
+ "@happy-creative/iroder-darwin-arm64": "1.0.0"
38
+ },
36
39
  "randomField": "this-is-a-random-value-12345",
37
40
  "exports": {
38
41
  "./*": "./src/*.ts"
@@ -49,7 +49,7 @@ function detectPlatformAndArch() {
49
49
 
50
50
  function findBinary() {
51
51
  const { platform, arch } = detectPlatformAndArch()
52
- const packageName = `iroder-${platform}-${arch}`
52
+ const packageName = `@happy-creative/iroder-${platform}-${arch}`
53
53
  const binaryName = platform === "windows" ? "iroder.exe" : "iroder"
54
54
 
55
55
  try {
@@ -0,0 +1,117 @@
1
+ #!/bin/bash
2
+ # 发布编译后的二进制包到 npm
3
+ # 使用 optionalDependencies 自动安装正确的平台包
4
+
5
+ set -e
6
+
7
+ ROOT_DIR="/Users/neo/Infra/opencode/packages/opencode"
8
+ VERSION="1.0.0"
9
+ CHANNEL="latest"
10
+ NPM_REGISTRY="https://registry.npmjs.org"
11
+
12
+ echo "=== 发布 iroder 二进制包 ==="
13
+ echo "Version: $VERSION"
14
+ echo "Channel: $CHANNEL"
15
+ echo ""
16
+
17
+ # 检查 npm 登录状态
18
+ if ! npm whoami --registry="$NPM_REGISTRY" 2>/dev/null; then
19
+ echo "请先登录 npm:"
20
+ npm login --registry="$NPM_REGISTRY"
21
+ fi
22
+
23
+ cd "$ROOT_DIR"
24
+
25
+ # 检查是否有编译好的二进制
26
+ if [ ! -d "dist/@happy-creative" ]; then
27
+ echo "错误:请先编译二进制"
28
+ echo "运行: bun run script/build.ts --single"
29
+ exit 1
30
+ fi
31
+
32
+ # 收集所有平台包
33
+ PLATFORM_PKGS=()
34
+ for pkg_json in dist/@happy-creative/*/package.json; do
35
+ pkg_name=$(basename "$(dirname "$pkg_json")")
36
+ PLATFORM_PKGS+=("$pkg_name")
37
+ done
38
+
39
+ echo "发现平台包: ${PLATFORM_PKGS[*]}"
40
+
41
+ # 发布各平台二进制包
42
+ for pkg_name in "${PLATFORM_PKGS[@]}"; do
43
+ echo ""
44
+ echo "--- 发布 @happy-creative/$pkg_name ---"
45
+
46
+ pkg_dir="dist/@happy-creative/$pkg_name"
47
+
48
+ # 更新版本号
49
+ pkg_content=$(cat "$pkg_dir/package.json")
50
+ echo "$pkg_content" | sed "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" > "$pkg_dir/package.json"
51
+
52
+ # 打包发布
53
+ chmod -R 755 "$pkg_dir"
54
+ cd "$pkg_dir"
55
+ rm -f *.tgz
56
+ bun pm pack
57
+ npm publish *.tgz --access public --tag "$CHANNEL" --registry "$NPM_REGISTRY"
58
+ rm -f *.tgz
59
+ cd "$ROOT_DIR"
60
+
61
+ echo "✅ @happy-creative/$pkg_name 发布成功"
62
+ done
63
+
64
+ # 创建并发布主包(使用 optionalDependencies)
65
+ echo ""
66
+ echo "--- 发布 @happy-creative/iroder-ai ---"
67
+
68
+ MAIN_PKG_DIR="dist/@happy-creative/iroder-ai"
69
+ mkdir -p "$MAIN_PKG_DIR"
70
+
71
+ # 创建 package.json
72
+ cat > "$MAIN_PKG_DIR/package.json" << EOF
73
+ {
74
+ "name": "@happy-creative/iroder-ai",
75
+ "version": "$VERSION",
76
+ "license": "MIT",
77
+ "bin": {
78
+ "iroder": "./bin/iroder"
79
+ },
80
+ "scripts": {
81
+ "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
82
+ },
83
+ "optionalDependencies": {
84
+ EOF
85
+
86
+ # 添加各平台包作为 optionalDependencies
87
+ for pkg_name in "${PLATFORM_PKGS[@]}"; do
88
+ echo " \"@happy-creative/$pkg_name\": \"$VERSION\"," >> "$MAIN_PKG_DIR/package.json"
89
+ done
90
+
91
+ # 完成 package.json
92
+ cat >> "$MAIN_PKG_DIR/package.json" << EOF
93
+ }
94
+ }
95
+ EOF
96
+
97
+ # 复制必要文件
98
+ cp -r bin "$MAIN_PKG_DIR/"
99
+ cp script/postinstall.mjs "$MAIN_PKG_DIR/"
100
+ cp ../../LICENSE "$MAIN_PKG_DIR/" 2>/dev/null || true
101
+
102
+ # 发布主包
103
+ chmod -R 755 "$MAIN_PKG_DIR"
104
+ cd "$MAIN_PKG_DIR"
105
+ rm -f *.tgz
106
+ bun pm pack
107
+ npm publish *.tgz --access public --tag "$CHANNEL" --registry "$NPM_REGISTRY"
108
+ rm -f *.tgz
109
+ cd "$ROOT_DIR"
110
+
111
+ echo "✅ @happy-creative/iroder-ai 发布成功"
112
+
113
+ echo ""
114
+ echo "=== 发布完成 ==="
115
+ echo ""
116
+ echo "安装测试:"
117
+ echo " npm install -g @happy-creative/iroder-ai --registry=$NPM_REGISTRY"
@@ -1,7 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Read(//Users/neo/Infra/opencode/**)"
5
- ]
6
- }
7
- }