diff --git a/lib/update-v8/applyNodeChanges.js b/lib/update-v8/applyNodeChanges.js index 3dbfd246..806e1d25 100644 --- a/lib/update-v8/applyNodeChanges.js +++ b/lib/update-v8/applyNodeChanges.js @@ -1,6 +1,5 @@ import path from 'node:path'; -import Enquirer from 'enquirer'; import { Listr } from 'listr2'; import { @@ -23,11 +22,7 @@ export default function applyNodeChanges() { task: async(ctx) => { const v8Version = await getNodeV8Version(ctx.nodeDir); const list = filterForVersion(nodeChanges, v8Version); - return new Listr(list.map((change) => change.task()), { - injectWrapper: { - enquirer: new Enquirer() - } - }); + return new Listr(list.map((change) => change.task())); } }; } diff --git a/lib/update-v8/backport.js b/lib/update-v8/backport.js index 3a596466..c57095cd 100644 --- a/lib/update-v8/backport.js +++ b/lib/update-v8/backport.js @@ -3,9 +3,9 @@ import { promises as fs } from 'node:fs'; -import Enquirer from 'enquirer'; import inquirer from 'inquirer'; import { Listr } from 'listr2'; +import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer'; import { shortSha } from '../utils.js'; @@ -51,11 +51,7 @@ export function doBackport(options) { return { title: 'V8 commit backport', task: () => { - return new Listr(todo, { - injectWrapper: { - enquirer: new Enquirer() - } - }); + return new Listr(todo); } }; }; @@ -169,11 +165,7 @@ function applyAndCommitPatches() { return { title: 'Apply and commit patches to deps/v8', task: (ctx) => { - return new Listr(ctx.patches.map(applyPatchTask), { - injectWrapper: { - enquirer: new Enquirer() - } - }); + return new Listr(ctx.patches.map(applyPatchTask)); } }; } @@ -196,11 +188,7 @@ function applyPatchTask(patch) { } } todo.push(commitPatch(patch)); - return new Listr(todo, { - injectWrapper: { - enquirer: new Enquirer() - } - }); + return new Listr(todo); } }; } @@ -214,7 +202,7 @@ async function applyPatch(ctx, task, patch) { ); } catch (e) { patch.hadConflicts = true; - return task.prompt({ + return task.prompt(ListrEnquirerPromptAdapter).run({ type: 'input', message: "Resolve merge conflicts and enter 'RESOLVED'", validate: value => value.toUpperCase() === 'RESOLVED' diff --git a/lib/update-v8/index.js b/lib/update-v8/index.js index a8583691..7b875378 100644 --- a/lib/update-v8/index.js +++ b/lib/update-v8/index.js @@ -1,4 +1,3 @@ -import Enquirer from 'enquirer'; import { Listr } from 'listr2'; import { checkOptions, doBackport } from './backport.js'; @@ -48,9 +47,6 @@ export async function backport(options) { */ function getOptions(opts) { return { - renderer: opts.verbose ? 'verbose' : 'default', - injectWrapper: { - enquirer: new Enquirer() - } + renderer: opts.verbose ? 'verbose' : 'default' }; } diff --git a/lib/update-v8/majorUpdate.js b/lib/update-v8/majorUpdate.js index 9a6fe036..47c3f3ac 100644 --- a/lib/update-v8/majorUpdate.js +++ b/lib/update-v8/majorUpdate.js @@ -1,7 +1,6 @@ import path from 'node:path'; import { promises as fs } from 'node:fs'; -import Enquirer from 'enquirer'; import { Listr } from 'listr2'; import { getCurrentV8Version } from './common.js'; @@ -30,11 +29,7 @@ export default function majorUpdate() { addDepsV8(), updateV8Deps(), applyNodeChanges() - ], { - injectWrapper: { - enquirer: new Enquirer() - } - }); + ]); } }; }; diff --git a/lib/update-v8/minorUpdate.js b/lib/update-v8/minorUpdate.js index 3f797784..a71d05f2 100644 --- a/lib/update-v8/minorUpdate.js +++ b/lib/update-v8/minorUpdate.js @@ -2,7 +2,6 @@ import { spawn } from 'node:child_process'; import path from 'node:path'; import { promises as fs } from 'node:fs'; -import Enquirer from 'enquirer'; import { Listr } from 'listr2'; import { getCurrentV8Version } from './common.js'; @@ -17,11 +16,7 @@ export default function minorUpdate() { getCurrentV8Version(), getLatestV8Version(), doMinorUpdate() - ], { - injectWrapper: { - enquirer: new Enquirer() - } - }); + ]); } }; }; diff --git a/lib/update-v8/updateV8Clone.js b/lib/update-v8/updateV8Clone.js index 640110a7..64153035 100644 --- a/lib/update-v8/updateV8Clone.js +++ b/lib/update-v8/updateV8Clone.js @@ -1,6 +1,5 @@ import { promises as fs } from 'node:fs'; -import Enquirer from 'enquirer'; import { Listr } from 'listr2'; import { v8Git } from './constants.js'; @@ -10,11 +9,7 @@ export default function updateV8Clone() { return { title: 'Update local V8 clone', task: () => { - return new Listr([fetchOrigin(), createClone()], { - injectWrapper: { - enquirer: new Enquirer() - } - }); + return new Listr([fetchOrigin(), createClone()]); } }; }; diff --git a/lib/update-v8/updateVersionNumbers.js b/lib/update-v8/updateVersionNumbers.js index abbe6b45..5c832e08 100644 --- a/lib/update-v8/updateVersionNumbers.js +++ b/lib/update-v8/updateVersionNumbers.js @@ -1,7 +1,6 @@ import path from 'node:path'; import { promises as fs } from 'node:fs'; -import Enquirer from 'enquirer'; import { Listr } from 'listr2'; import { getNodeV8Version } from './util.js'; @@ -10,11 +9,7 @@ export default function updateVersionNumbers() { return { title: 'Update version numbers', task: () => { - return new Listr([resetEmbedderString(), bumpNodeModule()], { - injectWrapper: { - enquirer: new Enquirer() - } - }); + return new Listr([resetEmbedderString(), bumpNodeModule()]); } }; }; diff --git a/package.json b/package.json index de33aaed..baf0b853 100644 --- a/package.json +++ b/package.json @@ -34,36 +34,36 @@ ], "license": "MIT", "dependencies": { + "@listr2/prompt-adapter-enquirer": "^1.0.1", "@node-core/caritat": "^1.2.0", + "@pkgjs/nv": "^0.2.1", "branch-diff": "^2.1.4", "chalk": "^5.3.0", "changelog-maker": "^3.2.4", - "@pkgjs/nv": "^0.2.1", "cheerio": "^1.0.0-rc.12", "clipboardy": "^3.0.0", "core-validate-commit": "^4.0.0", - "enquirer": "^2.4.1", "figures": "^5.0.0", "ghauth": "^5.0.1", - "inquirer": "^9.2.10", + "inquirer": "^9.2.11", "js-yaml": "^4.1.0", - "listr2": "^6.6.1", + "listr2": "^7.0.1", "lodash": "^4.17.21", "log-symbols": "^5.1.0", "ora": "^7.0.1", "replace-in-file": "^7.0.1", - "undici": "^5.23.0", - "which": "^3.0.1", + "undici": "^5.25.2", + "which": "^4.0.0", "yargs": "^17.7.2" }, "devDependencies": { "@reporters/github": "^1.5.2", "c8": "^8.0.1", - "eslint": "^8.47.0", + "eslint": "^8.50.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.28.1", - "eslint-plugin-n": "^16.0.2", + "eslint-plugin-n": "^16.1.0", "eslint-plugin-promise": "^6.1.1", - "sinon": "^15.2.0" + "sinon": "^16.0.0" } }