@ingit/cli 0.1.0-bootstrap.0 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +26 -0
  2. package/bin/ingit.cjs +19 -4
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -12,6 +12,32 @@ No runtime dependencies — the binary is self-contained (the Bun runtime is
12
12
  embedded). Prebuilt binaries are provided for linux (x64/arm64) and macOS
13
13
  (x64/arm64).
14
14
 
15
+ ## Local testing from this repo
16
+
17
+ Build the host binary and register the CLI package with Bun:
18
+
19
+ ```sh
20
+ bun run --filter '@ingit/cli' release linux-x64
21
+ cd apps/cli
22
+ bun link
23
+ ```
24
+
25
+ After that, `ingit` should resolve from `~/.bun/bin`:
26
+
27
+ ```sh
28
+ command -v ingit
29
+ ingit --version
30
+ ingit --help
31
+ ```
32
+
33
+ When CLI code changes, rebuild the binary from the repo root:
34
+
35
+ ```sh
36
+ bun run --filter '@ingit/cli' release linux-x64
37
+ ```
38
+
39
+ You only need to run `bun link` again if the package/link setup changes.
40
+
15
41
  ## Usage
16
42
 
17
43
  ```sh
package/bin/ingit.cjs CHANGED
@@ -6,19 +6,34 @@
6
6
  // resolves the binary that matches the current OS/arch and execs it.
7
7
 
8
8
  const { spawnSync } = require('node:child_process')
9
+ const { existsSync } = require('node:fs')
10
+ const { join } = require('node:path')
9
11
 
10
12
  const platform = process.platform
11
13
  const arch = process.arch
12
14
  const pkgName = `@ingit/cli-${platform}-${arch}`
15
+ const platformId = `${platform}-${arch}`
13
16
 
14
17
  let binPath
15
18
  try {
16
19
  binPath = require.resolve(`${pkgName}/ingit`)
17
20
  } catch {
18
- console.error(`ingit: no prebuilt binary available for ${platform}-${arch}.`)
19
- console.error(`Expected the optional dependency "${pkgName}" to be installed.`)
20
- console.error('Supported: linux-x64, linux-arm64, darwin-x64, darwin-arm64.')
21
- process.exit(1)
21
+ const localBinPath = join(
22
+ __dirname,
23
+ '..',
24
+ 'release',
25
+ `cli-${platformId}`,
26
+ platform === 'win32' ? 'ingit.exe' : 'ingit',
27
+ )
28
+ if (existsSync(localBinPath)) {
29
+ binPath = localBinPath
30
+ } else {
31
+ console.error(`ingit: no prebuilt binary available for ${platform}-${arch}.`)
32
+ console.error(`Expected the optional dependency "${pkgName}" to be installed.`)
33
+ console.error(`For local testing, run "bun run --filter '@ingit/cli' release ${platformId}" from the repo root.`)
34
+ console.error('Supported: linux-x64, linux-arm64, darwin-x64, darwin-arm64.')
35
+ process.exit(1)
36
+ }
22
37
  }
23
38
 
24
39
  const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingit/cli",
3
- "version": "0.1.0-bootstrap.0",
3
+ "version": "0.1.1",
4
4
  "description": "Local git history & graph viewer in your browser",
5
5
  "bin": {
6
6
  "ingit": "bin/ingit.cjs"
@@ -10,10 +10,10 @@
10
10
  "README.md"
11
11
  ],
12
12
  "optionalDependencies": {
13
- "@ingit/cli-linux-x64": "0.1.0-bootstrap.0",
14
- "@ingit/cli-linux-arm64": "0.1.0-bootstrap.0",
15
- "@ingit/cli-darwin-x64": "0.1.0-bootstrap.0",
16
- "@ingit/cli-darwin-arm64": "0.1.0-bootstrap.0"
13
+ "@ingit/cli-linux-x64": "0.1.1",
14
+ "@ingit/cli-linux-arm64": "0.1.1",
15
+ "@ingit/cli-darwin-x64": "0.1.1",
16
+ "@ingit/cli-darwin-arm64": "0.1.1"
17
17
  },
18
18
  "license": "MIT",
19
19
  "engines": {
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
24
- "url": "git+https://github.com/capaj/ingit-vibe.git"
24
+ "url": "git+https://github.com/capaj/ingit.git"
25
25
  },
26
26
  "publishConfig": {
27
27
  "access": "public",