@listr2/prompt-adapter-inquirer 2.0.17 → 3.0.0-beta.2

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.cjs CHANGED
@@ -32,6 +32,7 @@ var ListrInquirerPromptAdapter = class extends import_listr2.ListrPromptAdapter
32
32
  __name(this, "ListrInquirerPromptAdapter");
33
33
  }
34
34
  prompt;
35
+ signal = new AbortController();
35
36
  /**
36
37
  * Get the current running instance of `inquirer`.
37
38
  */
@@ -44,6 +45,7 @@ var ListrInquirerPromptAdapter = class extends import_listr2.ListrPromptAdapter
44
45
  async run(prompt, ...[config, context]) {
45
46
  context ??= {};
46
47
  context.output ??= this.wrapper.stdout(import_listr2.ListrTaskEventType.PROMPT);
48
+ context.signal ??= this.signal.signal;
47
49
  this.reportStarted();
48
50
  this.task.on(import_listr2.ListrTaskEventType.STATE, (event) => {
49
51
  if (event === import_listr2.ListrTaskState.SKIPPED && this.prompt) {
@@ -69,7 +71,7 @@ var ListrInquirerPromptAdapter = class extends import_listr2.ListrPromptAdapter
69
71
  return;
70
72
  }
71
73
  this.reportFailed();
72
- this.prompt.cancel();
74
+ this.signal.abort("Prompt was cancelled");
73
75
  }
74
76
  };
75
77
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.d.cts CHANGED
@@ -1,12 +1,13 @@
1
- import { CancelablePromise, Prompt } from '@inquirer/type';
1
+ import { Prompt } from '@inquirer/type';
2
2
  import { ListrPromptAdapter } from 'listr2';
3
3
 
4
4
  declare class ListrInquirerPromptAdapter extends ListrPromptAdapter {
5
5
  private prompt;
6
+ private signal;
6
7
  /**
7
8
  * Get the current running instance of `inquirer`.
8
9
  */
9
- get instance(): CancelablePromise<any>;
10
+ get instance(): Promise<any>;
10
11
  /**
11
12
  * Create a new prompt with `inquirer`.
12
13
  */
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- import { CancelablePromise, Prompt } from '@inquirer/type';
1
+ import { Prompt } from '@inquirer/type';
2
2
  import { ListrPromptAdapter } from 'listr2';
3
3
 
4
4
  declare class ListrInquirerPromptAdapter extends ListrPromptAdapter {
5
5
  private prompt;
6
+ private signal;
6
7
  /**
7
8
  * Get the current running instance of `inquirer`.
8
9
  */
9
- get instance(): CancelablePromise<any>;
10
+ get instance(): Promise<any>;
10
11
  /**
11
12
  * Create a new prompt with `inquirer`.
12
13
  */
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ var ListrInquirerPromptAdapter = class extends ListrPromptAdapter {
8
8
  __name(this, "ListrInquirerPromptAdapter");
9
9
  }
10
10
  prompt;
11
+ signal = new AbortController();
11
12
  /**
12
13
  * Get the current running instance of `inquirer`.
13
14
  */
@@ -20,6 +21,7 @@ var ListrInquirerPromptAdapter = class extends ListrPromptAdapter {
20
21
  async run(prompt, ...[config, context]) {
21
22
  context ??= {};
22
23
  context.output ??= this.wrapper.stdout(ListrTaskEventType.PROMPT);
24
+ context.signal ??= this.signal.signal;
23
25
  this.reportStarted();
24
26
  this.task.on(ListrTaskEventType.STATE, (event) => {
25
27
  if (event === ListrTaskState.SKIPPED && this.prompt) {
@@ -45,7 +47,7 @@ var ListrInquirerPromptAdapter = class extends ListrPromptAdapter {
45
47
  return;
46
48
  }
47
49
  this.reportFailed();
48
- this.prompt.cancel();
50
+ this.signal.abort("Prompt was cancelled");
49
51
  }
50
52
  };
51
53
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@listr2/prompt-adapter-inquirer",
3
- "version": "2.0.17",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Listr2 prompt adapter for inquirer.",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/listr2/listr2",
@@ -36,7 +36,7 @@
36
36
  "build": "tsup-node",
37
37
  "dev:start": "tsup-node --watch",
38
38
  "format": "prettier --log-level warn --write src/ tests/ && pnpm run lint --fix",
39
- "lint": "eslint --ext .ts,.js,.tsx,.jsx src/ tests/",
39
+ "lint": "eslint --flag unstable_config_lookup_from_file 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 --fix"
47
+ "eslint --flag unstable_config_lookup_from_file --fix"
48
48
  ],
49
49
  "*.{json,md}": [
50
50
  "prettier --log-level warn --write"
@@ -70,14 +70,15 @@
70
70
  "idle"
71
71
  ],
72
72
  "dependencies": {
73
- "@inquirer/type": "^1.5.5"
73
+ "@inquirer/type": "^3.0.0"
74
74
  },
75
75
  "devDependencies": {
76
- "@inquirer/input": "^3.0.1",
77
- "@inquirer/prompts": "^6.0.1",
78
- "listr2": "8.2.5"
76
+ "@inquirer/core": "^10.0.0",
77
+ "@inquirer/input": "^4.0.0",
78
+ "@inquirer/prompts": "^7.0.0",
79
+ "listr2": "9.0.0-beta.2"
79
80
  },
80
81
  "peerDependencies": {
81
- "@inquirer/prompts": ">= 3 < 7"
82
+ "@inquirer/prompts": ">= 3 < 8"
82
83
  }
83
84
  }