@me0wo/opencode 0.0.0-stage → 2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84
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/bin/cli.mjs +22 -0
- package/package.json +28 -4
- package/README.md +0 -3
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module"
|
|
3
|
+
import { spawn } from "node:child_process"
|
|
4
|
+
import path from "node:path"
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url)
|
|
7
|
+
const target = `${process.platform === "win32" ? "windows" : process.platform}-${process.arch}`
|
|
8
|
+
let entry
|
|
9
|
+
try {
|
|
10
|
+
entry = path.join(path.dirname(require.resolve(`@me0wo/opencode-${target}/package.json`)), "opencode.mjs")
|
|
11
|
+
} catch {
|
|
12
|
+
console.error(`@me0wo/opencode: no bundle available for ${target}`)
|
|
13
|
+
process.exit(1)
|
|
14
|
+
}
|
|
15
|
+
// The runtime that installed the launcher also runs the bundle: bun's shim
|
|
16
|
+
// executes this file with bun, npm-family shims with node. Reuse the same
|
|
17
|
+
// executable instead of pinning a runtime in the command name.
|
|
18
|
+
const child = spawn(process.execPath, [entry, ...process.argv.slice(2)], { stdio: "inherit" })
|
|
19
|
+
child.on("exit", (code, signal) => {
|
|
20
|
+
if (signal) process.kill(process.pid, signal)
|
|
21
|
+
else process.exitCode = code ?? 1
|
|
22
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@me0wo/opencode",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84",
|
|
4
|
+
"description": "OpenCode fork JS bundle",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"opencode-patcher": "bin/cli.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/"
|
|
11
|
+
],
|
|
12
|
+
"optionalDependencies": {
|
|
13
|
+
"@me0wo/opencode-linux-x64": "2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84",
|
|
14
|
+
"@me0wo/opencode-linux-arm64": "2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84",
|
|
15
|
+
"@me0wo/opencode-darwin-arm64": "2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84",
|
|
16
|
+
"@me0wo/opencode-darwin-x64": "2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84",
|
|
17
|
+
"@me0wo/opencode-windows-x64": "2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84",
|
|
18
|
+
"@me0wo/opencode-windows-arm64": "2.2.7-fork.s5fde96ba178bfbd3da9e510607284d33d480ba84"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=26"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/Sn0wo2/opencode.git"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/README.md
DELETED