weyaw 0.2.0 → 0.2.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/bin/aw-debug.js +44 -0
- package/package.json +6 -5
package/bin/aw-debug.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('node:fs');
|
|
5
|
+
const path = require('node:path');
|
|
6
|
+
const { spawnSync } = require('node:child_process');
|
|
7
|
+
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const exeSuffix = process.platform === 'win32' ? '.exe' : '';
|
|
10
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
11
|
+
|
|
12
|
+
function resolveDebugBinary() {
|
|
13
|
+
const candidates = [
|
|
14
|
+
process.env.WEYAW_RS_BIN,
|
|
15
|
+
path.join(packageRoot, 'target', 'debug', `aw${exeSuffix}`),
|
|
16
|
+
].filter(Boolean);
|
|
17
|
+
|
|
18
|
+
return candidates.find((p) => fs.existsSync(p)) || null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function run(command, childArgs) {
|
|
22
|
+
const result = spawnSync(command, childArgs, { stdio: 'inherit' });
|
|
23
|
+
|
|
24
|
+
if (result.error) {
|
|
25
|
+
console.error(`aw-debug: failed to launch ${command}: ${result.error.message}`);
|
|
26
|
+
process.exit(result.error.code === 'ENOENT' ? 127 : 1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (result.signal) {
|
|
30
|
+
try { process.kill(process.pid, result.signal); } catch { /* noop */ }
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const debugBin = resolveDebugBinary();
|
|
38
|
+
if (!debugBin) {
|
|
39
|
+
console.error(`aw-debug: no debug binary found at ${path.join(packageRoot, 'target', 'debug', `aw${exeSuffix}`)}`);
|
|
40
|
+
console.error('aw-debug: build it with cargo build --bin aw, or set WEYAW_RS_BIN to an aw executable.');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
run(debugBin, args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weyaw",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Weyaw artifact-backed workflow CLI and local server",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/jsnzwu/weyaw#readme",
|
|
14
14
|
"bin": {
|
|
15
|
-
"aw": "bin/aw.js"
|
|
15
|
+
"aw": "bin/aw.js",
|
|
16
|
+
"aw-debug": "bin/aw-debug.js"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
18
19
|
"bin",
|
|
@@ -20,9 +21,9 @@
|
|
|
20
21
|
"LICENSE"
|
|
21
22
|
],
|
|
22
23
|
"optionalDependencies": {
|
|
23
|
-
"weyaw-linux-x64": "0.2.
|
|
24
|
-
"weyaw-darwin-arm64": "0.2.
|
|
25
|
-
"weyaw-win32-x64": "0.2.
|
|
24
|
+
"weyaw-linux-x64": "0.2.2",
|
|
25
|
+
"weyaw-darwin-arm64": "0.2.2",
|
|
26
|
+
"weyaw-win32-x64": "0.2.2"
|
|
26
27
|
},
|
|
27
28
|
"scripts": {
|
|
28
29
|
"package:metadata-test": "node tests/package_metadata.test.js",
|