busa-cli 0.11.0 → 0.11.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.
- package/bin/busabase-cli.mjs +4 -7
- package/dist/{chunk-QJJMAA3K.js → chunk-CEH54HWM.js} +731 -595
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/bin/busabase-cli.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
|
-
import { dirname, resolve } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
3
|
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const builtCli = resolve(pkgRoot, "dist/cli.js");
|
|
4
|
+
const builtCli = new URL("../dist/cli.js", import.meta.url);
|
|
5
|
+
const programmaticEntry = new URL("../dist/index.js", import.meta.url);
|
|
9
6
|
const delegatedArgvJson = process.env.BUSABASE_CLI_DELEGATED_ARGV;
|
|
10
7
|
|
|
11
8
|
if (!existsSync(builtCli)) {
|
|
@@ -22,14 +19,14 @@ if (!existsSync(builtCli)) {
|
|
|
22
19
|
try {
|
|
23
20
|
if (delegatedArgvJson) {
|
|
24
21
|
delete process.env.BUSABASE_CLI_DELEGATED_ARGV;
|
|
25
|
-
const { runCli } = await import(
|
|
22
|
+
const { runCli } = await import(programmaticEntry.href);
|
|
26
23
|
const delegatedArgv = JSON.parse(delegatedArgvJson);
|
|
27
24
|
if (!Array.isArray(delegatedArgv) || delegatedArgv.some((arg) => typeof arg !== "string")) {
|
|
28
25
|
throw new Error("BUSABASE_CLI_DELEGATED_ARGV must be a JSON string array.");
|
|
29
26
|
}
|
|
30
27
|
process.exit(await runCli(delegatedArgv));
|
|
31
28
|
}
|
|
32
|
-
await import(builtCli);
|
|
29
|
+
await import(builtCli.href);
|
|
33
30
|
} catch (error) {
|
|
34
31
|
const message = error instanceof Error ? error.message : String(error);
|
|
35
32
|
if (message.includes("busabase-sdk") && message.includes("dist/index.js")) {
|