@agjs/tsforge 0.1.2 → 0.1.4
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/tsforge.js +12 -1
- package/package.json +1 -1
- package/src/cli.ts +4 -1
package/bin/tsforge.js
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import "../src/cli.ts";
|
|
2
|
+
import { main } from "../src/cli.ts";
|
|
3
|
+
|
|
4
|
+
main()
|
|
5
|
+
.then((code) => {
|
|
6
|
+
process.exit(code);
|
|
7
|
+
})
|
|
8
|
+
.catch((err) => {
|
|
9
|
+
process.stderr.write(
|
|
10
|
+
`tsforge: ${err instanceof Error ? err.message : String(err)}\n`
|
|
11
|
+
);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
});
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -1312,13 +1312,16 @@ async function repl(args: ICliArgs): Promise<number> {
|
|
|
1312
1312
|
return 0;
|
|
1313
1313
|
}
|
|
1314
1314
|
|
|
1315
|
-
async function main(): Promise<number> {
|
|
1315
|
+
export async function main(): Promise<number> {
|
|
1316
1316
|
const args = parseArgs(process.argv.slice(2));
|
|
1317
1317
|
|
|
1318
1318
|
// A positional task with a scope + gate ⇒ one-shot; otherwise interactive.
|
|
1319
1319
|
return isOneShot(args) ? runOnce(args) : repl(args);
|
|
1320
1320
|
}
|
|
1321
1321
|
|
|
1322
|
+
// Direct run (`bun src/cli.ts`, dev). The published binary instead imports
|
|
1323
|
+
// `main` from bin/tsforge.js, because `import.meta.main` is false when this
|
|
1324
|
+
// module is imported rather than executed as the entry point.
|
|
1322
1325
|
if (import.meta.main) {
|
|
1323
1326
|
main()
|
|
1324
1327
|
.then((code) => {
|