@node-core/utils 7.2.0 → 7.2.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.
Files changed (182) hide show
  1. package/lib/ci/build-types/test_build.js +3 -3
  2. package/lib/ci/failure_aggregator.js +2 -2
  3. package/lib/ci/run_ci.js +3 -2
  4. package/lib/cli.js +6 -6
  5. package/lib/figures.js +6 -6
  6. package/lib/update-v8/backport.js +3 -4
  7. package/lib/verbosity.js +2 -4
  8. package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/README.md +4 -4
  9. package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.d.mts +21 -0
  10. package/node_modules/@listr2/prompt-adapter-inquirer/dist/index.mjs +46 -0
  11. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/LICENSE +22 -0
  12. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.d.ts +2 -0
  13. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/index.js +2 -0
  14. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.d.ts +35 -0
  15. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/inquirer.js +1 -0
  16. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.d.ts +34 -0
  17. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/dist/utils.js +2 -0
  18. package/node_modules/@listr2/prompt-adapter-inquirer/node_modules/@inquirer/type/package.json +88 -0
  19. package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/package.json +25 -20
  20. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.d.ts +48 -3
  21. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/base.js +58 -19
  22. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/package.json +1 -1
  23. package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/readme.md +36 -1
  24. package/node_modules/ansi-regex/index.js +9 -4
  25. package/node_modules/ansi-regex/package.json +1 -1
  26. package/node_modules/ansi-regex/readme.md +6 -0
  27. package/node_modules/ansi-styles/index.d.ts +12 -12
  28. package/node_modules/ansi-styles/index.js +3 -3
  29. package/node_modules/ansi-styles/package.json +4 -4
  30. package/node_modules/cli-truncate/index.d.ts +3 -3
  31. package/node_modules/cli-truncate/index.js +40 -14
  32. package/node_modules/cli-truncate/node_modules/string-width/index.js +133 -15
  33. package/node_modules/cli-truncate/node_modules/string-width/package.json +4 -4
  34. package/node_modules/cli-truncate/node_modules/string-width/readme.md +1 -1
  35. package/node_modules/cli-truncate/package.json +7 -7
  36. package/node_modules/cli-truncate/readme.md +2 -3
  37. package/node_modules/ghauth/.github/dependabot.yml +11 -3
  38. package/node_modules/ghauth/.github/workflows/depsound.yml +33 -0
  39. package/node_modules/ghauth/.github/workflows/test-and-release.yml +4 -4
  40. package/node_modules/ghauth/CHANGELOG.md +60 -0
  41. package/node_modules/ghauth/package.json +30 -6
  42. package/node_modules/js-yaml/README.md +20 -187
  43. package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs +1008 -946
  44. package/node_modules/js-yaml/dist/browser/js-yaml.esm.min.mjs.map +1 -1
  45. package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js +29 -23
  46. package/node_modules/js-yaml/dist/browser/js-yaml.umd.min.js.map +1 -1
  47. package/node_modules/js-yaml/dist/js-yaml.cjs.js +1043 -583
  48. package/node_modules/js-yaml/dist/js-yaml.cjs.js.map +1 -1
  49. package/node_modules/js-yaml/dist/js-yaml.d.ts +877 -133
  50. package/node_modules/js-yaml/dist/js-yaml.mjs +995 -556
  51. package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
  52. package/node_modules/js-yaml/package.json +8 -7
  53. package/node_modules/listr2/dist/{index.d.cts → index.d.mts} +90 -60
  54. package/node_modules/listr2/dist/{index.js → index.mjs} +496 -373
  55. package/node_modules/listr2/node_modules/string-width/index.d.ts +39 -0
  56. package/node_modules/listr2/node_modules/string-width/index.js +207 -0
  57. package/node_modules/listr2/node_modules/string-width/package.json +65 -0
  58. package/node_modules/listr2/node_modules/string-width/readme.md +66 -0
  59. package/node_modules/listr2/node_modules/wrap-ansi/index.d.ts +1 -1
  60. package/node_modules/listr2/node_modules/wrap-ansi/index.js +544 -116
  61. package/node_modules/listr2/node_modules/wrap-ansi/package.json +10 -13
  62. package/node_modules/listr2/node_modules/wrap-ansi/readme.md +2 -0
  63. package/node_modules/listr2/package.json +16 -19
  64. package/node_modules/log-update/index.d.ts +64 -1
  65. package/node_modules/log-update/index.js +268 -18
  66. package/node_modules/log-update/node_modules/string-width/index.d.ts +39 -0
  67. package/node_modules/log-update/node_modules/string-width/index.js +207 -0
  68. package/node_modules/log-update/node_modules/string-width/package.json +65 -0
  69. package/node_modules/log-update/node_modules/string-width/readme.md +66 -0
  70. package/node_modules/log-update/node_modules/wrap-ansi/index.d.ts +1 -1
  71. package/node_modules/log-update/node_modules/wrap-ansi/index.js +544 -116
  72. package/node_modules/log-update/node_modules/wrap-ansi/package.json +10 -13
  73. package/node_modules/log-update/node_modules/wrap-ansi/readme.md +2 -0
  74. package/node_modules/log-update/package.json +14 -12
  75. package/node_modules/log-update/readme.md +61 -0
  76. package/node_modules/slice-ansi/index.d.ts +2 -2
  77. package/node_modules/slice-ansi/index.js +260 -112
  78. package/node_modules/slice-ansi/package.json +10 -9
  79. package/node_modules/slice-ansi/readme.md +3 -2
  80. package/node_modules/slice-ansi/tokenize-ansi.js +752 -0
  81. package/node_modules/smol-toml/README.md +205 -191
  82. package/node_modules/smol-toml/dist/date.d.ts +0 -1
  83. package/node_modules/smol-toml/dist/date.js +0 -1
  84. package/node_modules/smol-toml/dist/error.d.ts +0 -1
  85. package/node_modules/smol-toml/dist/error.js +0 -1
  86. package/node_modules/smol-toml/dist/extract.js +32 -65
  87. package/node_modules/smol-toml/dist/index.cjs +302 -288
  88. package/node_modules/smol-toml/dist/index.d.ts +0 -1
  89. package/node_modules/smol-toml/dist/index.js +0 -1
  90. package/node_modules/smol-toml/dist/parse.d.ts +1 -3
  91. package/node_modules/smol-toml/dist/parse.js +22 -21
  92. package/node_modules/smol-toml/dist/primitive.js +75 -76
  93. package/node_modules/smol-toml/dist/stringify.d.ts +0 -1
  94. package/node_modules/smol-toml/dist/stringify.js +43 -30
  95. package/node_modules/smol-toml/dist/struct.js +90 -93
  96. package/node_modules/smol-toml/dist/util.d.ts +1 -1
  97. package/node_modules/smol-toml/dist/util.js +36 -39
  98. package/node_modules/smol-toml/package.json +6 -6
  99. package/node_modules/strip-ansi/index.js +5 -0
  100. package/node_modules/strip-ansi/package.json +5 -5
  101. package/package.json +3 -5
  102. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.cjs +0 -127
  103. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.cts +0 -152
  104. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.d.ts +0 -152
  105. package/node_modules/@listr2/prompt-adapter-enquirer/dist/index.js +0 -92
  106. package/node_modules/chalk/package.json +0 -92
  107. package/node_modules/chalk/readme.md +0 -331
  108. package/node_modules/chalk/source/index.d.ts +0 -437
  109. package/node_modules/chalk/source/index.js +0 -261
  110. package/node_modules/chalk/source/utilities.js +0 -33
  111. package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -299
  112. package/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -261
  113. package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
  114. package/node_modules/chalk/source/vendor/supports-color/browser.js +0 -32
  115. package/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
  116. package/node_modules/chalk/source/vendor/supports-color/index.js +0 -206
  117. package/node_modules/colorette/LICENSE.md +0 -7
  118. package/node_modules/colorette/README.md +0 -134
  119. package/node_modules/colorette/index.cjs +0 -218
  120. package/node_modules/colorette/index.d.ts +0 -93
  121. package/node_modules/colorette/index.js +0 -150
  122. package/node_modules/colorette/package.json +0 -40
  123. package/node_modules/eventemitter3/LICENSE +0 -21
  124. package/node_modules/eventemitter3/README.md +0 -94
  125. package/node_modules/eventemitter3/dist/eventemitter3.esm.js +0 -347
  126. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +0 -1
  127. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +0 -1
  128. package/node_modules/eventemitter3/dist/eventemitter3.umd.js +0 -355
  129. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +0 -1
  130. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +0 -1
  131. package/node_modules/eventemitter3/index.d.ts +0 -135
  132. package/node_modules/eventemitter3/index.js +0 -336
  133. package/node_modules/eventemitter3/index.mjs +0 -4
  134. package/node_modules/eventemitter3/package.json +0 -67
  135. package/node_modules/figures/index.d.ts +0 -279
  136. package/node_modules/figures/index.js +0 -292
  137. package/node_modules/figures/package.json +0 -49
  138. package/node_modules/figures/readme.md +0 -337
  139. package/node_modules/listr2/dist/index.cjs +0 -2189
  140. package/node_modules/listr2/dist/index.d.ts +0 -1528
  141. package/node_modules/rfdc/.github/workflows/ci.yml +0 -21
  142. package/node_modules/rfdc/LICENSE +0 -15
  143. package/node_modules/rfdc/default.js +0 -3
  144. package/node_modules/rfdc/index.d.ts +0 -13
  145. package/node_modules/rfdc/index.js +0 -198
  146. package/node_modules/rfdc/index.test-d.ts +0 -13
  147. package/node_modules/rfdc/package.json +0 -73
  148. package/node_modules/rfdc/readme.md +0 -181
  149. package/node_modules/rfdc/test/index.js +0 -306
  150. package/node_modules/smol-toml/dist/date.d.ts.map +0 -1
  151. package/node_modules/smol-toml/dist/date.js.map +0 -1
  152. package/node_modules/smol-toml/dist/error.d.ts.map +0 -1
  153. package/node_modules/smol-toml/dist/error.js.map +0 -1
  154. package/node_modules/smol-toml/dist/extract.js.map +0 -1
  155. package/node_modules/smol-toml/dist/index.cjs.map +0 -1
  156. package/node_modules/smol-toml/dist/index.d.ts.map +0 -1
  157. package/node_modules/smol-toml/dist/index.js.map +0 -1
  158. package/node_modules/smol-toml/dist/parse.d.ts.map +0 -1
  159. package/node_modules/smol-toml/dist/parse.js.map +0 -1
  160. package/node_modules/smol-toml/dist/primitive.d.ts +0 -29
  161. package/node_modules/smol-toml/dist/primitive.d.ts.map +0 -1
  162. package/node_modules/smol-toml/dist/primitive.js.map +0 -1
  163. package/node_modules/smol-toml/dist/stringify.d.ts.map +0 -1
  164. package/node_modules/smol-toml/dist/stringify.js.map +0 -1
  165. package/node_modules/smol-toml/dist/struct.js.map +0 -1
  166. package/node_modules/smol-toml/dist/util.d.ts.map +0 -1
  167. package/node_modules/smol-toml/dist/util.js.map +0 -1
  168. package/node_modules/smol-toml/src/date.ts +0 -152
  169. package/node_modules/smol-toml/src/error.ts +0 -77
  170. package/node_modules/smol-toml/src/extract.ts +0 -113
  171. package/node_modules/smol-toml/src/index.ts +0 -42
  172. package/node_modules/smol-toml/src/parse.ts +0 -184
  173. package/node_modules/smol-toml/src/primitive.ts +0 -249
  174. package/node_modules/smol-toml/src/stringify.ts +0 -191
  175. package/node_modules/smol-toml/src/struct.ts +0 -202
  176. package/node_modules/smol-toml/src/util.ts +0 -106
  177. /package/node_modules/@listr2/{prompt-adapter-enquirer → prompt-adapter-inquirer}/LICENSE +0 -0
  178. /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.d.ts +0 -0
  179. /package/node_modules/{log-update/node_modules/ansi-escapes → ansi-escapes}/index.js +0 -0
  180. /package/node_modules/{chalk → ansi-escapes}/license +0 -0
  181. /package/node_modules/{figures → listr2/node_modules/string-width}/license +0 -0
  182. /package/node_modules/log-update/node_modules/{ansi-escapes → string-width}/license +0 -0
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import { styleText } from 'node:util';
2
2
 
