@abdullahsahmad/work-kit 0.1.1 → 0.1.2
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/cli/bin/work-kit.mjs +8 -5
- package/cli/src/index.ts +6 -1
- package/package.json +1 -1
package/cli/bin/work-kit.mjs
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
import { execFileSync } from "node:child_process";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { dirname, resolve } from "node:path";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
6
7
|
|
|
7
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
9
|
const entry = resolve(__dirname, "..", "src", "index.ts");
|
|
9
10
|
|
|
11
|
+
// Find tsx binary from the package's own dependencies
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const tsxBin = resolve(dirname(require.resolve("tsx/package.json")), "dist", "cli.mjs");
|
|
14
|
+
|
|
10
15
|
try {
|
|
11
|
-
execFileSync(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{ stdio: "inherit" }
|
|
15
|
-
);
|
|
16
|
+
execFileSync(process.execPath, [tsxBin, entry, ...process.argv.slice(2)], {
|
|
17
|
+
stdio: "inherit",
|
|
18
|
+
});
|
|
16
19
|
} catch (e) {
|
|
17
20
|
process.exit(e.status ?? 1);
|
|
18
21
|
}
|
package/cli/src/index.ts
CHANGED
|
@@ -18,12 +18,17 @@ import { uninstallCommand } from "./commands/uninstall.js";
|
|
|
18
18
|
import { bold, green, yellow, red } from "./utils/colors.js";
|
|
19
19
|
import type { Classification, PhaseName } from "./state/schema.js";
|
|
20
20
|
|
|
21
|
+
import { createRequire } from "node:module";
|
|
22
|
+
|
|
23
|
+
const require = createRequire(import.meta.url);
|
|
24
|
+
const pkg = require("../../package.json");
|
|
25
|
+
|
|
21
26
|
const program = new Command();
|
|
22
27
|
|
|
23
28
|
program
|
|
24
29
|
.name("work-kit")
|
|
25
30
|
.description("State machine orchestrator for work-kit development workflow")
|
|
26
|
-
.version(
|
|
31
|
+
.version(pkg.version);
|
|
27
32
|
|
|
28
33
|
// ── init ─────────────────────────────────────────────────────────────
|
|
29
34
|
|