@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 +1 -1
- package/bin/dsui.mjs +12 -4
- package/dist/server.mjs +163 -162
- package/package.json +5 -2
package/README.md
CHANGED
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
|
|
9
|
-
|
|
10
|
-
|
|
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.
|
|
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
|
};
|