3
3
  import { shortSha } from '../../utils.js';
4
4
  import {
@@ -119,11 +119,11 @@ export class TestBuild extends Job {
119
119
  cli.table('Built On', failure.builtOn);
120
120
  }
121
121
  if (!reason.includes('\n') && reason.length < 40) {
122
- cli.table('Reason', chalk.red(reason));
122
+ cli.table('Reason', styleText('red', reason));
123
123
  } else {
124
124
  cli.table('Reason', '');
125
125
  const lines = reason.split('\n');
126
- cli.log(` ${chalk.red(lines[0])}`);
126
+ cli.log(` ${styleText('red', lines[0])}`);
127
127
  for (let i = 1; i < lines.length; ++i) {
128
128
  cli.log(` ${lines[i]}`);
129
129
  }
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import { styleText } from 'node:util';
2
2
 
3
3
  import { getMachineUrl, parsePRFromURL } from '../links.js';
4
4
  import CIFailureParser from './ci_failure_parser.js';
@@ -140,7 +140,7 @@ export class FailureAggregator {
140
140
  cli.table('First CI', `${prs[0].upstream}`);
141
141
  }
142
142
  cli.table('Last CI', `${prs[prs.length - 1].upstream}`);
143
- cli.log('\n' + chalk.bold('Example: ') + `${failures[0].url}\n`);
143
+ cli.log('\n' + styleText('bold', 'Example: ') + `${failures[0].url}\n`);
144
144
  const example = failures[0].reason;
145
145
  cli.log(example.length > 512 ? example.slice(0, 512) + '...' : example);
146
146
  cli.separator();
package/lib/ci/run_ci.js CHANGED
@@ -73,9 +73,10 @@ export class RunPRJob {
73
73
  }
74
74
 
75
75
  async start() {
76
- const { cli, request, certifySafe, checkForDuplicates } = this;
76
+ const { cli, request, checkForDuplicates } = this;
77
+ const certifySafe = await this.certifySafe;
77
78
 
78
- if (!(await certifySafe)) {
79
+ if (!certifySafe) {
79
80
  cli.error('Refusing to run CI on potentially unsafe PR');
80
81
  return false;
81
82
  }
package/lib/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import ora from 'ora';
2
- import chalk from 'chalk';
2
+ import { styleText } from 'node:util';
3
3
  import * as inquirer from '@inquirer/prompts';
4
4
 
5
5
  import { warning, error, info, success } from './figures.js';
@@ -22,7 +22,7 @@ const QUESTION_TYPE = {
22
22
  const formatter = new Intl.ListFormat('en', { type: 'disjunction' });
23
23
 
24
24
  function head(text, length = 11) {
25
- return chalk.bold(text.padEnd(length));
25
+ return styleText('bold', text.padEnd(length));
26
26
  }
27
27
 
28
28
  export default class CLI {
@@ -180,9 +180,9 @@ export default class CLI {
180
180
  const rest = (length - text.length - 2);
181
181
  const half = sep.repeat(Math.abs(Math.floor(rest / 2)));
182
182
  if (rest % 2 === 0) {
183
- this.log(`${half} ${chalk.bold(text)} ${half}`);
183
+ this.log(`${half} ${styleText('bold', text)} ${half}`);
184
184
  } else {
185
- this.log(`${half} ${chalk.bold(text)} ${sep}${half}`);
185
+ this.log(`${half} ${styleText('bold', text)} ${sep}${half}`);
186
186
  }
187
187
  }
188
188
 
@@ -193,7 +193,7 @@ export default class CLI {
193
193
 
194
194
  warn(text, options = {}) {
195
195
  const prefix = options.newline ? this.eolIndent : this.figureIndent;
196
- this.log(prefix + chalk.bold(`${warning} ${text}`));
196
+ this.log(prefix + styleText('bold', `${warning} ${text}`));
197
197
  }
198
198
 
199
199
  info(text, options = {}) {
@@ -210,7 +210,7 @@ export default class CLI {
210
210
  this.log(JSON.stringify(obj.data, null, 2));
211
211
  }
212
212
  } else {
213
- this.log(prefix + chalk.bold(`${error} ${obj}`));
213
+ this.log(prefix + styleText('bold', `${error} ${obj}`));
214
214
  }
215
215
  }
216
216
 
package/lib/figures.js CHANGED
@@ -1,7 +1,7 @@
1
- import chalk from 'chalk';
2
- import figures from 'figures';
1
+ import { figures } from 'listr2';
2
+ import { styleText } from 'node:util';
3
3
 
4
- export const warning = chalk.yellow(figures.warning);
5
- export const error = chalk.red(figures.cross);
6
- export const info = chalk.blue(figures.info);
7
- export const success = chalk.green(figures.tick);
4
+ export const warning = styleText('yellow', figures.warning);
5
+ export const error = styleText('red', figures.cross);
6
+ export const info = styleText('blue', figures.info);
7
+ export const success = styleText('green', figures.tick);
@@ -3,8 +3,8 @@ import {
3
3
  promises as fs
4
4
  } from 'node:fs';
5
5
 
6
- import { confirm } from '@inquirer/prompts';
7
- import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer';
6
+ import { confirm, input } from '@inquirer/prompts';
7
+ import { ListrInquirerPromptAdapter } from '@listr2/prompt-adapter-inquirer';
8
8
 
9
9
  import { shortSha } from '../utils.js';
10
10
 
@@ -263,8 +263,7 @@ async function applyPatch(ctx, task, patch, method = 'apply') {
263
263
  );
264
264
  } catch {
265
265
  patch.hadConflicts = true;
266
- return task.prompt(ListrEnquirerPromptAdapter).run({
267
- type: 'input',
266
+ return task.prompt(ListrInquirerPromptAdapter).run(input, {
268
267
  message: "Resolve merge conflicts and enter 'RESOLVED'",
269
268
  validate: value => value.toUpperCase() === 'RESOLVED'
270
269
  });
package/lib/verbosity.js CHANGED
@@ -1,6 +1,4 @@
1
- import util from 'node:util';
2
-
3
- import chalk from 'chalk';
1
+ import { format, styleText } from 'node:util';
4
2
 
5
3
  const VERBOSITY = {
6
4
  NONE: 0,
@@ -25,5 +23,5 @@ export function setVerbosityFromEnv() {
25
23
 
26
24
  export function debuglog(...args) {
27
25
  // Prepend a line break in case it's logged while the spinner is running
28
- console.error(chalk.green(util.format('\n[DEBUG]', ...args)));
26
+ console.error('\n' + styleText('green', format('[DEBUG]', ...args)));
29
27
  }
@@ -1,6 +1,6 @@
1
- # @listr2/prompt-adapter-enquirer
1
+ # @listr2/prompt-adapter-inquirer
2
2
 
3
- [![Pipeline](https://gitlab.kilic.dev/libraries/listr2/badges/master/pipeline.svg?style=flat-square&ignore_skipped=true)](https://gitlab.kilic.dev/libraries/listr2/-/commits/master) [![Version](https://img.shields.io/npm/v/%40listr2/prompt-adapter-enquirer.svg?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-enquirer?activeTab=versions) [![Downloads](https://img.shields.io/npm/dm/%40listr2/prompt-adapter-enquirer.svg?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-enquirer) [![Size](https://img.shields.io/bundlephobia/min/%40listr2/prompt-adapter-enquirer?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-enquirer) [![Dependencies](https://img.shields.io/librariesio/release/npm/%40listr2/prompt-adapter-enquirer?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-enquirer?activeTab=dependencies)
3
+ [![Pipeline](https://gitlab.kilic.dev/libraries/listr2/badges/master/pipeline.svg?style=flat-square&ignore_skipped=true)](https://gitlab.kilic.dev/libraries/listr2/-/commits/master) [![Version](https://img.shields.io/npm/v/%40listr2/prompt-adapter-inquirer.svg?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-inquirer?activeTab=versions) [![Downloads](https://img.shields.io/npm/dm/%40listr2/prompt-adapter-inquirer.svg?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-inquirer) [![Size](https://img.shields.io/bundlephobia/min/%40listr2/prompt-adapter-inquirer?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-inquirer) [![Dependencies](https://img.shields.io/librariesio/release/npm/%40listr2/prompt-adapter-inquirer?style=flat-square&logo=npm)](https://www.npmjs.com/package/%40listr2/prompt-adapter-inquirer?activeTab=dependencies)
4
4
 
5
5
  [![github sponsors](https://img.shields.io/github/sponsors/cenk1cenk2?style=flat-square&logo=github)](https://github.com/sponsors/cenk1cenk2) [![opencollective](https://img.shields.io/opencollective/sponsors/listr2?label=open%20collective&logo=opencollective)](https://opencollective.com/listr2)
6
6
 
@@ -10,6 +10,6 @@
10
10
 
11
11
  ## Documentation
12
12
 
13
- This is an extension to [`listr2`](https://listr2.kilic.dev/) to create prompts with [`enquirer`](https://github.com/enquirer/enquirer).
13
+ This is an extension to [`listr2`](https://listr2.kilic.dev/) to create prompts with [`@inquirer/prompts`](https://github.com/SBoudrias/Inquirer.js/blob/master/packages/prompts/README.md).
14
14
 
15
- **[Read the documentation...](https://listr2.kilic.dev/task/prompts.html#enquirer)**
15
+ **[Read the documentation...](https://listr2.kilic.dev/task/prompts.html#inquirer)**
@@ -0,0 +1,21 @@
1
+ import { ListrPromptAdapter } from "listr2";
2
+ import { Prompt } from "@inquirer/type";
3
+ //#region src/prompt.d.ts
4
+ declare class ListrInquirerPromptAdapter extends ListrPromptAdapter {
5
+ private prompt;
6
+ private signal;
7
+ /**
8
+ * Get the current running instance of `inquirer`.
9
+ */
10
+ get instance(): Promise<any>;
11
+ /**
12
+ * Create a new prompt with `inquirer`.
13
+ */
14
+ run<T extends Prompt<any, any> = Prompt<any, any>>(prompt: T, ...[config, context]: Parameters<T>): Promise<ReturnType<T>>;
15
+ /**
16
+ * Cancel the ongoing prompt.
17
+ */
18
+ cancel(): void;
19
+ }
20
+ //#endregion
21
+ export { ListrInquirerPromptAdapter };
@@ -0,0 +1,46 @@
1
+ import { ListrPromptAdapter, ListrTaskEventType, ListrTaskState } from "listr2";
2
+
3
+ //#region src/prompt.ts
4
+ var ListrInquirerPromptAdapter = class extends 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(ListrTaskEventType.PROMPT);
19
+ context.signal ??= this.signal.signal;
20
+ this.reportStarted();
21
+ this.task.on(ListrTaskEventType.STATE, (event) => {
22
+ if (event === 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
+ export { ListrInquirerPromptAdapter };
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2025 Simon Boudrias
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ export * from './inquirer.ts';
2
+ export * from './utils.ts';
@@ -0,0 +1,2 @@
1
+ export * from "./inquirer.js";
2
+ export * from "./utils.js";
@@ -0,0 +1,35 @@
1
+ import { Duplex } from 'node:stream';
2
+ /**
3
+ * `InquirerReadline` is a re-implementation of `readline.Interface` from Node.js.
4
+ * We're reimplementing it because of 3 reasons:
5
+ * 1. The `readline.Interface` API is not complete; it's missing for example `clearLine`.
6
+ * 2. The input/output streams are not generics, meaning they're inexact.
7
+ * 3. Since ReadLine isn't built-in Typescript Global NodeJS type, it'd force us to ship `@types/node` as a dependency to all users.
8
+ */
9
+ export type InquirerReadline = {
10
+ output: Duplex & {
11
+ mute: () => void;
12
+ unmute: () => void;
13
+ };
14
+ input: NodeJS.ReadableStream;
15
+ clearLine: (dir: 0 | 1 | -1) => void;
16
+ getCursorPos: () => {
17
+ rows: number;
18
+ cols: number;
19
+ };
20
+ setPrompt: (prompt: string) => void;
21
+ line: string;
22
+ write: (data: string) => void;
23
+ on: (event: string, listener: (...args: unknown[]) => void) => void;
24
+ removeListener: (event: string, listener: (...args: unknown[]) => void) => void;
25
+ pause: () => void;
26
+ resume: () => void;
27
+ close: () => void;
28
+ };
29
+ export type Context = {
30
+ input?: NodeJS.ReadableStream;
31
+ output?: NodeJS.WritableStream;
32
+ clearPromptOnDone?: boolean;
33
+ signal?: AbortSignal;
34
+ };
35
+ export type Prompt<Value, Config> = (config: Config, context?: Context) => Promise<Value>;
@@ -0,0 +1,34 @@
1
+ type Key = string | number | symbol;
2
+ /**
3
+ * Recursively expand intersections and mapped types for better IDE display,
4
+ * while preserving functions, arrays, primitives, and types with a string
5
+ * index signature (e.g. `Record<string, ...>`) as-is.
6
+ */
7
+ export type Prettify<T> = T extends (...args: never[]) => unknown ? T : T extends ReadonlyArray<unknown> ? T : T extends string | number | boolean | symbol | bigint | null | undefined ? T : T extends object ? string extends keyof T ? T : {
8
+ [K in keyof T]: Prettify<T[K]>;
9
+ } & {} : T;
10
+ export type PartialDeep<T> = T extends object ? {
11
+ [P in keyof T]?: PartialDeep<T[P]>;
12
+ } : T;
13
+ export type LiteralUnion<T extends F, F = string> = T | (F & {});
14
+ export type KeyUnion<T> = LiteralUnion<Extract<keyof T, string>>;
15
+ export type DistributiveMerge<A, B> = A extends any ? Prettify<Omit<A, keyof B> & B> : never;
16
+ export type UnionToIntersection<T> = (T extends any ? (input: T) => void : never) extends (input: infer Intersection) => void ? Intersection : never;
17
+ /**
18
+ * @hidden
19
+ */
20
+ type __Pick<O extends object, K extends keyof O> = {
21
+ [P in K]: O[P];
22
+ } & {};
23
+ /**
24
+ * @hidden
25
+ */
26
+ export type _Pick<O extends object, K extends Key> = __Pick<O, keyof O & K>;
27
+ /**
28
+ * Extract out of `O` the fields of key `K`
29
+ * @param O to extract from
30
+ * @param K to chose fields
31
+ * @returns [[Object]]
32
+ */
33
+ export type Pick<O extends object, K extends Key> = O extends unknown ? _Pick<O, K> : never;
34
+ export {};
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ export {};
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@inquirer/type",
3
+ "version": "4.1.0",
4
+ "description": "Inquirer core TS types",
5
+ "keywords": [
6
+ "answer",
7
+ "answers",
8
+ "ask",
9
+ "base",
10
+ "cli",
11
+ "command",
12
+ "command-line",
13
+ "confirm",
14
+ "enquirer",
15
+ "generate",
16
+ "generator",
17
+ "hyper",
18
+ "input",
19
+ "inquire",
20
+ "inquirer",
21
+ "interface",
22
+ "iterm",
23
+ "javascript",
24
+ "menu",
25
+ "node",
26
+ "nodejs",
27
+ "prompt",
28
+ "promptly",
29
+ "prompts",
30
+ "question",
31
+ "readline",
32
+ "scaffold",
33
+ "scaffolder",
34
+ "scaffolding",
35
+ "stdin",
36
+ "stdout",
37
+ "terminal",
38
+ "tty",
39
+ "types",
40
+ "typescript",
41
+ "ui",
42
+ "yeoman",
43
+ "yo",
44
+ "zsh"
45
+ ],
46
+ "license": "MIT",
47
+ "author": "Simon Boudrias <admin@simonboudrias.com>",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/SBoudrias/Inquirer.js.git"
51
+ },
52
+ "files": [
53
+ "dist"
54
+ ],
55
+ "type": "module",
56
+ "sideEffects": false,
57
+ "exports": {
58
+ ".": {
59
+ "types": "./dist/index.d.ts",
60
+ "default": "./dist/index.js"
61
+ },
62
+ "./package.json": "./package.json"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ },
67
+ "scripts": {
68
+ "tsc": "tsc"
69
+ },
70
+ "devDependencies": {
71
+ "@repo/tsconfig": "0.0.0",
72
+ "typescript": "^6.0.2"
73
+ },
74
+ "peerDependencies": {
75
+ "@types/node": ">=18"
76
+ },
77
+ "peerDependenciesMeta": {
78
+ "@types/node": {
79
+ "optional": true
80
+ }
81
+ },
82
+ "engines": {
83
+ "node": ">=23.5.0 || ^22.13.0 || ^20.17.0"
84
+ },
85
+ "main": "./dist/index.js",
86
+ "types": "./dist/index.d.ts",
87
+ "gitHead": "51ac389603405e8f9f315ce49416153d95c5fefe"
88
+ }
@@ -1,22 +1,22 @@
1
1
  {
2
- "name": "@listr2/prompt-adapter-enquirer",
3
- "version": "2.0.16",
4
- "description": "Listr2 prompt adapter for enquirer.",
2
+ "name": "@listr2/prompt-adapter-inquirer",
3
+ "version": "4.2.7",
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,16 +30,16 @@
30
30
  "access": "public"
31
31
  },
32
32
  "engines": {
33
- "node": ">=18.0.0"
33
+ "node": ">=22.13.0"
34
34
  },
35
35
  "scripts": {
36
- "build": "tsup-node",
37
- "dev:start": "tsup-node --watch",
36
+ "build": "tsdown",
37
+ "dev:start": "tsdown --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/",
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",
39
+ "lint": "eslint src/ tests/",
40
+ "test": "NODE_OPTIONS='--no-warnings --experimental-vm-modules' jest --config tests/jest.config.ts",
41
41
  "test:cov": "pnpm run test --coverage",
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"
42
+ "test:dev": "NODE_OPTIONS='--no-warnings --experimental-vm-modules --inspect=0.0.0.0:9229' pnpm run test --verbose --watchAll"
43
43
  },
44
44
  "lint-staged": {
45
45
  "{src,tests}/**/*.{ts,js,tsx,jsx,spec.ts}": [
@@ -69,12 +69,17 @@
69
69
  "wait",
70
70
  "idle"
71
71
  ],
72
- "dependencies": {},
72
+ "dependencies": {
73
+ "@inquirer/type": "^4.0.7"
74
+ },
73
75
  "devDependencies": {
74
- "listr2": "8.3.3",
75
- "enquirer": "^2.4.1"
76
+ "@inquirer/core": "^12.0.0",
77
+ "@inquirer/input": "^5.1.2",
78
+ "@inquirer/prompts": "^8.5.2",
79
+ "listr2": "11.1.0"
76
80
  },
77
81
  "peerDependencies": {
78
- "enquirer": ">= 2.3.0 < 3"
82
+ "@inquirer/prompts": ">= 3 < 9",
83
+ "listr2": "11.1.0"
79
84
  }
80
85
  }
@@ -200,7 +200,21 @@ Scroll display down one line.
200
200
  export const scrollDown: string;
201
201
 
202
202
  /**
203
- Clear the terminal screen. (Viewport)
203
+ Clear only the visible terminal screen (viewport) without affecting scrollback buffer or terminal state.
204
+
205
+ This is a safer alternative to `clearScreen` that works consistently across terminals.
206
+ */
207
+ export const clearViewport: string;
208
+
209
+ /**
210
+ Clear the terminal screen.
211
+
212
+ ⚠️ **Warning:** Uses RIS (Reset to Initial State) which may also:
213
+ - Clear scrollback buffer in some terminals (xterm.js, VTE)
214
+ - Reset terminal modes and state
215
+ - Not behave consistently across different terminals
216
+
217
+ Consider using `clearViewport` for safer viewport-only clearing.
204
218
  */
205
219
  export const clearScreen: string;
206
220
 
@@ -219,6 +233,21 @@ Exit the [alternative screen](https://terminalguide.namepad.de/mode/p47/), assum
219
233
  */
220
234
  export const exitAlternativeScreen: string;
221
235
 
236
+ /**
237
+ Begin [synchronized output](https://contour-terminal.org/vt-extensions/synchronized-output/) to reduce flicker during renders.
238
+ */
239
+ export const beginSynchronizedOutput: string;
240
+
241
+ /**
242
+ End [synchronized output](https://contour-terminal.org/vt-extensions/synchronized-output/).
243
+ */
244
+ export const endSynchronizedOutput: string;
245
+
246
+ /**
247
+ Wrap output in [synchronized output](https://contour-terminal.org/vt-extensions/synchronized-output/) sequences to reduce flicker during renders.
248
+ */
249
+ export function synchronizedOutput(text: string): string;
250
+
222
251
  /**
223
252
  Output a beeping sound.
224
253
  */
@@ -246,7 +275,7 @@ export const iTerm: {
246
275
 
247
276
  @param cwd - Current directory. Default: `process.cwd()`.
248
277
  */
249
- setCwd(cwd?: string): string,
278
+ setCwd(cwd?: string): string;
250
279
 
251
280
  /**
252
281
  An annotation looks like this when shown:
@@ -258,5 +287,21 @@ export const iTerm: {
258
287
  @param message - The message to display within the annotation. The `|` character is disallowed and will be stripped.
259
288
  @returns An escape code which will create an annotation when printed in iTerm2.
260
289
  */
261
- annotation(message: string, options?: AnnotationOptions): string
290
+ annotation(message: string, options?: AnnotationOptions): string;
291
+ };
292
+
293
+ export const ConEmu: {
294
+ /**
295
+ [Inform ConEmu](https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC) about shell current working directory.
296
+
297
+ @param cwd - Current directory. Default: `process.cwd()`.
298
+ */
299
+ setCwd(cwd?: string): string;
262
300
  };
301
+
302
+ /**
303
+ Set the current working directory for both iTerm2 and ConEmu.
304
+
305
+ @param cwd - Current directory. Default: `process.cwd()`.
306
+ */
307
+ export function setCwd(cwd?: string): string;