watchpot 1.0.0-rc.7 → 1.0.0-rc.8
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/CHANGELOG.md +4 -0
- package/bin/watchpot.mjs +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Each release is a tag `vX.Y.Z`. A breaking change names its codemod in `codemods/` (policy in `codemods/README.md`).
|
|
4
4
|
|
|
5
|
+
## 1.0.0-rc.8
|
|
6
|
+
|
|
7
|
+
Fix: `bunx watchpot sim` in an installed game ran under Node (bunx honours the bin's node shebang) and refused to start; the bin now hands `sim` to Bun.
|
|
8
|
+
|
|
5
9
|
## 1.0.0-rc.7
|
|
6
10
|
|
|
7
11
|
The sim desk: `bunx watchpot sim` serves a game's pacing as graphs and tables with knobs and gate pins that rerun from the snapshot cache and save to `sim.tuning.json`; the developer tools wear one token sheet (grey in a dark system).
|
package/bin/watchpot.mjs
CHANGED
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
// The `watchpot` command (`bunx watchpot <cmd>`, `npx watchpot <cmd>`). Under Bun the source runs with no build, so a
|
|
3
3
|
// stale `dist/` in the repository never shadows it; Node runs the compiled command in `dist/cli`. Plain JS so Node
|
|
4
4
|
// can start it before anything is compiled.
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
5
6
|
import { existsSync } from "node:fs";
|
|
6
7
|
import { dirname, join } from "node:path";
|
|
7
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
9
|
|
|
9
10
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
11
|
+
|
|
12
|
+
// `sim` is Bun-only (the desk imports the game's TypeScript), but `bunx` honours the node shebang above, so
|
|
13
|
+
// `bunx watchpot sim` lands here under Node. Hand the command to Bun when it is on the PATH; without it, `main` says
|
|
14
|
+
// that Bun is needed.
|
|
15
|
+
if (process.versions.bun === undefined && process.argv[2] === "sim") {
|
|
16
|
+
const bun = spawnSync("bun", [fileURLToPath(import.meta.url), ...process.argv.slice(2)], { stdio: "inherit" });
|
|
17
|
+
if (!bun.error) process.exit(bun.status ?? 1);
|
|
18
|
+
}
|
|
10
19
|
const built = join(root, "dist", "cli", "index.js");
|
|
11
20
|
const source = join(root, "src", "cli", "index.ts");
|
|
12
21
|
|