@orkestrel/sea 0.0.9 → 0.0.11

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.
@@ -902,6 +902,7 @@ export declare interface SEAInterface {
902
902
  * `windows` — Windows-specific build options (console/GUI terminal).
903
903
  * `root` — project root directory. Default: `process.cwd()`.
904
904
  * `signal` — an `AbortSignal` that cancels the build in progress.
905
+ * `timeout` — milliseconds allowed for each spawned shell command. Omit to disable the timeout.
905
906
  * `blob` — options controlling generated SEA blob behavior.
906
907
  */
907
908
  export declare interface SEAOptions {
@@ -915,6 +916,7 @@ export declare interface SEAOptions {
915
916
  readonly windows?: SEAWindowsOptions;
916
917
  readonly root?: string;
917
918
  readonly signal?: AbortSignal;
919
+ readonly timeout?: number;
918
920
  readonly blob?: SEABlobOptions;
919
921
  }
920
922
 
@@ -902,6 +902,7 @@ export declare interface SEAInterface {
902
902
  * `windows` — Windows-specific build options (console/GUI terminal).
903
903
  * `root` — project root directory. Default: `process.cwd()`.
904
904
  * `signal` — an `AbortSignal` that cancels the build in progress.
905
+ * `timeout` — milliseconds allowed for each spawned shell command. Omit to disable the timeout.
905
906
  * `blob` — options controlling generated SEA blob behavior.
906
907
  */
907
908
  export declare interface SEAOptions {
@@ -915,6 +916,7 @@ export declare interface SEAOptions {
915
916
  readonly windows?: SEAWindowsOptions;
916
917
  readonly root?: string;
917
918
  readonly signal?: AbortSignal;
919
+ readonly timeout?: number;
918
920
  readonly blob?: SEABlobOptions;
919
921
  }
920
922
 
@@ -1,7 +1,7 @@
1
1
  import { appendFileSync, chmodSync, closeSync, copyFileSync, existsSync, fstatSync, fsyncSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
2
2
  import { brotliCompressSync, constants } from "node:zlib";
3
3
  import { dirname, extname, isAbsolute, join, relative, resolve, sep } from "node:path";
4
- import { detach, runSync } from "@orkestrel/process/server";
4
+ import { detach, executeSync } from "@orkestrel/process/server";
5
5
  import { randomUUID } from "node:crypto";
6
6
  import { Emitter } from "@orkestrel/emitter";
7
7
  import { getAssetKeys, getRawAsset, isSea } from "node:sea";
@@ -312,7 +312,7 @@ function runShell(command, options) {
312
312
  const [cmd, ...args] = command;
313
313
  if (cmd === void 0) throw new SEAError("STATE", "Command array must not be empty");
314
314
  if (options?.signal?.aborted === true) throw new SEAError("ABORT", "Shell command aborted", { command: redactCommand(command) });
315
- const result = runSync({
315
+ const result = executeSync({
316
316
  file: cmd,
317
317
  arguments: args,
318
318
  ...options?.env !== void 0 ? { environment: options.env } : {}
@@ -2141,7 +2141,8 @@ var SEA = class {
2141
2141
  configPath
2142
2142
  ], {
2143
2143
  cwd: output,
2144
- ...this.#options.signal === void 0 ? {} : { signal: this.#options.signal }
2144
+ ...this.#options.signal === void 0 ? {} : { signal: this.#options.signal },
2145
+ ...this.#options.timeout === void 0 ? {} : { timeout: this.#options.timeout }
2145
2146
  });
2146
2147
  if (!existsSync(blob)) throw new SEAError("BLOB", "SEA blob generation failed — blob not found", { blob });
2147
2148
  this.#emitter.emit("blob", blob);
@@ -2155,7 +2156,10 @@ var SEA = class {
2155
2156
  const name = process.platform === "win32" ? `${this.#options.name}.exe` : this.#options.name;
2156
2157
  const finalOutput = join(output, name);
2157
2158
  const temp = join(output, `.${this.#options.name}-${randomUUID()}.tmp${ext}`);
2158
- const shell = this.#options.signal === void 0 ? {} : { signal: this.#options.signal };
2159
+ const shell = {
2160
+ ...this.#options.signal === void 0 ? {} : { signal: this.#options.signal },
2161
+ ...this.#options.timeout === void 0 ? {} : { timeout: this.#options.timeout }
2162
+ };
2159
2163
  let signed = false;
2160
2164
  let stripped = false;
2161
2165
  let terminal;