@neevcode/neev 0.0.0-dev-202607101251 → 0.0.0-dev-202607141247

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.
@@ -17,6 +17,8 @@ function run(target) {
17
17
  process.exit(code)
18
18
  }
19
19
 
20
+ // OPENCODE_BIN_PATH is kept as a deprecated fallback so pre-rebrand wrappers,
21
+ // CI setups, and docs that export it keep working. NEEV_BIN_PATH wins.
20
22
  const envPath = process.env.NEEV_BIN_PATH || process.env.OPENCODE_BIN_PATH
21
23
  if (envPath) {
22
24
  run(envPath)
@@ -25,10 +27,14 @@ if (envPath) {
25
27
  const scriptPath = fs.realpathSync(__filename)
26
28
  const scriptDir = path.dirname(scriptPath)
27
29
 
28
- //
29
- const cached = path.join(scriptDir, ".opencode")
30
- if (fs.existsSync(cached)) {
31
- run(cached)
30
+ // postinstall.mjs hardlinks the platform binary here so startup skips package
31
+ // resolution. The legacy ".opencode" name is still checked so an in-place
32
+ // upgrade whose postinstall failed can reuse the previous install's cache.
33
+ for (const cacheName of [".neevcode", ".opencode"]) {
34
+ const cached = path.join(scriptDir, cacheName)
35
+ if (fs.existsSync(cached)) {
36
+ run(cached)
37
+ }
32
38
  }
33
39
 
34
40
  const platformMap = {
@@ -51,6 +57,10 @@ if (!arch) {
51
57
  arch = os.arch()
52
58
  }
53
59
  const base = "@neevcode/neev-" + platform + "-" + arch
60
+ // The platform packages ship their executable as bin/opencode(.exe) — that name
61
+ // comes from script/build.ts's compile outfile, not from this wrapper. It must
62
+ // stay "opencode" here until the build pipeline renames the shipped artifact,
63
+ // or every published @neevcode/neev-* package stops resolving.
54
64
  const binary = platform === "windows" ? "opencode.exe" : "opencode"
55
65
 
56
66
  function supportsAvx2() {
@@ -169,7 +179,7 @@ function findBinary(startDir) {
169
179
  const resolved = findBinary(scriptDir)
170
180
  if (!resolved) {
171
181
  console.error(
172
- "It seems that your package manager failed to install the right version of the opencode CLI for your platform. You can try manually installing " +
182
+ "It seems that your package manager failed to install the right version of the NeevCode CLI (neev) for your platform. You can try manually installing the " +
173
183
  names.map((n) => `\"${n}\"`).join(" or ") +
174
184
  " package",
175
185
  )
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@neevcode/neev",
3
3
  "bin": {
4
- "neev": "./bin/opencode"
4
+ "neev": "./bin/neevcode"
5
5
  },
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "0.0.0-dev-202607101251",
9
+ "version": "0.0.0-dev-202607141247",
10
10
  "license": "MIT",
11
11
  "optionalDependencies": {
12
- "@neevcode/neev-linux-x64": "0.0.0-dev-202607101251",
13
- "@neevcode/neev-linux-x64-baseline-musl": "0.0.0-dev-202607101251",
14
- "@neevcode/neev-linux-arm64": "0.0.0-dev-202607101251",
15
- "@neevcode/neev-linux-x64-musl": "0.0.0-dev-202607101251",
16
- "@neevcode/neev-linux-x64-baseline": "0.0.0-dev-202607101251",
17
- "@neevcode/neev-windows-x64-baseline": "0.0.0-dev-202607101251",
18
- "@neevcode/neev-darwin-arm64": "0.0.0-dev-202607101251",
19
- "@neevcode/neev-windows-x64": "0.0.0-dev-202607101251",
20
- "@neevcode/neev-windows-arm64": "0.0.0-dev-202607101251",
21
- "@neevcode/neev-linux-arm64-musl": "0.0.0-dev-202607101251",
22
- "@neevcode/neev-darwin-x64-baseline": "0.0.0-dev-202607101251",
23
- "@neevcode/neev-darwin-x64": "0.0.0-dev-202607101251"
12
+ "@neevcode/neev-linux-x64": "0.0.0-dev-202607141247",
13
+ "@neevcode/neev-linux-x64-baseline-musl": "0.0.0-dev-202607141247",
14
+ "@neevcode/neev-linux-arm64": "0.0.0-dev-202607141247",
15
+ "@neevcode/neev-linux-x64-musl": "0.0.0-dev-202607141247",
16
+ "@neevcode/neev-linux-x64-baseline": "0.0.0-dev-202607141247",
17
+ "@neevcode/neev-windows-x64-baseline": "0.0.0-dev-202607141247",
18
+ "@neevcode/neev-darwin-arm64": "0.0.0-dev-202607141247",
19
+ "@neevcode/neev-windows-x64": "0.0.0-dev-202607141247",
20
+ "@neevcode/neev-windows-arm64": "0.0.0-dev-202607141247",
21
+ "@neevcode/neev-linux-arm64-musl": "0.0.0-dev-202607141247",
22
+ "@neevcode/neev-darwin-x64-baseline": "0.0.0-dev-202607141247",
23
+ "@neevcode/neev-darwin-x64": "0.0.0-dev-202607141247"
24
24
  }
25
25
  }
package/postinstall.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // Runs inside the published @neevcode/neev meta package. Hardlinks the correct
4
- // platform binary to bin/.opencode so the wrapper skips resolution on startup.
4
+ // platform binary to bin/.neevcode so the wrapper skips resolution on startup.
5
5
  // Must stay zero-dependency plain node, and must NEVER fail the install: the
6
- // wrapper (bin/opencode) does its own variant resolution at runtime, so any
6
+ // wrapper (bin/neevcode) does its own variant resolution at runtime, so any
7
7
  // failure here only costs startup latency, not functionality.
8
8
  //
9
- // Variant priority (musl/AVX2 detection) mirrors bin/opencode — keep in sync.
9
+ // Variant priority (musl/AVX2 detection) mirrors bin/neevcode — keep in sync.
10
10
 
11
11
  import fs from "fs"
12
12
  import path from "path"
@@ -35,6 +35,8 @@ const archMap = {
35
35
  const platform = platformMap[os.platform()] || os.platform()
36
36
  const arch = archMap[os.arch()] || os.arch()
37
37
  const base = `${packageBase}-${platform}-${arch}`
38
+ // Platform packages ship their executable as bin/opencode(.exe) (script/build.ts
39
+ // outfile) — keep in sync with the `binary` constant in bin/neevcode.
38
40
  const binaryName = platform === "windows" ? "opencode.exe" : "opencode"
39
41
 
40
42
  function supportsAvx2() {
@@ -130,7 +132,11 @@ function main() {
130
132
  }
131
133
 
132
134
  const binaryPath = findBinary()
133
- const target = path.join(__dirname, "bin", ".opencode")
135
+ const target = path.join(__dirname, "bin", ".neevcode")
136
+ // Drop a stale pre-rebrand cache too so upgrades don't leave a second copy
137
+ // of the binary behind (the wrapper would prefer .neevcode anyway).
138
+ const legacy = path.join(__dirname, "bin", ".opencode")
139
+ if (fs.existsSync(legacy)) fs.unlinkSync(legacy)
134
140
  if (fs.existsSync(target)) fs.unlinkSync(target)
135
141
  try {
136
142
  fs.linkSync(binaryPath, target)