@glassly/cli 2.0.0-dev.2 → 2.0.0-dev.4

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/glassly.js +20 -0
  2. package/package.json +6 -5
package/bin/glassly.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ // The CLI runs under Bun: the dev server, bundler plugins, and credential
3
+ // store use Bun APIs. This launcher lets `npx @glassly/cli` and plain `node`
4
+ // still work when Bun is installed, and explains what to do when it is not.
5
+ import {spawnSync} from "node:child_process";
6
+ import {fileURLToPath} from "node:url";
7
+
8
+ const entry = fileURLToPath(new URL("../src/index.ts", import.meta.url));
9
+
10
+ if (process.versions.bun) {
11
+ await import(entry);
12
+ } else {
13
+ const result = spawnSync("bun", [entry, ...process.argv.slice(2)], {stdio: "inherit"});
14
+ if (result.error && result.error.code === "ENOENT") {
15
+ console.error("glassly runs on Bun, which is not installed or not on PATH.");
16
+ console.error("Install it from https://bun.sh, then run: bunx @glassly/cli --help");
17
+ process.exit(1);
18
+ }
19
+ process.exit(result.status ?? 1);
20
+ }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@glassly/cli",
3
- "version": "2.0.0-dev.2",
3
+ "version": "2.0.0-dev.4",
4
4
  "description": "The glassly command: develop, pack, release, and publish Glassly miniapps. Bun-only.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "glassly": "./src/index.ts"
7
+ "glassly": "./bin/glassly.js"
8
8
  },
9
9
  "files": [
10
+ "bin",
10
11
  "src"
11
12
  ],
12
13
  "engines": {
@@ -21,7 +22,7 @@
21
22
  "typecheck": "tsc --noEmit"
22
23
  },
23
24
  "dependencies": {
24
- "@glassly/miniapp-cli": "0.1.0-dev.2",
25
+ "@glassly/miniapp-cli": "0.1.0-dev.4",
25
26
  "commander": "^14.0.2",
26
27
  "qrcode": "^1.5.4"
27
28
  },
@@ -38,9 +39,9 @@
38
39
  "repository": {
39
40
  "type": "git",
40
41
  "url": "git+https://github.com/tetramo-labs/glassly.git",
41
- "directory": "cloud-v2/packages/cli"
42
+ "directory": "sdk/cli"
42
43
  },
43
- "homepage": "https://github.com/tetramo-labs/glassly/tree/dev/cloud-v2/packages/cli#readme",
44
+ "homepage": "https://github.com/tetramo-labs/glassly/tree/dev/sdk/cli#readme",
44
45
  "bugs": {
45
46
  "url": "https://github.com/tetramo-labs/glassly/issues"
46
47
  }