@flowscripter/dynamic-cli-framework 5.1.7 → 5.1.8

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.
@@ -16,6 +16,7 @@ export default class SpawnInterfaceAdapter implements SpawnInterface {
16
16
  constructor(spawnService: SpawnService, printerService: PrinterService, options?: SpawnInterfaceAdapterOptions);
17
17
  spawn(command: ReadonlyArray<string>, options: {
18
18
  cwd: string;
19
+ timeoutMs?: number;
19
20
  }): Promise<SpawnResult>;
20
21
  }
21
22
  //# sourceMappingURL=SpawnInterfaceAdapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpawnInterfaceAdapter.d.ts","sourceRoot":"","sources":["../../../../src/service/plugin/SpawnInterfaceAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1F,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,cAAc;;gBAOhE,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE,4BAAiC;IAQ/B,KAAK,CAChB,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GACvB,OAAO,CAAC,WAAW,CAAC;CAsCxB"}
1
+ {"version":3,"file":"SpawnInterfaceAdapter.d.ts","sourceRoot":"","sources":["../../../../src/service/plugin/SpawnInterfaceAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1F,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,cAAc;;gBAOhE,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,OAAO,GAAE,4BAAiC;IAQ/B,KAAK,CAChB,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,OAAO,CAAC,WAAW,CAAC;CAuCxB"}
@@ -30,6 +30,7 @@ export default class SpawnInterfaceAdapter {
30
30
  cwd: options.cwd,
31
31
  mode: "wrapped",
32
32
  onOutput,
33
+ timeoutMs: options.timeoutMs,
33
34
  });
34
35
  await writeQueue;
35
36
  this.#printerService.endQuote();
@@ -47,7 +48,7 @@ export default class SpawnInterfaceAdapter {
47
48
  return { ok: true, exitCode: result.exitCode };
48
49
  }
49
50
  return "timedOut" in result
50
- ? { ok: false, error: new Error("Command timed out") }
51
+ ? { ok: false, timedOut: true }
51
52
  : { ok: false, exitCode: result.exitCode, error: result.error };
52
53
  }
53
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowscripter/dynamic-cli-framework",
3
- "version": "5.1.7",
3
+ "version": "5.1.8",
4
4
  "description": "A framework for developing CLI applications which supports dynamic discovery and installation of new commands",
5
5
  "keywords": [
6
6
  "bun",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@flowscripter/dynamic-cli-framework-api": "^2.3.0",
52
- "@flowscripter/dynamic-plugin-framework": "^2.2.1",
52
+ "@flowscripter/dynamic-plugin-framework": "^2.2.2",
53
53
  "emphasize": "^7.0.0",
54
54
  "fastest-levenshtein": "^1.0.16",
55
55
  "figlet": "^1.11.0",
@@ -32,7 +32,7 @@ export default class SpawnInterfaceAdapter implements SpawnInterface {
32
32
 
33
33
  public async spawn(
34
34
  command: ReadonlyArray<string>,
35
- options: { cwd: string },
35
+ options: { cwd: string; timeoutMs?: number },
36
36
  ): Promise<SpawnResult> {
37
37
  this.#printerService.startQuote(this.#quoteColor);
38
38
  this.#printerService.startMark();
@@ -49,6 +49,7 @@ export default class SpawnInterfaceAdapter implements SpawnInterface {
49
49
  cwd: options.cwd,
50
50
  mode: "wrapped",
51
51
  onOutput,
52
+ timeoutMs: options.timeoutMs,
52
53
  });
53
54
 
54
55
  await writeQueue;
@@ -68,7 +69,7 @@ export default class SpawnInterfaceAdapter implements SpawnInterface {
68
69
  return { ok: true, exitCode: result.exitCode };
69
70
  }
70
71
  return "timedOut" in result
71
- ? { ok: false, error: new Error("Command timed out") }
72
+ ? { ok: false, timedOut: true }
72
73
  : { ok: false, exitCode: result.exitCode, error: result.error };
73
74
  }
74
75
  }