diff --git a/package.json b/package.json index a934eb508708..98e7d3a89053 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "jest": "29.7.0", "jscodeshift": "17.0.0", "lerna": "8.1.9", - "listr2": "6.6.1", + "listr2": "7.0.2", "make-dir-cli": "4.0.0", "msw": "1.3.4", "ncp": "2.0.0", diff --git a/packages/cli-helpers/package.json b/packages/cli-helpers/package.json index aa12f613dc8b..5ea781262c8b 100644 --- a/packages/cli-helpers/package.json +++ b/packages/cli-helpers/package.json @@ -62,7 +62,7 @@ "dotenv": "16.4.7", "dotenv-defaults": "5.0.2", "execa": "5.1.1", - "listr2": "6.6.1", + "listr2": "7.0.2", "lodash": "4.17.21", "pascalcase": "1.0.0", "prettier": "3.4.2", diff --git a/packages/cli-helpers/src/auth/authTasks.ts b/packages/cli-helpers/src/auth/authTasks.ts index b81e3122570b..b27a1871b049 100644 --- a/packages/cli-helpers/src/auth/authTasks.ts +++ b/packages/cli-helpers/src/auth/authTasks.ts @@ -1,6 +1,7 @@ import fs from 'fs' import path from 'path' +import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer' import type { ListrRenderer, ListrTask, ListrTaskWrapper } from 'listr2' import { getConfig, resolveFile } from '@redwoodjs/project-config' @@ -467,7 +468,8 @@ export const generateAuthApiFiles = ( // Confirm that we're about to overwrite some files const filesToOverwrite = findExistingFiles(filesRecord) - const overwrite = await task.prompt({ + const prompt = task.prompt(ListrEnquirerPromptAdapter) + const overwrite = await prompt.run({ type: 'confirm', message: `Overwrite existing ${filesToOverwrite.join(', ')}?`, initial: false, @@ -492,22 +494,24 @@ export const generateAuthApiFiles = ( }, } } -/** - * Returns a map of file names (not full paths) that already exist - */ + +/** Returns a map of file names (not full paths) that already exist */ function findExistingFiles(filesMap: Record) { return Object.keys(filesMap) .filter((filePath) => fs.existsSync(filePath)) .map((filePath) => filePath.replace(getPaths().base, '')) } -export const addAuthConfigToGqlApi = ( +export const addAuthConfigToGqlApi = < + Renderer extends typeof ListrRenderer, + FallbackRenderer extends typeof ListrRenderer, +>( authDecoderImport?: string, ) => ({ title: 'Adding auth config to GraphQL API...', task: ( ctx: AuthGeneratorCtx, - _task: ListrTaskWrapper, + _task: ListrTaskWrapper, ) => { if (graphFunctionDoesExist()) { addApiConfig({ @@ -535,14 +539,17 @@ export interface AuthGeneratorCtx { force: boolean } -export const setAuthSetupMode = ( +export const setAuthSetupMode = < + Renderer extends typeof ListrRenderer, + FallbackRenderer extends typeof ListrRenderer, +>( force: boolean, ) => { return { title: 'Checking project for existing auth...', task: async ( ctx: AuthGeneratorCtx, - task: ListrTaskWrapper, + task: ListrTaskWrapper, ) => { if (force) { ctx.setupMode = 'FORCE' diff --git a/packages/cli-helpers/src/lib/index.ts b/packages/cli-helpers/src/lib/index.ts index e9232e5bb5bb..3fd0158173f0 100644 --- a/packages/cli-helpers/src/lib/index.ts +++ b/packages/cli-helpers/src/lib/index.ts @@ -106,8 +106,9 @@ export const writeFile = ( { existingFiles = 'FAIL' }: { existingFiles?: ExistingFiles } = {}, // TODO: Remove type cast by finding all places `writeFile` is used and // making sure a proper task is passed in - task: ListrTaskWrapper = {} as ListrTaskWrapper< + task: ListrTaskWrapper = {} as ListrTaskWrapper< never, + Renderer, Renderer >, ) => { @@ -152,6 +153,7 @@ export const writeFilesTask = ( _ctx: never, task: ListrTaskWrapper< never, + ListrGetRendererClassFromValue, ListrGetRendererClassFromValue >, ) => { diff --git a/packages/cli-packages/dataMigrate/package.json b/packages/cli-packages/dataMigrate/package.json index 346e5660199d..12eead2cd5db 100644 --- a/packages/cli-packages/dataMigrate/package.json +++ b/packages/cli-packages/dataMigrate/package.json @@ -31,7 +31,7 @@ "dotenv-defaults": "5.0.2", "execa": "5.1.1", "fs-extra": "11.2.0", - "listr2": "6.6.1", + "listr2": "7.0.2", "terminal-link": "2.1.1", "yargs": "17.7.2" }, diff --git a/packages/cli/package.json b/packages/cli/package.json index e03b6da87036..9a1fbfb17d8d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -28,6 +28,7 @@ }, "dependencies": { "@babel/runtime-corejs3": "7.25.7", + "@listr2/prompt-adapter-enquirer": "2.0.12", "@opentelemetry/api": "1.8.0", "@opentelemetry/core": "1.22.0", "@opentelemetry/exporter-trace-otlp-http": "0.49.1", @@ -64,7 +65,7 @@ "humanize-string": "2.1.0", "jscodeshift": "17.0.0", "latest-version": "5.1.0", - "listr2": "6.6.1", + "listr2": "7.0.2", "lodash": "4.17.21", "pascalcase": "1.0.0", "pluralize": "8.0.0", diff --git a/packages/cli/src/__tests__/Listr2Mock.ts b/packages/cli/src/__tests__/Listr2Mock.ts index 805b93a6e969..28fb3f03d375 100644 --- a/packages/cli/src/__tests__/Listr2Mock.ts +++ b/packages/cli/src/__tests__/Listr2Mock.ts @@ -3,12 +3,13 @@ import type * as Listr from 'listr2' import type { vi } from 'vitest' type Ctx = Record +type TRenderer = typeof Listr.ListrRenderer type EnquirerPromptOptions = Parameters[0] type Function = { length: number; name: string } type PlainPromptOptions = ReturnType> type ListrPromptOptions = Parameters< - Listr.ListrTaskWrapper['prompt'] + Listr.ListrTaskWrapper['prompt'] >[0] function isSupportedOptionsType( @@ -25,7 +26,7 @@ function isSupportedOptionsType( } class Listr2TaskWrapper { - task: Listr.ListrTask + task: Listr.ListrTask promptOutput: string // This is part of Listr.TaskWrapper, but we don't need it @@ -36,7 +37,7 @@ class Listr2TaskWrapper { task, options, }: { - task: Listr.ListrTask + task: Listr.ListrTask options?: Record | undefined }) { this.task = task @@ -75,56 +76,65 @@ class Listr2TaskWrapper { ctx, // TODO: fix this by removing the type casts. // The reason we have to do this is because of private fields in - // Listr.ListrTaskWrapper + // Listr.ListrTaskWrapper (this was at least the case for Listr2 v6) task as unknown as Listr.ListrTaskWrapper< Ctx, + typeof Listr.ListrRenderer, typeof Listr.ListrRenderer >, ) } - async prompt(options: ListrPromptOptions) { - const enquirer = Listr2Mock.mockPrompt - ? { prompt: Listr2Mock.mockPrompt } - : this.listrOptions?.injectWrapper?.enquirer + public prompt(..._args: any[]) { + const ctxEnquirer = this.listrOptions?.ctx?.enquirer - if (!enquirer) { - throw new Error('Enquirer instance not available') - } - - if (!isSupportedOptionsType(options)) { - console.error('Unsupported prompt options', options) - throw new Error('Unsupported prompt options type') - } + const run = async (options: ListrPromptOptions) => { + const enquirer = Listr2Mock.mockPrompt + ? { prompt: Listr2Mock.mockPrompt } + : ctxEnquirer - const enquirerOptions = !Array.isArray(options) - ? [{ ...options, name: 'default' }] - : options + if (!enquirer) { + throw new Error('Enquirer instance not available') + } - if (enquirerOptions.length === 1) { - enquirerOptions[0].name = 'default' - } + if (!isSupportedOptionsType(options)) { + console.error('Unsupported prompt options', options) + throw new Error('Unsupported prompt options type') + } - const response = await enquirer.prompt(enquirerOptions) + const enquirerOptions = !Array.isArray(options) + ? [{ ...options, name: 'default' }] + : options - if (enquirerOptions.length === 1) { - if (typeof response !== 'object') { - throw new Error( - 'Expected an object response from prompt().\n' + - 'Make sure you\'re returning `{ default: "value" }` if you\'re ' + - 'mocking the prompt return value', - ) + if (enquirerOptions.length === 1) { + enquirerOptions[0].name = 'default' } - if ('default' in response) { - // The type cast here isn't great. But Listr2 itself also type cast - // the response (but they cast it to `any`) - // https://github.com/listr2/listr2/blob/b4f544ebce9582f56b2b42fdbe834d70678ce966/packages/prompt-adapter-enquirer/src/prompt.ts#L74 - return response.default as T + const response = await enquirer.prompt(enquirerOptions) + + if (enquirerOptions.length === 1) { + if (typeof response !== 'object') { + throw new Error( + 'Expected an object response from prompt().\n' + + 'Make sure you\'re returning `{ default: "value" }` if you\'re ' + + 'mocking the prompt return value', + ) + } + + if ('default' in response) { + // The type cast here isn't great. But Listr2 itself also type cast + // the response (but they cast it to `any`) + // https://github.com/listr2/listr2/blob/b4f544ebce9582f56b2b42fdbe834d70678ce966/packages/prompt-adapter-enquirer/src/prompt.ts#L74 + return response.default as T + } } + + return response } - return response + return { + run, + } } skip(msg: string) { @@ -151,13 +161,16 @@ export class Listr2Mock { tasks: Listr.ListrTask[], options?: Listr.ListrOptions, ) { - this.ctx = {} + this.ctx = options?.ctx || {} this.tasks = tasks.map((task) => new Listr2TaskWrapper({ task, options })) } - async run() { - Listr2Mock.executedTaskTitles = [] - Listr2Mock.skippedTaskTitles = [] + async run( + executedTaskTitles: string[] = [], + skippedTaskTitles: string[] = [], + ) { + Listr2Mock.executedTaskTitles = executedTaskTitles + Listr2Mock.skippedTaskTitles = skippedTaskTitles for (const task of this.tasks) { const skip = @@ -178,7 +191,14 @@ export class Listr2Mock { continue } - await task.run(this.ctx, task) + const runReturnValue = await task.run(this.ctx, task) + + if (runReturnValue instanceof Listr2Mock) { + await runReturnValue.run( + Listr2Mock.executedTaskTitles, + Listr2Mock.skippedTaskTitles, + ) + } // storing the title after running the task in case the task // modifies its own title diff --git a/packages/cli/src/commands/experimental/setupOpentelemetryHandler.js b/packages/cli/src/commands/experimental/setupOpentelemetryHandler.js index 88885f472fcb..bf95532bfdc0 100644 --- a/packages/cli/src/commands/experimental/setupOpentelemetryHandler.js +++ b/packages/cli/src/commands/experimental/setupOpentelemetryHandler.js @@ -1,5 +1,6 @@ import path from 'path' +import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer' import execa from 'execa' import fs from 'fs-extra' import { Listr } from 'listr2' @@ -103,7 +104,7 @@ export const handler = async ({ force, verbose }) => { )}`, ].join('\n') }, - options: { persistentOutput: true }, + rendererOptions: { persistentOutput: true }, }, { title: 'Notice: GraphQL function update (server file)...', @@ -126,7 +127,7 @@ export const handler = async ({ force, verbose }) => { )}`, ].join('\n') }, - options: { persistentOutput: true }, + rendererOptions: { persistentOutput: true }, }, addApiPackages(opentelemetryPackages), ] @@ -193,7 +194,8 @@ export const handler = async ({ force, verbose }) => { { title: 'Confirmation', task: async (_ctx, task) => { - const confirmation = await task.prompt({ + const prompt = task.prompt(ListrEnquirerPromptAdapter) + const confirmation = await prompt.run({ type: 'Confirm', message: 'OpenTelemetry support is experimental. Continue?', }) diff --git a/packages/cli/src/commands/experimental/setupReactCompilerHandler.js b/packages/cli/src/commands/experimental/setupReactCompilerHandler.js index 61cf4bd26fd1..f117184cda7b 100644 --- a/packages/cli/src/commands/experimental/setupReactCompilerHandler.js +++ b/packages/cli/src/commands/experimental/setupReactCompilerHandler.js @@ -84,7 +84,7 @@ export const handler = async ({ force, verbose }) => { } } }, - options: { persistentOutput: true }, + rendererOptions: { persistentOutput: true }, }, // We are using two different yarn commands here which is fine because they're operating on different // workspaces - web and the root diff --git a/packages/cli/src/commands/experimental/setupRscHandler.js b/packages/cli/src/commands/experimental/setupRscHandler.js index 89dd58196971..c7d5e59eb479 100644 --- a/packages/cli/src/commands/experimental/setupRscHandler.js +++ b/packages/cli/src/commands/experimental/setupRscHandler.js @@ -76,7 +76,7 @@ export const handler = async ({ force, verbose }) => { } } }, - options: { persistentOutput: true }, + rendererOptions: { persistentOutput: true }, }, { title: `Overwriting entry.client${ext}...`, diff --git a/packages/cli/src/commands/experimental/setupStreamingSsrHandler.js b/packages/cli/src/commands/experimental/setupStreamingSsrHandler.js index da38fc3858b1..c85bdd7401d2 100644 --- a/packages/cli/src/commands/experimental/setupStreamingSsrHandler.js +++ b/packages/cli/src/commands/experimental/setupStreamingSsrHandler.js @@ -1,5 +1,6 @@ import path from 'path' +import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer' import fs from 'fs-extra' import { Listr } from 'listr2' @@ -72,7 +73,7 @@ export const handler = async ({ force, verbose }) => { } } }, - options: { persistentOutput: true }, + rendererOptions: { persistentOutput: true }, }, { title: `Adding entry.client${ext}...`, @@ -94,7 +95,8 @@ export const handler = async ({ force, verbose }) => { let overwriteExisting = force if (!force) { - overwriteExisting = await task.prompt({ + const prompt = task.prompt(ListrEnquirerPromptAdapter) + overwriteExisting = await prompt.run({ type: 'Confirm', message: `Overwrite ${entryClientPath}?`, }) @@ -109,7 +111,7 @@ export const handler = async ({ force, verbose }) => { writeFile(entryClientPath, entryClientContent, { overwriteExisting }) }, - options: { persistentOutput: true }, + rendererOptions: { persistentOutput: true }, }, { title: `Adding entry.server${ext}...`, diff --git a/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.mockListr.test.js b/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.mockListr.test.js index 4f1ee5f52348..d322f76766bf 100644 --- a/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.mockListr.test.js +++ b/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.mockListr.test.js @@ -100,11 +100,16 @@ describe('dbAuth handler WebAuthn task title', () => { }) await dbAuth.handler({ + usernameLabel: 'email', + passwordLabel: 'password', enquirer: customEnquirer, listr2: { silentRendererCondition: true }, }) - expect(Listr2Mock.executedTaskTitles[1]).toEqual( + const taskTitles = Listr2Mock.executedTaskTitles + console.log('taskTitles', taskTitles) + + expect(Listr2Mock.executedTaskTitles[0]).toEqual( 'Querying WebAuthn addition: WebAuthn addition included', ) }) @@ -193,9 +198,11 @@ export const { AuthProvider, useAuth } = createAuth(dbAuthClient) await dbAuth.handler({ enquirer: customEnquirer, listr2: { silentRendererCondition: true }, + usernameLabel: 'email', + passwordLabel: 'password', }) - expect(Listr2Mock.executedTaskTitles[1]).toEqual( + expect(Listr2Mock.executedTaskTitles[0]).toEqual( 'Querying WebAuthn addition: WebAuthn addition not included', ) }) @@ -210,9 +217,11 @@ export const { AuthProvider, useAuth } = createAuth(dbAuthClient) enquirer: customEnquirer, listr2: { silentRendererCondition: true }, webauthn: true, + usernameLabel: 'email', + passwordLabel: 'password', }) - expect(Listr2Mock.skippedTaskTitles[0]).toEqual( + expect(Listr2Mock.skippedTaskTitles[1]).toEqual( 'Querying WebAuthn addition: argument webauthn passed, WebAuthn included', ) }) @@ -227,9 +236,11 @@ export const { AuthProvider, useAuth } = createAuth(dbAuthClient) enquirer: customEnquirer, listr2: { silentRendererCondition: true }, webauthn: false, + usernameLabel: 'email', + passwordLabel: 'password', }) - expect(Listr2Mock.skippedTaskTitles[0]).toEqual( + expect(Listr2Mock.skippedTaskTitles[1]).toEqual( 'Querying WebAuthn addition: argument webauthn passed, WebAuthn not included', ) }) diff --git a/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.test.js b/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.test.js index 58434f79c248..4aa4268c34ee 100644 --- a/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.test.js +++ b/packages/cli/src/commands/generate/dbAuth/__tests__/dbAuth.test.js @@ -129,7 +129,7 @@ describe('dbAuth', () => { mockConsoleInfo.mockRestore() }) - it('prompt for username label', async () => { + it('prompts for username label', async () => { let correctPrompt = false const customEnquirer = new Enquirer({ show: false }) @@ -166,7 +166,7 @@ describe('dbAuth', () => { expect(correctPrompt).toBe(false) }) - it('prompt for password label', async () => { + it('prompts for password label', async () => { let correctPrompt = false const customEnquirer = new Enquirer({ show: false }) diff --git a/packages/cli/src/commands/generate/dbAuth/dbAuth.js b/packages/cli/src/commands/generate/dbAuth/dbAuth.js index 58ebfbf18600..1057e458ec0f 100644 --- a/packages/cli/src/commands/generate/dbAuth/dbAuth.js +++ b/packages/cli/src/commands/generate/dbAuth/dbAuth.js @@ -1,7 +1,7 @@ import path from 'path' +import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer' import { camelCase } from 'camel-case' -import Enquirer from 'enquirer' import execa from 'execa' import fs from 'fs-extra' import { Listr } from 'listr2' @@ -273,47 +273,60 @@ const tasks = ({ { title: 'Determining UI labels...', skip: () => { - return usernameLabel && passwordLabel + return !!(usernameLabel && passwordLabel) }, task: async (ctx, task) => { - return task.newListr([ - { - title: 'Username label', - task: async (subctx, subtask) => { - if (usernameLabel) { - subtask.skip( - `Argument username-label is set, using: "${usernameLabel}"`, + return task.newListr( + [ + { + title: 'Username label', + task: async (subCtx, subtask) => { + if (usernameLabel) { + subtask.skip( + `Argument username-label is set, using: "${usernameLabel}"`, + ) + return + } + + const prompt = subtask.prompt(ListrEnquirerPromptAdapter) + usernameLabel = await prompt.run( + { + type: 'input', + name: 'username', + message: 'What would you like the username label to be:', + default: 'Username', + }, + { enquirer: subCtx.enquirer || ctx.enquirer }, ) - return - } - usernameLabel = await subtask.prompt({ - type: 'input', - name: 'username', - message: 'What would you like the username label to be:', - default: 'Username', - }) - subtask.title = `Username label: "${usernameLabel}"` + subtask.title = `Username label: "${usernameLabel}"` + }, }, - }, - { - title: 'Password label', - task: async (subctx, subtask) => { - if (passwordLabel) { - subtask.skip( - `Argument password-label passed, using: "${passwordLabel}"`, + { + title: 'Password label', + task: async (subCtx, subtask) => { + if (passwordLabel) { + subtask.skip( + `Argument password-label passed, using: "${passwordLabel}"`, + ) + return + } + + const prompt = subtask.prompt(ListrEnquirerPromptAdapter) + passwordLabel = await prompt.run( + { + type: 'input', + name: 'password', + message: 'What would you like the password label to be:', + default: 'Password', + }, + { enquirer: subCtx.enquirer || ctx.enquirer }, ) - return - } - passwordLabel = await subtask.prompt({ - type: 'input', - name: 'password', - message: 'What would you like the password label to be:', - default: 'Password', - }) - subtask.title = `Password label: "${passwordLabel}"` + subtask.title = `Password label: "${passwordLabel}"` + }, }, - }, - ]) + ], + { ctx: { enquirer } }, + ) }, }, { @@ -353,12 +366,18 @@ const tasks = ({ return } - const response = await task.prompt({ - type: 'confirm', - name: 'answer', - message: `Enable WebAuthn support (TouchID/FaceID) on LoginPage? See https://redwoodjs.com/docs/auth/dbAuth#webAuthn`, - default: false, - }) + const prompt = task.prompt(ListrEnquirerPromptAdapter) + const response = await prompt.run( + { + type: 'confirm', + name: 'answer', + message: + 'Enable WebAuthn support (TouchID/FaceID) on LoginPage? See ' + + 'https://redwoodjs.com/docs/auth/dbAuth#webAuthn', + default: false, + }, + { enquirer: ctx.enquirer }, + ) ctx.webauthn = webauthn = response @@ -415,7 +434,7 @@ const tasks = ({ { silentRendererCondition: () => listr2?.silentRendererCondition, rendererOptions: { collapseSubtasks: false }, - injectWrapper: { enquirer: enquirer || new Enquirer() }, + ctx: { enquirer }, exitOnError: true, }, ) diff --git a/packages/cli/src/commands/setup/ui/libraries/chakra-ui.js b/packages/cli/src/commands/setup/ui/libraries/chakra-ui.js index 05a999ec0ec8..12f0897a267f 100644 --- a/packages/cli/src/commands/setup/ui/libraries/chakra-ui.js +++ b/packages/cli/src/commands/setup/ui/libraries/chakra-ui.js @@ -51,7 +51,7 @@ export async function handler({ force, install }) { '@chakra-ui/react@^2', '@emotion/react@^11', '@emotion/styled@^11', - 'framer-motion@^9', + 'framer-motion@^11', ] const tasks = new Listr( diff --git a/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js b/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js index 710463d8e6f9..e8ce95182058 100644 --- a/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js +++ b/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js @@ -1,5 +1,6 @@ import path from 'path' +import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer' import execa from 'execa' import fs from 'fs-extra' import { outputFileSync } from 'fs-extra' @@ -252,9 +253,10 @@ export const handler = async ({ force, install }) => { ) }, task: async (_ctx, task) => { + const prompt = task.prompt(ListrEnquirerPromptAdapter) const overrideScaffoldCss = force || - (await task.prompt({ + (await prompt.run({ type: 'Confirm', message: "Do you want to override your 'scaffold.css' to use tailwind classes?", diff --git a/packages/cli/src/commands/upgrade.js b/packages/cli/src/commands/upgrade.js index c628fce0c939..01bdda293c26 100644 --- a/packages/cli/src/commands/upgrade.js +++ b/packages/cli/src/commands/upgrade.js @@ -1,5 +1,6 @@ import path from 'path' +import { ListrEnquirerPromptAdapter } from '@listr2/prompt-adapter-enquirer' import execa from 'execa' import fs from 'fs-extra' import latestVersion from 'latest-version' @@ -112,7 +113,8 @@ export const handler = async ({ dryRun, tag, verbose, dedupe, yes }) => { return } - const proceed = await task.prompt({ + const prompt = task.prompt(ListrEnquirerPromptAdapter) + const proceed = await prompt.run({ type: 'Confirm', message: 'This will upgrade your RedwoodJS project to the latest version. Do you want to proceed?', @@ -126,6 +128,7 @@ export const handler = async ({ dryRun, tag, verbose, dedupe, yes }) => { return 'Yes' }, }) + if (!proceed) { task.skip('Upgrade cancelled by user.') process.exit(0) diff --git a/yarn.lock b/yarn.lock index 74a0c0310cc1..0ce8e331b8b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5575,6 +5575,15 @@ __metadata: languageName: node linkType: hard +"@listr2/prompt-adapter-enquirer@npm:2.0.12": + version: 2.0.12 + resolution: "@listr2/prompt-adapter-enquirer@npm:2.0.12" + peerDependencies: + enquirer: ">= 2.3.0 < 3" + checksum: 10c0/53bfaac3b71560f009d94dfb107ed00fb9ea36d17ab1ae57680f330f88656e8a836839bb8cdc85478b4e173fb4d9b863097ab1b5d5912d6f0c6cc906cc311606 + languageName: node + linkType: hard + "@lukeed/ms@npm:^2.0.1": version: 2.0.1 resolution: "@lukeed/ms@npm:2.0.1" @@ -8057,7 +8066,7 @@ __metadata: execa: "npm:5.1.1" fs-extra: "npm:11.2.0" jest: "npm:29.7.0" - listr2: "npm:6.6.1" + listr2: "npm:7.0.2" memfs: "npm:4.15.1" terminal-link: "npm:2.1.1" tsx: "npm:4.19.2" @@ -8087,7 +8096,7 @@ __metadata: dotenv: "npm:16.4.7" dotenv-defaults: "npm:5.0.2" execa: "npm:5.1.1" - listr2: "npm:6.6.1" + listr2: "npm:7.0.2" lodash: "npm:4.17.21" pascalcase: "npm:1.0.0" prettier: "npm:3.4.2" @@ -8130,6 +8139,7 @@ __metadata: "@babel/cli": "npm:7.25.7" "@babel/core": "npm:^7.22.20" "@babel/runtime-corejs3": "npm:7.25.7" + "@listr2/prompt-adapter-enquirer": "npm:2.0.12" "@opentelemetry/api": "npm:1.8.0" "@opentelemetry/core": "npm:1.22.0" "@opentelemetry/exporter-trace-otlp-http": "npm:0.49.1" @@ -8167,7 +8177,7 @@ __metadata: humanize-string: "npm:2.1.0" jscodeshift: "npm:17.0.0" latest-version: "npm:5.1.0" - listr2: "npm:6.6.1" + listr2: "npm:7.0.2" lodash: "npm:4.17.21" memfs: "npm:4.15.1" pascalcase: "npm:1.0.0" @@ -21820,9 +21830,9 @@ __metadata: languageName: node linkType: hard -"listr2@npm:6.6.1": - version: 6.6.1 - resolution: "listr2@npm:6.6.1" +"listr2@npm:7.0.2": + version: 7.0.2 + resolution: "listr2@npm:7.0.2" dependencies: cli-truncate: "npm:^3.1.0" colorette: "npm:^2.0.20" @@ -21830,12 +21840,7 @@ __metadata: log-update: "npm:^5.0.1" rfdc: "npm:^1.3.0" wrap-ansi: "npm:^8.1.0" - peerDependencies: - enquirer: ">= 2.3.0 < 3" - peerDependenciesMeta: - enquirer: - optional: true - checksum: 10c0/2abfcd4346b8208e8d406cfe7a058cd10e3238f60de1ee53fa108a507b45b853ceb87e0d1d4ff229bbf6dd6e896262352e0c7a8895b8511cd55fe94304d3921e + checksum: 10c0/37b6501be84ebea66dcce07c5f86c224aff0c01c9fb43f5055cc38a063030281d58198aad0aad481f174438309831ddf5f763b890e820cd7b7b4f4a5dfa229c9 languageName: node linkType: hard @@ -26977,7 +26982,7 @@ __metadata: jest: "npm:29.7.0" jscodeshift: "npm:17.0.0" lerna: "npm:8.1.9" - listr2: "npm:6.6.1" + listr2: "npm:7.0.2" make-dir-cli: "npm:4.0.0" msw: "npm:1.3.4" ncp: "npm:2.0.0"