layrith 0.1.2 → 0.1.3

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/layrith.cjs +26 -0
  2. package/package.json +3 -2
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require("node:child_process");
3
+ const path = require("node:path");
4
+ const os = require("node:os");
5
+
6
+ const bunCmd = process.env.BUN_BINARY || "bun";
7
+ const cliPath = path.resolve(__dirname, "..", "layrith.js");
8
+ const env = {
9
+ ...process.env,
10
+ CLAUDE_CONFIG_DIR: process.env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), ".layrith"),
11
+ };
12
+
13
+ const result = spawnSync(bunCmd, [cliPath, ...process.argv.slice(2)], {
14
+ stdio: "inherit",
15
+ env,
16
+ });
17
+
18
+ if (result.error) {
19
+ const reason = result.error.code === "ENOENT"
20
+ ? `Bun is required to run layrith. Install Bun from https://bun.sh and retry.`
21
+ : result.error.message;
22
+ console.error(`Failed to launch layrith via Bun: ${reason}`);
23
+ process.exit(1);
24
+ }
25
+
26
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "layrith",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "module": "layrith.js",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "bin": {
8
- "layrith": "layrith.js"
8
+ "layrith": "bin/layrith.cjs"
9
9
  },
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "files": [
12
12
  "layrith.js",
13
+ "bin/layrith.cjs",
13
14
  "README.md",
14
15
  "LICENSE"
15
16
  ],