@northgraindata/dsui 0.1.0-alpha.7 → 0.1.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/README.md CHANGED
@@ -6,4 +6,4 @@ Run DSUI locally with your host tools, including dbt:
6
6
  npx @northgraindata/dsui
7
7
  ```
8
8
 
9
- The runtime requires Bun 1.3.12 or newer. Docker remains available for isolated deployments.
9
+ Docker remains available for isolated deployments.
package/bin/dsui.mjs CHANGED
@@ -1,19 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import { existsSync } from "node:fs";
3
+ import { createRequire } from "node:module";
3
4
  import { dirname, join } from "node:path";
4
5
  import { spawn, spawnSync } from "node:child_process";
5
6
  import { fileURLToPath } from "node:url";
6
7
 
7
8
  const packageRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
8
- const bun = process.env.DSUI_BUN ?? (process.platform === "win32" ? "bun.exe" : "bun");
9
- if (spawnSync(bun, ["--version"], { stdio: "ignore" }).error) {
10
- console.error("DSUI requires Bun 1.3.12 or newer. Install it from https://bun.sh");
9
+ const require = createRequire(import.meta.url);
10
+ let bundledBun = "";
11
+ try {
12
+ bundledBun = join(dirname(require.resolve("bun/package.json")), "bin", "bun.exe");
13
+ } catch {
14
+ // Let the error below explain that the npm dependency is missing.
15
+ }
16
+ const bun = process.env.DSUI_BUN ?? bundledBun;
17
+ if (!bun || spawnSync(bun, ["--version"], { stdio: "ignore" }).error) {
18
+ console.error("DSUI could not find its bundled runtime. Reinstall the package with npm scripts enabled.");
11
19
  process.exit(1);
12
20
  }
13
21
 
14
22
  const env = {
15
23
  ...process.env,
16
- DSUI_VERSION: "0.1.0-alpha.7",
24
+ DSUI_VERSION: "0.1.1",
17
25
  DSUI_WEB_ROOT: join(packageRoot, "web"),
18
26
  DSUI_RUNTIME_ADAPTERS: join(packageRoot, "dist", "runtime", "adapters"),
19
27
  };