@lute-lang/lute 0.15.0 → 0.15.1

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/dist/index.js CHANGED
@@ -5,7 +5,8 @@ import { spawnSync, execSync } from "node:child_process";
5
5
  import { existsSync, readdirSync, realpathSync } from "node:fs";
6
6
  import { resolve, join, basename } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
- var binaryName = process.platform === "win32" ? "lute.exe" : "lute";
8
+ var binaryBase = process.env.LUTE_LAUNCHER_BINARY === "lute-lsp" ? "lute-lsp" : "lute";
9
+ var binaryName = process.platform === "win32" ? `${binaryBase}.exe` : binaryBase;
9
10
  var currentDir = fileURLToPath(new URL(".", import.meta.url));
10
11
  var dirName = basename(currentDir);
11
12
  var isSubDir = dirName === "dist" || dirName === "src";
@@ -138,20 +139,22 @@ function tryRealpath(p) {
138
139
  }
139
140
  var selfPaths = new Set([
140
141
  tryRealpath(fileURLToPath(import.meta.url)),
141
- tryRealpath(join(cliDir, "bin.js"))
142
+ tryRealpath(join(cliDir, "bin.js")),
143
+ tryRealpath(join(cliDir, "lsp-bin.js"))
142
144
  ]);
143
145
  if (process.argv[1]) {
144
146
  selfPaths.add(tryRealpath(process.argv[1]));
145
147
  }
146
148
  var binary = searchPaths.find((p) => existsSync(p) && !selfPaths.has(tryRealpath(p)));
147
149
  if (!binary) {
148
- console.error(`lute: no binary found for ${process.platform}/${process.arch}`);
150
+ console.error(`${binaryBase}: no binary found for ${process.platform}/${process.arch}`);
149
151
  if (platformPkgName) {
150
152
  console.error(` expected optional package: ${platformPkgName}`);
151
153
  } else {
152
154
  console.error(" no @lute-lang/lute-core-<platform> package exists for this platform/arch yet");
153
155
  }
154
- console.error(" build from source: cargo build --release -p lute-cli");
156
+ const sourceCrate = binaryBase === "lute-lsp" ? "lute-lsp" : "lute-cli";
157
+ console.error(` build from source: cargo build --release -p ${sourceCrate}`);
155
158
  process.exit(1);
156
159
  }
157
160
  var result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
package/lsp-bin.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ // `lute-lsp` entry: same launcher (platform detection, binary resolution,
3
+ // argv/exit-code passthrough) as `bin.js`, aimed at the LSP binary the
4
+ // platform package ships alongside `lute`.
5
+ process.env.LUTE_LAUNCHER_BINARY = "lute-lsp";
6
+ await import("./dist/index.js");
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@lute-lang/lute",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "lute — checker/compiler/tracer for .lute branching game narratives. JS launcher: platform detection + native binary resolution.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "bin": {
9
- "lute": "./bin.js"
9
+ "lute": "./bin.js",
10
+ "lute-lsp": "./lsp-bin.js"
10
11
  },
11
12
  "files": [
12
13
  "bin.js",
14
+ "lsp-bin.js",
13
15
  "dist/**/*"
14
16
  ],
15
17
  "publishConfig": {
@@ -28,9 +30,9 @@
28
30
  },
29
31
  "dependencies": {},
30
32
  "optionalDependencies": {
31
- "@lute-lang/lute-core-darwin-arm64": "0.15.0",
32
- "@lute-lang/lute-core-linux-x64": "0.15.0",
33
- "@lute-lang/lute-core-win32-x64": "0.15.0"
33
+ "@lute-lang/lute-core-darwin-arm64": "0.15.1",
34
+ "@lute-lang/lute-core-linux-x64": "0.15.1",
35
+ "@lute-lang/lute-core-win32-x64": "0.15.1"
34
36
  },
35
37
  "devDependencies": {
36
38
  "@types/node": "^20.0.0",