turbo 2.9.7-canary.8 → 2.9.7

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.
Files changed (2) hide show
  1. package/bin/turbo +46 -6
  2. package/package.json +7 -7
package/bin/turbo CHANGED
@@ -297,14 +297,54 @@ function getBinaryPath() {
297
297
  process.exit(1);
298
298
  }
299
299
 
300
- // Run the binary we got.
301
- try {
302
- child_process.execFileSync(
300
+ function exitWithCodeOrSignal(code, signal) {
301
+ if (signal) {
302
+ try {
303
+ process.kill(process.pid, signal);
304
+ return;
305
+ } catch (e) {
306
+ process.exit(1);
307
+ }
308
+ }
309
+
310
+ process.exit(code === null ? 1 : code);
311
+ }
312
+
313
+ function runTurbo() {
314
+ const child = child_process.spawn(
303
315
  getBinaryPath(),
304
316
  process.argv.slice(2),
305
317
  { stdio: "inherit" }
306
318
  );
307
- } catch (e) {
308
- if (e && e.status) process.exit(e.status);
309
- throw e;
319
+
320
+ const handleSigint = () => {
321
+ // The child shares our process group, so Ctrl+C already reached it.
322
+ // Keep the wrapper alive until the child finishes its own shutdown.
323
+ };
324
+
325
+ const handleSigterm = () => {
326
+ if (!child.killed) {
327
+ child.kill("SIGTERM");
328
+ }
329
+ };
330
+
331
+ const cleanup = () => {
332
+ process.off("SIGINT", handleSigint);
333
+ process.off("SIGTERM", handleSigterm);
334
+ };
335
+
336
+ process.on("SIGINT", handleSigint);
337
+ process.on("SIGTERM", handleSigterm);
338
+
339
+ child.once("error", (error) => {
340
+ cleanup();
341
+ throw error;
342
+ });
343
+
344
+ child.once("exit", (code, signal) => {
345
+ cleanup();
346
+ exitWithCodeOrSignal(code, signal);
347
+ });
310
348
  }
349
+
350
+ runTurbo();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo",
3
- "version": "2.9.7-canary.8",
3
+ "version": "2.9.7",
4
4
  "description": "Turborepo is a high-performance build system for JavaScript and TypeScript codebases.",
5
5
  "homepage": "https://turborepo.dev",
6
6
  "bugs": "https://github.com/vercel/turborepo/issues",
@@ -15,12 +15,12 @@
15
15
  ],
16
16
  "main": "./bin/turbo",
17
17
  "optionalDependencies": {
18
- "@turbo/darwin-64": "2.9.7-canary.8",
19
- "@turbo/darwin-arm64": "2.9.7-canary.8",
20
- "@turbo/linux-64": "2.9.7-canary.8",
21
- "@turbo/linux-arm64": "2.9.7-canary.8",
22
- "@turbo/windows-64": "2.9.7-canary.8",
23
- "@turbo/windows-arm64": "2.9.7-canary.8"
18
+ "@turbo/darwin-64": "2.9.7",
19
+ "@turbo/darwin-arm64": "2.9.7",
20
+ "@turbo/linux-64": "2.9.7",
21
+ "@turbo/linux-arm64": "2.9.7",
22
+ "@turbo/windows-64": "2.9.7",
23
+ "@turbo/windows-arm64": "2.9.7"
24
24
  },
25
25
  "scripts": {
26
26
  "postversion": "node bump-version.js"