@listr2/prompt-adapter-inquirer 3.0.5 → 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/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@listr2/prompt-adapter-inquirer",
3
- "version": "3.0.5",
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",
9
- "module": "./dist/index.js",
10
- "types": "./dist/index.d.ts",
8
+ "main": "./dist/index.mjs",
9
+ "module": "./dist/index.mjs",
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
- "types": "./dist/index.d.ts",
19
- "default": "./dist/index.js"
18
+ "types": "./dist/index.d.mts",
19
+ "default": "./dist/index.mjs"
20
20
  }
21
21
  },
22
22
  "./package.json": "./package.json"
@@ -30,7 +30,7 @@
30
30
  "access": "public"
31
31
  },
32
32
  "engines": {
33
- "node": ">=20.0.0"
33
+ "node": ">=22.0.0"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsdown",
@@ -70,16 +70,16 @@
70
70
  "idle"
71
71
  ],
72
72
  "dependencies": {
73
- "@inquirer/type": "^3.0.8"
73
+ "@inquirer/type": "^4.0.3"
74
74
  },
75
75
  "devDependencies": {
76
- "@inquirer/core": "^10.2.0",
77
- "@inquirer/input": "^4.2.2",
78
- "@inquirer/prompts": "^7.8.4",
79
- "listr2": "9.0.5"
76
+ "@inquirer/core": "^11.1.1",
77
+ "@inquirer/input": "^5.0.4",
78
+ "@inquirer/prompts": "^8.2.0",
79
+ "listr2": "10.1.0"
80
80
  },
81
81
  "peerDependencies": {
82
- "@inquirer/prompts": ">= 3 < 8",
83
- "listr2": "9.0.5"
82
+ "@inquirer/prompts": ">= 3 < 9",
83
+ "listr2": "10.1.0"
84
84
  }
85
85
  }
package/dist/index.cjs DELETED
@@ -1,70 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
22
-
23
- //#endregion
24
- let listr2 = require("listr2");
25
- listr2 = __toESM(listr2);
26
-
27
- //#region src/prompt.ts
28
- var ListrInquirerPromptAdapter = class extends listr2.ListrPromptAdapter {
29
- prompt;
30
- signal = new AbortController();
31
- /**
32
- * Get the current running instance of `inquirer`.
33
- */
34
- get instance() {
35
- return this.prompt;
36
- }
37
- /**
38
- * Create a new prompt with `inquirer`.
39
- */
40
- async run(prompt, ...[config, context]) {
41
- context ??= {};
42
- context.output ??= this.wrapper.stdout(listr2.ListrTaskEventType.PROMPT);
43
- context.signal ??= this.signal.signal;
44
- this.reportStarted();
45
- this.task.on(listr2.ListrTaskEventType.STATE, (event) => {
46
- if (event === listr2.ListrTaskState.SKIPPED && this.prompt) this.cancel();
47
- });
48
- this.prompt = prompt(config, context);
49
- let result;
50
- try {
51
- result = await this.prompt;
52
- this.reportCompleted();
53
- } catch (e) {
54
- this.reportFailed();
55
- throw e;
56
- }
57
- return result;
58
- }
59
- /**
60
- * Cancel the ongoing prompt.
61
- */
62
- cancel() {
63
- if (!this.prompt) return;
64
- this.reportFailed();
65
- this.signal.abort("Prompt was cancelled");
66
- }
67
- };
68
-
69
- //#endregion
70
- 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 };
File without changes
File without changes