isol8 0.4.1 → 0.4.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/dist/cli.js CHANGED
@@ -6929,11 +6929,6 @@ var require_utils2 = __commonJS((exports, module) => {
6929
6929
  };
6930
6930
  });
6931
6931
 
6932
- // node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
6933
- var require_sshcrypto = __commonJS((exports, module) => {
6934
- module.exports = __require("./sshcrypto-0209sx47.node");
6935
- });
6936
-
6937
6932
  // node_modules/ssh2/lib/protocol/crypto/poly1305.js
6938
6933
  var require_poly1305 = __commonJS((exports, module) => {
6939
6934
  var __dirname = "/home/runner/work/isol8/isol8/node_modules/ssh2/lib/protocol/crypto", __filename = "/home/runner/work/isol8/isol8/node_modules/ssh2/lib/protocol/crypto/poly1305.js";
@@ -7420,7 +7415,7 @@ var require_crypto = __commonJS((exports, module) => {
7420
7415
  var ChaChaPolyDecipher;
7421
7416
  var GenericDecipher;
7422
7417
  try {
7423
- binding = require_sshcrypto();
7418
+ binding = (()=>{throw new Error("Cannot require module "+"./crypto/build/Release/sshcrypto.node");})();
7424
7419
  ({
7425
7420
  AESGCMCipher,
7426
7421
  ChaChaPolyCipher,
@@ -61234,6 +61229,7 @@ program2.command("run").description("Execute code in isol8").argument("[file]",
61234
61229
  process.on("SIGINT", cleanup);
61235
61230
  process.on("SIGTERM", cleanup);
61236
61231
  const spinner = ora("Starting execution...").start();
61232
+ let exitCode = 0;
61237
61233
  try {
61238
61234
  await engine.start();
61239
61235
  spinner.text = "Running code...";
@@ -61254,11 +61250,11 @@ program2.command("run").description("Execute code in isol8").argument("[file]",
61254
61250
  process.stderr.write(event.data);
61255
61251
  } else if (event.type === "exit") {
61256
61252
  if (event.data !== "0") {
61257
- process.exit(Number.parseInt(event.data, 10));
61253
+ exitCode = Number.parseInt(event.data, 10);
61258
61254
  }
61259
61255
  } else if (event.type === "error") {
61260
61256
  console.error(`[ERR] ${event.data}`);
61261
- process.exit(1);
61257
+ exitCode = 1;
61262
61258
  }
61263
61259
  }
61264
61260
  } else {
@@ -61278,16 +61274,19 @@ program2.command("run").description("Execute code in isol8").argument("[file]",
61278
61274
  console.error(`[INFO] Output written to ${opts.out}`);
61279
61275
  }
61280
61276
  if (result.exitCode !== 0) {
61281
- process.exit(result.exitCode);
61277
+ exitCode = result.exitCode;
61282
61278
  }
61283
61279
  }
61284
61280
  } catch (err) {
61285
61281
  spinner.stop();
61286
61282
  throw err;
61287
61283
  } finally {
61288
- await engine.stop();
61284
+ const cleanupPromise = engine.stop();
61285
+ const timeoutPromise = new Promise((resolve3) => setTimeout(resolve3, 5000));
61286
+ await Promise.race([cleanupPromise, timeoutPromise]);
61289
61287
  process.off("SIGINT", cleanup);
61290
61288
  process.off("SIGTERM", cleanup);
61289
+ process.exit(exitCode);
61291
61290
  }
61292
61291
  });
61293
61292
  program2.command("serve").description("Start the isol8 remote server").option("-p, --port <port>", "Port to listen on", "3000").option("-k, --key <key>", "API key for authentication").action(async (opts) => {
@@ -61517,4 +61516,4 @@ if (!process.argv.slice(2).length) {
61517
61516
  }
61518
61517
  program2.parse();
61519
61518
 
61520
- //# debugId=AF05A942A56C65F664756E2164756E21
61519
+ //# debugId=56782BF23191267E64756E2164756E21