@listr2/prompt-adapter-inquirer 4.0.0 → 4.1.0

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/index.d.mts CHANGED
@@ -6,16 +6,16 @@ declare class ListrInquirerPromptAdapter extends ListrPromptAdapter {
6
6
  private prompt;
7
7
  private signal;
8
8
  /**
9
- * Get the current running instance of `inquirer`.
10
- */
9
+ * Get the current running instance of `inquirer`.
10
+ */
11
11
  get instance(): Promise<any>;
12
12
  /**
13
- * Create a new prompt with `inquirer`.
14
- */
13
+ * Create a new prompt with `inquirer`.
14
+ */
15
15
  run<T extends Prompt<any, any> = Prompt<any, any>>(prompt: T, ...[config, context]: Parameters<T>): Promise<ReturnType<T>>;
16
16
  /**
17
- * Cancel the ongoing prompt.
18
- */
17
+ * Cancel the ongoing prompt.
18
+ */
19
19
  cancel(): void;
20
20
  }
21
21
  //#endregion
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@listr2/prompt-adapter-inquirer",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Listr2 prompt adapter for inquirer.",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/listr2/listr2",
7
7
  "type": "module",
8
- "main": "./dist/index.cjs",
8
+ "main": "./dist/index.mjs",
9
9
  "module": "./dist/index.mjs",
10
- "types": "./dist/index.d.cts",
10
+ "types": "./dist/index.d.mts",
11
11
  "exports": {
12
12
  ".": {
13
13
  "require": {
14
- "types": "./dist/index.d.cts",
15
- "default": "./dist/index.cjs"
14
+ "types": "./dist/index.d.mts",
15
+ "default": "./dist/index.mjs"
16
16
  },
17
17
  "import": {
18
18
  "types": "./dist/index.d.mts",
@@ -76,10 +76,10 @@
76
76
  "@inquirer/core": "^11.1.1",
77
77
  "@inquirer/input": "^5.0.4",
78
78
  "@inquirer/prompts": "^8.2.0",
79
- "listr2": "10.0.0"
79
+ "listr2": "10.1.0"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "@inquirer/prompts": ">= 3 < 9",
83
- "listr2": "10.0.0"
83
+ "listr2": "10.1.0"
84
84
  }
85
85
  }
package/dist/index.cjs DELETED
@@ -1,46 +0,0 @@
1
- let listr2 = require("listr2");
2
-
3
- //#region src/prompt.ts
4
- var ListrInquirerPromptAdapter = class extends listr2.ListrPromptAdapter {
5
- prompt;
6
- signal = new AbortController();
7
- /**
8
- * Get the current running instance of `inquirer`.
9
- */
10
- get instance() {
11
- return this.prompt;
12
- }
13
- /**
14
- * Create a new prompt with `inquirer`.
15
- */
16
- async run(prompt, ...[config, context]) {
17
- context ??= {};
18
- context.output ??= this.wrapper.stdout(listr2.ListrTaskEventType.PROMPT);
19
- context.signal ??= this.signal.signal;
20
- this.reportStarted();
21
- this.task.on(listr2.ListrTaskEventType.STATE, (event) => {
22
- if (event === listr2.ListrTaskState.SKIPPED && this.prompt) this.cancel();
23
- });
24
- this.prompt = prompt(config, context);
25
- let result;
26
- try {
27
- result = await this.prompt;
28
- this.reportCompleted();
29
- } catch (e) {
30
- this.reportFailed();
31
- throw e;
32
- }
33
- return result;
34
- }
35
- /**
36
- * Cancel the ongoing prompt.
37
- */
38
- cancel() {
39
- if (!this.prompt) return;
40
- this.reportFailed();
41
- this.signal.abort("Prompt was cancelled");
42
- }
43
- };
44
-
45
- //#endregion
46
- exports.ListrInquirerPromptAdapter = ListrInquirerPromptAdapter;
package/dist/index.d.cts DELETED
@@ -1,22 +0,0 @@
1
- import { Prompt } from "@inquirer/type";
2
- import { ListrPromptAdapter } from "listr2";
3
-
4
- //#region src/prompt.d.ts
5
- declare class ListrInquirerPromptAdapter extends ListrPromptAdapter {
6
- private prompt;
7
- private signal;
8
- /**
9
- * Get the current running instance of `inquirer`.
10
- */
11
- get instance(): Promise<any>;
12
- /**
13
- * Create a new prompt with `inquirer`.
14
- */
15
- run<T extends Prompt<any, any> = Prompt<any, any>>(prompt: T, ...[config, context]: Parameters<T>): Promise<ReturnType<T>>;
16
- /**
17
- * Cancel the ongoing prompt.
18
- */
19
- cancel(): void;
20
- }
21
- //#endregion
22
- export { ListrInquirerPromptAdapter };