gildforge 0.1.1 → 0.2.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.
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ // Picks the platform binary installed via optionalDependencies and execs it.
3
+ import { spawnSync } from 'node:child_process'
4
+ import { existsSync } from 'node:fs'
5
+ import { createRequire } from 'node:module'
6
+ import { dirname, join } from 'node:path'
7
+ const require = createRequire(import.meta.url)
8
+ const pkg = `@gildforge/server-${process.platform}-${process.arch}`
9
+ let binPath
10
+ try { binPath = join(dirname(require.resolve(pkg + '/package.json')), 'bin', 'gild-server') }
11
+ catch { console.error(`gild-server: no build for ${process.platform}-${process.arch} (tried ${pkg})`); process.exit(1) }
12
+ if (!existsSync(binPath)) { console.error(`gild-server: ${pkg} is installed but has no binary yet — it ships with the next server release.`); process.exit(1) }
13
+ const { status } = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' })
14
+ process.exit(status ?? 1)
package/bin/gild.js CHANGED
@@ -1,12 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  // Picks the platform binary installed via optionalDependencies and execs it.
3
3
  import { spawnSync } from 'node:child_process'
4
+ import { existsSync } from 'node:fs'
4
5
  import { createRequire } from 'node:module'
5
6
  import { dirname, join } from 'node:path'
6
7
  const require = createRequire(import.meta.url)
7
8
  const pkg = `@gildforge/cli-${process.platform}-${process.arch}`
8
- let bin
9
- try { bin = join(dirname(require.resolve(pkg + '/package.json')), 'bin', 'gild') }
10
- catch { console.error(`gild: no binary for ${process.platform}-${process.arch} (tried ${pkg})`); process.exit(1) }
11
- const { status } = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' })
9
+ let binPath
10
+ try { binPath = join(dirname(require.resolve(pkg + '/package.json')), 'bin', 'gild') }
11
+ catch { console.error(`gild: no build for ${process.platform}-${process.arch} (tried ${pkg})`); process.exit(1) }
12
+ if (!existsSync(binPath)) { console.error(`gild: ${pkg} is installed but has no binary yet — it ships with the next server release.`); process.exit(1) }
13
+ const { status } = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' })
12
14
  process.exit(status ?? 1)
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "gildforge",
3
- "version": "0.1.1",
4
- "description": "gildforge — key-first identity for the gild forge",
3
+ "version": "0.2.0",
4
+ "description": "gildforge — key-first identity for the gild forge (installs gild and gild-server)",
5
5
  "type": "module",
6
6
  "bin": {
7
- "gild": "bin/gild.js"
7
+ "gild": "bin/gild.js",
8
+ "gild-server": "bin/gild-server.js"
8
9
  },
9
10
  "files": [
10
11
  "bin"
@@ -14,8 +15,11 @@
14
15
  "access": "public"
15
16
  },
16
17
  "optionalDependencies": {
17
- "@gildforge/cli-darwin-arm64": "0.1.1",
18
- "@gildforge/cli-darwin-x64": "0.1.1",
19
- "@gildforge/cli-linux-x64": "0.1.1"
18
+ "@gildforge/cli-darwin-arm64": "0.2.0",
19
+ "@gildforge/cli-darwin-x64": "0.2.0",
20
+ "@gildforge/cli-linux-x64": "0.2.0",
21
+ "@gildforge/server-darwin-arm64": "*",
22
+ "@gildforge/server-darwin-x64": "*",
23
+ "@gildforge/server-linux-x64": "*"
20
24
  }
21
25
  }