@orcaops/watch 0.1.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/LICENSE +146 -0
- package/THIRD-PARTY-NOTICES +5703 -0
- package/bin/orcaops-watch.cjs +38 -0
- package/dist/.build-externals.json +12 -0
- package/dist/main.js +81797 -0
- package/dist/sidecar.js +51807 -0
- package/package.json +39 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Node shim that execs the Bun-built OpenTUI UI. `orcaops watch` (and a direct
|
|
3
|
+
// `orcaops-watch` call) resolve this bin by name on PATH; it hands off to Bun,
|
|
4
|
+
// the only runtime the OpenTUI UI runs under. The Node entry keeps the CLI
|
|
5
|
+
// delegation runtime-agnostic — the stub spawns it like any other bin.
|
|
6
|
+
'use strict';
|
|
7
|
+
const { spawnSync } = require('node:child_process');
|
|
8
|
+
const path = require('node:path');
|
|
9
|
+
|
|
10
|
+
function resolveBun() {
|
|
11
|
+
if (process.env.ORCAOPS_WATCH_BUN) return process.env.ORCAOPS_WATCH_BUN;
|
|
12
|
+
return 'bun'; // from PATH (dev machine / CI setup-bun / global install)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// The `review …` verbs are Node sidecar subcommands (they need better-sqlite3),
|
|
16
|
+
// not the Bun OpenTUI UI — route them straight to the built sidecar.
|
|
17
|
+
const forwarded = process.argv.slice(2);
|
|
18
|
+
if (forwarded[0] === 'review') {
|
|
19
|
+
const node = process.env.ORCAOPS_WATCH_NODE || 'node';
|
|
20
|
+
const sidecar = path.join(__dirname, '..', 'dist', 'sidecar.js');
|
|
21
|
+
const r = spawnSync(node, [sidecar, ...forwarded], { stdio: 'inherit', env: process.env });
|
|
22
|
+
process.exit(r.status === null ? 1 : r.status);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const entry = path.join(__dirname, '..', 'dist', 'main.js');
|
|
26
|
+
const result = spawnSync(resolveBun(), [entry, ...forwarded], {
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
env: process.env,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (result.error && result.error.code === 'ENOENT') {
|
|
32
|
+
process.stderr.write(
|
|
33
|
+
"orcaops-watch: could not find the 'bun' runtime.\n" +
|
|
34
|
+
'Install Bun (https://bun.sh) or set ORCAOPS_WATCH_BUN to its path.\n'
|
|
35
|
+
);
|
|
36
|
+
process.exit(127);
|
|
37
|
+
}
|
|
38
|
+
process.exit(result.status === null ? 1 : result.status);
|