gorsee 0.2.10 → 0.2.11

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 (2) hide show
  1. package/bin/gorsee.js +38 -0
  2. package/package.json +3 -2
package/bin/gorsee.js ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync } from "node:fs"
4
+ import { dirname, join, resolve } from "node:path"
5
+ import { fileURLToPath, pathToFileURL } from "node:url"
6
+ import { spawnSync } from "node:child_process"
7
+
8
+ const binDir = dirname(fileURLToPath(import.meta.url))
9
+ const packageRoot = resolve(binDir, "..")
10
+ const publishedCliEntry = join(packageRoot, "dist-pkg", "cli", "index.js")
11
+ const sourceCliEntry = join(packageRoot, "src", "cli", "index.ts")
12
+
13
+ function runWithBun(entry) {
14
+ const result = spawnSync("bun", ["run", entry, ...process.argv.slice(2)], {
15
+ cwd: process.cwd(),
16
+ stdio: "inherit",
17
+ })
18
+ process.exit(result.status ?? 1)
19
+ }
20
+
21
+ function hasBun() {
22
+ const result = spawnSync("bun", ["--version"], {
23
+ cwd: packageRoot,
24
+ stdio: "ignore",
25
+ })
26
+ return result.status === 0
27
+ }
28
+
29
+ if (existsSync(publishedCliEntry) && hasBun()) {
30
+ runWithBun(publishedCliEntry)
31
+ } else if (existsSync(sourceCliEntry) && hasBun()) {
32
+ runWithBun(sourceCliEntry)
33
+ } else if (existsSync(publishedCliEntry)) {
34
+ await import(pathToFileURL(publishedCliEntry).href)
35
+ } else {
36
+ console.error("gorsee launcher could not find a runnable CLI entrypoint.")
37
+ process.exit(1)
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gorsee",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "AI-first reactive full-stack TypeScript framework for deterministic human and agent collaboration",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.9",
@@ -21,7 +21,7 @@
21
21
  "web-framework"
22
22
  ],
23
23
  "bin": {
24
- "gorsee": "dist-pkg/bin/gorsee.js"
24
+ "gorsee": "bin/gorsee.js"
25
25
  },
26
26
  "exports": {
27
27
  ".": "./dist-pkg/index.js",
@@ -58,6 +58,7 @@
58
58
  "./deploy": "./dist-pkg/deploy/index.js"
59
59
  },
60
60
  "files": [
61
+ "bin/",
61
62
  "dist-pkg/",
62
63
  "README.md",
63
64
  "LICENSE"