mira-cli-ts 0.22.4 → 0.24.0
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/cli.js +35 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
+
var __esm = (fn, res, err) => () => {
|
|
4
|
+
if (fn)
|
|
5
|
+
try {
|
|
6
|
+
res = fn(fn = 0);
|
|
7
|
+
} catch (e) {
|
|
8
|
+
err = [e];
|
|
9
|
+
}
|
|
10
|
+
if (err)
|
|
11
|
+
throw err[0];
|
|
12
|
+
return res;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// ../shared/src/utils/paths.ts
|
|
16
|
+
function resolveBunBinary() {
|
|
17
|
+
try {
|
|
18
|
+
const exec = process.execPath ?? "";
|
|
19
|
+
if (exec.toLowerCase().includes("bun"))
|
|
20
|
+
return exec;
|
|
21
|
+
} catch {}
|
|
22
|
+
try {
|
|
23
|
+
const which = Bun?.which;
|
|
24
|
+
if (which) {
|
|
25
|
+
const found = which("bun");
|
|
26
|
+
if (found)
|
|
27
|
+
return found;
|
|
28
|
+
}
|
|
29
|
+
} catch {}
|
|
30
|
+
if (typeof process !== "undefined" && process.platform === "win32") {
|
|
31
|
+
return "bun.exe";
|
|
32
|
+
}
|
|
33
|
+
return "bun";
|
|
34
|
+
}
|
|
35
|
+
var init_paths = () => {};
|
|
3
36
|
|
|
4
37
|
// src/cli.ts
|
|
5
38
|
var VERSION = "0.1.0";
|
|
@@ -106,7 +139,8 @@ async function cmdServe(opts) {
|
|
|
106
139
|
process.env.PORT = port;
|
|
107
140
|
process.env.HOST = host;
|
|
108
141
|
const serverDir = new URL("../../server", import.meta.url).pathname;
|
|
109
|
-
|
|
142
|
+
await Promise.resolve().then(() => init_paths());
|
|
143
|
+
const proc = Bun.spawn([resolveBunBinary(), "run", "src/index.ts"], {
|
|
110
144
|
cwd: serverDir,
|
|
111
145
|
env: { ...process.env, PORT: port, HOST: host },
|
|
112
146
|
stdout: "inherit",
|