@listr2/prompt-adapter-inquirer 4.0.0 → 4.1.1
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 +6 -6
- package/package.json +12 -12
- package/dist/index.cjs +0 -46
- package/dist/index.d.cts +0 -22
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
|
-
|
|
10
|
-
|
|
9
|
+
* Get the current running instance of `inquirer`.
|
|
10
|
+
*/
|
|
11
11
|
get instance(): Promise<any>;
|
|
12
12
|
/**
|
|
13
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "4.1.1",
|
|
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.
|
|
8
|
+
"main": "./dist/index.mjs",
|
|
9
9
|
"module": "./dist/index.mjs",
|
|
10
|
-
"types": "./dist/index.d.
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"require": {
|
|
14
|
-
"types": "./dist/index.d.
|
|
15
|
-
"default": "./dist/index.
|
|
14
|
+
"types": "./dist/index.d.mts",
|
|
15
|
+
"default": "./dist/index.mjs"
|
|
16
16
|
},
|
|
17
17
|
"import": {
|
|
18
18
|
"types": "./dist/index.d.mts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"build": "tsdown",
|
|
37
37
|
"dev:start": "tsdown --watch",
|
|
38
38
|
"format": "prettier --log-level warn --write src/ tests/ && pnpm run lint --fix",
|
|
39
|
-
"lint": "eslint
|
|
39
|
+
"lint": "eslint src/ tests/",
|
|
40
40
|
"test": "NO_COLOR=1 TS_NODE_PROJECT=tests/tsconfig.json NODE_OPTIONS='--no-warnings --experimental-specifier-resolution=node --experimental-vm-modules' jest --config tests/jest.config.ts",
|
|
41
41
|
"test:cov": "pnpm run test --coverage",
|
|
42
42
|
"test:dev": "NODE_OPTIONS='--no-warnings --experimental-specifier-resolution=node --experimental-vm-modules --inspect=0.0.0.0:9229' pnpm run test --verbose --watchAll"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"lint-staged": {
|
|
45
45
|
"{src,tests}/**/*.{ts,js,tsx,jsx,spec.ts}": [
|
|
46
46
|
"prettier --log-level warn --write",
|
|
47
|
-
"eslint --
|
|
47
|
+
"eslint --fix"
|
|
48
48
|
],
|
|
49
49
|
"*.{json,md}": [
|
|
50
50
|
"prettier --log-level warn --write"
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"@inquirer/type": "^4.0.3"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@inquirer/core": "^11.1.
|
|
77
|
-
"@inquirer/input": "^5.0.
|
|
78
|
-
"@inquirer/prompts": "^8.
|
|
79
|
-
"listr2": "10.
|
|
76
|
+
"@inquirer/core": "^11.1.5",
|
|
77
|
+
"@inquirer/input": "^5.0.8",
|
|
78
|
+
"@inquirer/prompts": "^8.3.0",
|
|
79
|
+
"listr2": "10.1.1"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@inquirer/prompts": ">= 3 < 9",
|
|
83
|
-
"listr2": "10.
|
|
83
|
+
"listr2": "10.1.1"
|
|
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 };
|