@nevaberry/opencodecommit 0.8.1 → 0.8.3

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/index.js CHANGED
@@ -4,24 +4,16 @@
4
4
 
5
5
  const path = require("path")
6
6
 
7
- const PLATFORMS = {
8
- "linux-x64": "@nevaberry/opencodecommit-linux-x64",
9
- "linux-arm64": "@nevaberry/opencodecommit-linux-arm64",
10
- "darwin-x64": "@nevaberry/opencodecommit-darwin-x64",
11
- "darwin-arm64": "@nevaberry/opencodecommit-darwin-arm64",
12
- "win32-x64": "@nevaberry/opencodecommit-win32-x64",
13
- }
7
+ const SUPPORTED = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64"]
14
8
 
15
9
  function getBinaryPath() {
16
10
  const platform = `${process.platform}-${process.arch}`
17
- const pkg = PLATFORMS[platform]
18
- if (!pkg) {
11
+ if (!SUPPORTED.includes(platform)) {
19
12
  throw new Error(`opencodecommit: unsupported platform ${platform}`)
20
13
  }
21
14
 
22
- const binaryDir = path.dirname(require.resolve(`${pkg}/package.json`))
23
15
  const ext = process.platform === "win32" ? ".exe" : ""
24
- return path.join(binaryDir, `opencodecommit${ext}`)
16
+ return path.join(__dirname, "platforms", platform, `opencodecommit${ext}`)
25
17
  }
26
18
 
27
- module.exports = { getBinaryPath, PLATFORMS }
19
+ module.exports = { getBinaryPath, SUPPORTED }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevaberry/opencodecommit",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "AI-powered git commit message generator that delegates to terminal AI agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -10,16 +10,15 @@
10
10
  "bin": {
11
11
  "opencodecommit": "bin/opencodecommit"
12
12
  },
13
+ "files": [
14
+ "bin",
15
+ "scripts",
16
+ "platforms",
17
+ "index.js"
18
+ ],
13
19
  "scripts": {
14
20
  "postinstall": "node scripts/postinstall.js"
15
21
  },
16
- "optionalDependencies": {
17
- "@nevaberry/opencodecommit-linux-x64": "0.8.1",
18
- "@nevaberry/opencodecommit-linux-arm64": "0.8.1",
19
- "@nevaberry/opencodecommit-darwin-x64": "0.8.1",
20
- "@nevaberry/opencodecommit-darwin-arm64": "0.8.1",
21
- "@nevaberry/opencodecommit-win32-x64": "0.8.1"
22
- },
23
22
  "keywords": [
24
23
  "git",
25
24
  "commit",
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -4,29 +4,26 @@
4
4
  const fs = require("fs")
5
5
  const path = require("path")
6
6
 
7
- const PLATFORMS = {
8
- "linux-x64": "@nevaberry/opencodecommit-linux-x64",
9
- "linux-arm64": "@nevaberry/opencodecommit-linux-arm64",
10
- "darwin-x64": "@nevaberry/opencodecommit-darwin-x64",
11
- "darwin-arm64": "@nevaberry/opencodecommit-darwin-arm64",
12
- "win32-x64": "@nevaberry/opencodecommit-win32-x64",
13
- }
7
+ const SUPPORTED = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64"]
14
8
 
15
9
  const platform = `${process.platform}-${process.arch}`
16
- const pkg = PLATFORMS[platform]
17
10
 
18
- if (!pkg) {
11
+ if (!SUPPORTED.includes(platform)) {
19
12
  console.error(`opencodecommit: unsupported platform ${platform}`)
20
- console.error(`Supported: ${Object.keys(PLATFORMS).join(", ")}`)
13
+ console.error(`Supported: ${SUPPORTED.join(", ")}`)
21
14
  process.exit(0) // Don't fail install, just warn
22
15
  }
23
16
 
24
17
  try {
25
- const binaryDir = path.dirname(require.resolve(`${pkg}/package.json`))
26
18
  const ext = process.platform === "win32" ? ".exe" : ""
27
- const binaryPath = path.join(binaryDir, `opencodecommit${ext}`)
19
+ const binaryPath = path.join(__dirname, "..", "platforms", platform, `opencodecommit${ext}`)
28
20
  const binTarget = path.join(__dirname, "..", "bin", `opencodecommit${ext}`)
29
21
 
22
+ if (!fs.existsSync(binaryPath)) {
23
+ console.error(`opencodecommit: binary not found at ${binaryPath}`)
24
+ process.exit(0)
25
+ }
26
+
30
27
  // Remove existing symlink/file
31
28
  try { fs.unlinkSync(binTarget) } catch { /* ok */ }
32
29