@openload28/tt-lang 1.0.0-dev.20260930.435 → 1.0.0-dev.20261014.555
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/ttc.js +19 -12
- package/package.json +6 -6
package/bin/ttc.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/* --------------------------------------------------------------------------
|
|
3
3
|
* `ttc` launcher — thin veneer over the native binary from the platform
|
|
4
|
-
* package. All arguments, stdio
|
|
5
|
-
* so `npx ttc` behaves exactly like a natively
|
|
4
|
+
* package. All arguments, stdio, the exit code and SIGINT/SIGTERM/SIGHUP
|
|
5
|
+
* pass through untouched, so `npx ttc` behaves exactly like a natively
|
|
6
|
+
* installed ttc.
|
|
6
7
|
*
|
|
7
8
|
* In a local development install (`scripts/setup` in the TT repository,
|
|
8
9
|
* then `pnpm add -D file:.../npm/tt-lang`) the binary is the repository's
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
* ----------------------------------------------------------------------- */
|
|
12
13
|
"use strict";
|
|
13
14
|
|
|
14
|
-
const {
|
|
15
|
+
const { spawn } = require("node:child_process");
|
|
15
16
|
|
|
16
17
|
const { binaryPath } = require("../index.js");
|
|
17
18
|
const { devEnvironment } = require("../dev.js");
|
|
@@ -26,13 +27,19 @@ try {
|
|
|
26
27
|
process.exit(1);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const FORWARDED = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
31
|
+
const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
32
|
+
const forward = (signal) => child.kill(signal);
|
|
33
|
+
for (const signal of FORWARDED) process.on(signal, forward);
|
|
34
|
+
child.on("error", (error) => {
|
|
35
|
+
console.error(`ttc: failed to run ${binary}: ${error.message}`);
|
|
32
36
|
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
process.
|
|
37
|
+
});
|
|
38
|
+
child.on("exit", (status, signal) => {
|
|
39
|
+
for (const name of FORWARDED) process.removeListener(name, forward);
|
|
40
|
+
if (signal) {
|
|
41
|
+
// Re-raise so the parent observes the same termination signal.
|
|
42
|
+
process.kill(process.pid, signal);
|
|
43
|
+
}
|
|
44
|
+
process.exit(status ?? 1);
|
|
45
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openload28/tt-lang",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.20261014.555",
|
|
4
4
|
"description": "tt — a tiny TypeScript preprocessor adding Rust-style variants, match expressions, try, let-else, if let and the pipeline operator. Installs the ttc compiler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"node": ">=18"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@openload28/tt-lang-linux-x64": "1.0.0-dev.
|
|
54
|
-
"@openload28/tt-lang-linux-arm64": "1.0.0-dev.
|
|
55
|
-
"@openload28/tt-lang-darwin-x64": "1.0.0-dev.
|
|
56
|
-
"@openload28/tt-lang-darwin-arm64": "1.0.0-dev.
|
|
57
|
-
"@openload28/tt-lang-win32-x64-msvc": "1.0.0-dev.
|
|
53
|
+
"@openload28/tt-lang-linux-x64": "1.0.0-dev.20261014.555",
|
|
54
|
+
"@openload28/tt-lang-linux-arm64": "1.0.0-dev.20261014.555",
|
|
55
|
+
"@openload28/tt-lang-darwin-x64": "1.0.0-dev.20261014.555",
|
|
56
|
+
"@openload28/tt-lang-darwin-arm64": "1.0.0-dev.20261014.555",
|
|
57
|
+
"@openload28/tt-lang-win32-x64-msvc": "1.0.0-dev.20261014.555"
|
|
58
58
|
}
|
|
59
59
|
}
|