ghostdock 0.0.20 → 0.1.0

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/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # ghostdock
2
+
3
+ The Ghostdock CLI: VMs, the private network and Docker from the command line.
4
+
5
+ ```bash
6
+ npm install -g ghostdock
7
+ ```
8
+
9
+ This package runs the binary of your platform, from `@ghostdock/cli-<os>-<arch>`. Homebrew (`brew install brainchimps/tap/ghostdock`) and the install script (`curl -fsSL https://ghostdock.brainchimps.com/install.sh | sh`) install the same binary without Node.
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ // The `ghostdock` npm package runs the Go binary of this machine's platform package
3
+ // (@ghostdock/cli-<os>-<arch>), which npm installed as an optional dependency (ADR 0036).
4
+
5
+ const { spawnSync } = require('node:child_process');
6
+ const { dirname, join } = require('node:path');
7
+
8
+ const name = `@ghostdock/cli-${process.platform}-${process.arch}`;
9
+ let binary;
10
+ try {
11
+ const root = dirname(require.resolve(`${name}/package.json`));
12
+ binary = join(root, 'bin', process.platform === 'win32' ? 'ghostdock.exe' : 'ghostdock');
13
+ } catch {
14
+ console.error(
15
+ ` ✗ ${name} is not installed. ghostdock runs on macOS and Linux (arm64, x64) and Windows (x64); reinstall with: npm install -g ghostdock`,
16
+ );
17
+ process.exit(1);
18
+ }
19
+
20
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
21
+ if (result.error) {
22
+ console.error(` ✗ ${result.error.message}`);
23
+ process.exit(1);
24
+ }
25
+ if (result.signal) process.kill(process.pid, result.signal);
26
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,34 +1,27 @@
1
1
  {
2
2
  "name": "ghostdock",
3
- "description": "Ghostdock CLI — device login and agent tool invocation from the command line",
4
- "version": "0.0.20",
5
- "type": "module",
6
- "bin": {
7
- "ghostdock": "dist/index.js",
8
- "gdock": "dist/index.js"
9
- },
10
- "files": [
11
- "dist"
12
- ],
3
+ "version": "0.1.0",
4
+ "homepage": "https://github.com/brainchimps/ghostdock-cli",
13
5
  "repository": {
14
6
  "type": "git",
15
7
  "url": "git+https://github.com/brainchimps/ghostdock.git"
16
8
  },
17
- "publishConfig": {
18
- "access": "public"
9
+ "description": "Ghostdock CLI: VMs, the private network and Docker from the command line",
10
+ "bin": {
11
+ "ghostdock": "bin/ghostdock.js",
12
+ "gdock": "bin/ghostdock.js"
19
13
  },
20
- "scripts": {
21
- "sync-catalog": "bun run scripts/sync-catalog.ts",
22
- "sync-reference": "bun run scripts/sync-reference.ts",
23
- "needs-publish": "bun run scripts/needs-publish.ts",
24
- "prebuild": "bun run sync-catalog && bun run sync-reference",
25
- "build": "bun run scripts/build.ts",
26
- "dev": "bun run src/index.ts",
27
- "pretest": "bun run sync-catalog",
28
- "test": "bun test src"
14
+ "files": [
15
+ "bin"
16
+ ],
17
+ "engines": {
18
+ "node": ">=18"
29
19
  },
30
- "dependencies": {
31
- "citty": "^0.2.2",
32
- "fflate": "^0.8.3"
20
+ "optionalDependencies": {
21
+ "@ghostdock/cli-darwin-arm64": "0.1.0",
22
+ "@ghostdock/cli-darwin-x64": "0.1.0",
23
+ "@ghostdock/cli-linux-arm64": "0.1.0",
24
+ "@ghostdock/cli-linux-x64": "0.1.0",
25
+ "@ghostdock/cli-win32-x64": "0.1.0"
33
26
  }
34
27
  }