From f43c7218ce88813a095620fc7647537def5c444c Mon Sep 17 00:00:00 2001 From: Mohammed Keyvanzadeh Date: Wed, 6 Nov 2024 03:30:37 +0330 Subject: [PATCH] chore: update dependencies (#860) - Replace the `inquirer` dependency with `@inquirer/prompts` as the former is now legacy. - Update the `log-symbols` dependency and the `sinon` development dependency to their new major versions. - Update all other dependencies & development dependencies to their latest versions. --- lib/cli.js | 8 +++----- lib/update-v8/backport.js | 8 +++----- package.json | 32 ++++++++++++++++---------------- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 3bca8682..8925fa65 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -1,6 +1,6 @@ import ora from 'ora'; import chalk from 'chalk'; -import inquirer from 'inquirer'; +import * as inquirer from '@inquirer/prompts'; import { warning, error, info, success } from './figures.js'; @@ -81,12 +81,10 @@ export default class CLI { return defaultAnswer; } - const { answer } = await inquirer.prompt([{ - type: questionType, - name: 'answer', + const answer = await inquirer[questionType]({ message: question, default: defaultAnswer - }]); + }); if (isSpinning) { this.spinner.start(spinningMessage); diff --git a/lib/update-v8/backport.js b/lib/update-v8/backport.js index 7f27430e..e3ff224e 100644 --- a/lib/update-v8/backport.js +++ b/lib/update-v8/backport.js @@ -3,7 +3,7 @@ import { promises as fs } from 'node:fs'; -import inquirer from 'inquirer'; +import { confirm } from '@inquirer/prompts'; import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer'; import { shortSha } from '../utils.js'; @@ -12,14 +12,12 @@ import { getCurrentV8Version } from './common.js'; export async function checkOptions(options) { if (options.sha.length > 1 && options.squash) { - const { wantSquash } = await inquirer.prompt([{ - type: 'confirm', - name: 'wantSquash', + const wantSquash = await confirm({ message: 'Squashing commits should be avoided if possible, because it ' + 'can make git bisection difficult. Only squash commits if they would ' + 'break the build when applied individually. Are you sure?', default: false - }]); + }); if (!wantSquash) { return true; diff --git a/package.json b/package.json index af489adb..f2be5296 100644 --- a/package.json +++ b/package.json @@ -34,36 +34,36 @@ ], "license": "MIT", "dependencies": { - "@listr2/prompt-adapter-enquirer": "^2.0.10", + "@inquirer/prompts": "^6.0.1", + "@listr2/prompt-adapter-enquirer": "^2.0.11", "@node-core/caritat": "^1.6.0", "@pkgjs/nv": "^0.2.2", - "branch-diff": "^3.0.4", + "branch-diff": "^3.1.1", "chalk": "^5.3.0", "changelog-maker": "^4.1.1", - "cheerio": "^1.0.0-rc.12", + "cheerio": "^1.0.0", "clipboardy": "^4.0.0", - "core-validate-commit": "^4.0.0", + "core-validate-commit": "^4.1.0", "figures": "^6.1.0", - "ghauth": "^6.0.5", - "inquirer": "^9.3.2", + "ghauth": "^6.0.7", "js-yaml": "^4.1.0", - "listr2": "^8.2.3", + "listr2": "^8.2.4", "lodash": "^4.17.21", - "log-symbols": "^6.0.0", - "ora": "^8.0.1", - "replace-in-file": "^8.0.2", - "undici": "^6.19.2", + "log-symbols": "^7.0.0", + "ora": "^8.1.0", + "replace-in-file": "^8.2.0", + "undici": "^6.19.8", "which": "^4.0.0", "yargs": "^17.7.2" }, "devDependencies": { - "@reporters/github": "^1.7.0", + "@reporters/github": "^1.7.1", "c8": "^10.1.2", - "eslint": "^8.57.0", + "eslint": "^8.57.1", "eslint-config-standard": "^17.1.0", - "eslint-plugin-import": "^2.29.1", + "eslint-plugin-import": "^2.30.0", "eslint-plugin-n": "^16.6.2", - "eslint-plugin-promise": "^6.4.0", - "sinon": "^18.0.0" + "eslint-plugin-promise": "^6.6.0", + "sinon": "^19.0.2" } }