diff --git a/packages/cli/package.json b/packages/cli/package.json
index 675f526b0abf..d078ae4c88db 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -49,8 +49,7 @@
"fast-glob": "3.2.12",
"fs-extra": "10.1.0",
"latest-version": "5.1.0",
- "listr": "0.14.3",
- "listr-verbose-renderer": "0.6.0",
+ "listr2": "5.0.5",
"lodash": "4.17.21",
"param-case": "3.0.4",
"pascalcase": "1.0.0",
diff --git a/packages/cli/src/commands/__tests__/build.test.js b/packages/cli/src/commands/__tests__/build.test.js
index 5876187abcc6..c9f09596aa8f 100644
--- a/packages/cli/src/commands/__tests__/build.test.js
+++ b/packages/cli/src/commands/__tests__/build.test.js
@@ -20,12 +20,8 @@ jest.mock('@redwoodjs/internal/dist/config', () => {
}
})
-import Listr from 'listr'
-jest.mock('listr', () => {
- return jest.fn().mockImplementation(function FakeListr() {
- return { run: jest.fn() }
- })
-})
+import { Listr } from 'listr2'
+jest.mock('listr2')
// Make sure prerender doesn't get triggered
jest.mock('execa', () =>
diff --git a/packages/cli/src/commands/buildHandler.js b/packages/cli/src/commands/buildHandler.js
index 1e9d9220563f..cb30e009f8b1 100644
--- a/packages/cli/src/commands/buildHandler.js
+++ b/packages/cli/src/commands/buildHandler.js
@@ -2,8 +2,7 @@ import fs from 'fs'
import path from 'path'
import execa from 'execa'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import rimraf from 'rimraf'
import terminalLink from 'terminal-link'
@@ -137,7 +136,7 @@ export const handler = async ({
}
const jobs = new Listr(tasks, {
- renderer: verbose && VerboseRenderer,
+ renderer: verbose && 'verbose',
})
try {
diff --git a/packages/cli/src/commands/dataMigrate/install.js b/packages/cli/src/commands/dataMigrate/install.js
index a19b3accf358..93ce796c9b8a 100644
--- a/packages/cli/src/commands/dataMigrate/install.js
+++ b/packages/cli/src/commands/dataMigrate/install.js
@@ -2,7 +2,7 @@ import path from 'path'
import execa from 'execa'
import fs from 'fs-extra'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -86,7 +86,7 @@ export const handler = async () => {
},
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
try {
diff --git a/packages/cli/src/commands/dataMigrate/up.js b/packages/cli/src/commands/dataMigrate/up.js
index 3983f1ca198d..05b1d0f7c9b4 100644
--- a/packages/cli/src/commands/dataMigrate/up.js
+++ b/packages/cli/src/commands/dataMigrate/up.js
@@ -1,8 +1,7 @@
import fs from 'fs'
import path from 'path'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { registerApiSideBabelHook } from '@redwoodjs/internal/dist/build/babel/api'
@@ -160,8 +159,8 @@ export const handler = async () => {
})
const tasks = new Listr(migrationTasks, {
- collapse: false,
- renderer: VerboseRenderer,
+ rendererOptions: { collapse: false },
+ renderer: 'verbose',
})
try {
diff --git a/packages/cli/src/commands/deploy/__tests__/baremetal.test.js b/packages/cli/src/commands/deploy/__tests__/baremetal.test.js
index 9d669005d187..ead9eb93a96f 100644
--- a/packages/cli/src/commands/deploy/__tests__/baremetal.test.js
+++ b/packages/cli/src/commands/deploy/__tests__/baremetal.test.js
@@ -1,4 +1,4 @@
-import Listr from 'listr'
+import { Listr } from 'listr2'
jest.mock('@redwoodjs/internal/dist/paths', () => {
return {
@@ -738,7 +738,7 @@ describe('commands', () => {
{ environment: 'staging', releaseDir: '2022051120000' },
{}
)
- const tasks = servers[0].task()._tasks
+ const tasks = servers[0].task().tasks
expect(tasks[0].title).toMatch('Connecting')
expect(tasks[9].title).toMatch('Disconnecting')
@@ -749,7 +749,7 @@ describe('commands', () => {
{ environment: 'staging', releaseDir: '2022051120000' },
{}
)
- const tasks = servers[0].task()._tasks
+ const tasks = servers[0].task().tasks
expect(tasks[1].title).toMatch('Cloning')
})
@@ -763,7 +763,7 @@ describe('commands', () => {
},
{}
)
- const tasks = servers[0].task()._tasks
+ const tasks = servers[0].task().tasks
expect(tasks.length).toEqual(3)
expect(tasks[1].title).toMatch('Enabling maintenance')
@@ -778,7 +778,7 @@ describe('commands', () => {
},
{}
)
- const tasks = servers[0].task()._tasks
+ const tasks = servers[0].task().tasks
expect(tasks.length).toEqual(3)
expect(tasks[1].title).toMatch('Rolling back 2 release(s)')
@@ -792,7 +792,7 @@ describe('commands', () => {
},
{}
)
- const tasks = servers[0].task()._tasks
+ const tasks = servers[0].task().tasks
expect(tasks[1].title).toEqual('Before update: `touch update`')
expect(tasks[5].title).toEqual('After install: `touch install`')
diff --git a/packages/cli/src/commands/deploy/baremetal.js b/packages/cli/src/commands/deploy/baremetal.js
index 0c057b112a71..7c6d03593024 100644
--- a/packages/cli/src/commands/deploy/baremetal.js
+++ b/packages/cli/src/commands/deploy/baremetal.js
@@ -3,8 +3,7 @@ import path from 'path'
import toml from '@iarna/toml'
import boxen from 'boxen'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { titleCase } from 'title-case'
@@ -684,7 +683,7 @@ export const handler = async (yargs) => {
const tasks = new Listr(commands(yargs, ssh), {
concurrent: true,
exitOnError: true,
- renderer: yargs.verbose && VerboseRenderer,
+ renderer: yargs.verbose && 'verbose',
})
await tasks.run()
} catch (e) {
diff --git a/packages/cli/src/commands/deploy/serverless.js b/packages/cli/src/commands/deploy/serverless.js
index 1f4372722d80..7045055ef729 100644
--- a/packages/cli/src/commands/deploy/serverless.js
+++ b/packages/cli/src/commands/deploy/serverless.js
@@ -5,8 +5,7 @@ import boxen from 'boxen'
import chalk from 'chalk'
import { config } from 'dotenv-defaults'
import execa from 'execa'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import prompts from 'prompts'
import terminalLink from 'terminal-link'
@@ -142,7 +141,7 @@ export const handler = async (yargs) => {
],
{
exitOnError: true,
- renderer: yargs.verbose && VerboseRenderer,
+ renderer: yargs.verbose && 'verbose',
}
)
try {
@@ -205,7 +204,7 @@ export const handler = async (yargs) => {
],
{
exitOnError: true,
- renderer: yargs.verbose && VerboseRenderer,
+ renderer: yargs.verbose && 'verbose',
}
)
diff --git a/packages/cli/src/commands/destroy/cell/__tests__/cell.test.js b/packages/cli/src/commands/destroy/cell/__tests__/cell.test.js
index bdf33eef1fb4..f0636c23db13 100644
--- a/packages/cli/src/commands/destroy/cell/__tests__/cell.test.js
+++ b/packages/cli/src/commands/destroy/cell/__tests__/cell.test.js
@@ -36,7 +36,7 @@ test('destroys cell files', async () => {
filesFn: files,
name: 'User',
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
await t.run()
@@ -55,7 +55,7 @@ test('destroys cell files with stories and tests', async () => {
stories: true,
tests: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
await t.run()
diff --git a/packages/cli/src/commands/destroy/component/__tests__/component.test.js b/packages/cli/src/commands/destroy/component/__tests__/component.test.js
index 332c45f36d6f..e7d22b9148bd 100644
--- a/packages/cli/src/commands/destroy/component/__tests__/component.test.js
+++ b/packages/cli/src/commands/destroy/component/__tests__/component.test.js
@@ -26,7 +26,7 @@ afterEach(() => {
test('destroys component files', async () => {
const unlinkSpy = jest.spyOn(fs, 'unlinkSync')
const t = tasks({ componentName: 'component', filesFn: files, name: 'About' })
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(() => {
const generatedFiles = Object.keys(files({ name: 'About' }))
@@ -45,7 +45,7 @@ test('destroys component files including stories and tests', async () => {
stories: true,
tests: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(() => {
const generatedFiles = Object.keys(
diff --git a/packages/cli/src/commands/destroy/directive/__tests__/directive.test.js b/packages/cli/src/commands/destroy/directive/__tests__/directive.test.js
index 95e558cf0c4f..4f896ff99293 100644
--- a/packages/cli/src/commands/destroy/directive/__tests__/directive.test.js
+++ b/packages/cli/src/commands/destroy/directive/__tests__/directive.test.js
@@ -33,7 +33,7 @@ test('destroys directive files', async () => {
filesFn: (args) => files({ ...args, type: 'validator' }),
name: 'require-admin',
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(() => {
const generatedFiles = Object.keys(
diff --git a/packages/cli/src/commands/destroy/function/__tests__/function.test.js b/packages/cli/src/commands/destroy/function/__tests__/function.test.js
index 298ee2bb61a0..903f9023c948 100644
--- a/packages/cli/src/commands/destroy/function/__tests__/function.test.js
+++ b/packages/cli/src/commands/destroy/function/__tests__/function.test.js
@@ -30,7 +30,7 @@ test('destroys service files', async () => {
filesFn: files,
name: 'sendMail',
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(async () => {
const generatedFiles = Object.keys(files({ name: 'sendMail' }))
diff --git a/packages/cli/src/commands/destroy/graphiql/graphiql.js b/packages/cli/src/commands/destroy/graphiql/graphiql.js
index f2b66692d660..f4b5c73274f3 100644
--- a/packages/cli/src/commands/destroy/graphiql/graphiql.js
+++ b/packages/cli/src/commands/destroy/graphiql/graphiql.js
@@ -1,4 +1,4 @@
-import Listr from 'listr'
+import { Listr } from 'listr2'
import {
existsAnyExtensionSync,
@@ -46,7 +46,7 @@ export const handler = () => {
task: removeGraphiqlFromGraphqlHandler,
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
try {
tasks.run()
diff --git a/packages/cli/src/commands/destroy/helpers.js b/packages/cli/src/commands/destroy/helpers.js
index 4e1b5c0460ea..f7c4f128a937 100644
--- a/packages/cli/src/commands/destroy/helpers.js
+++ b/packages/cli/src/commands/destroy/helpers.js
@@ -1,4 +1,4 @@
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { deleteFilesTask } from '../../lib'
import c from '../../lib/colors'
@@ -14,7 +14,7 @@ const tasks = ({ componentName, filesFn, name }) =>
},
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
export const createYargsForComponentDestroy = ({
diff --git a/packages/cli/src/commands/destroy/layout/__tests__/layout.test.js b/packages/cli/src/commands/destroy/layout/__tests__/layout.test.js
index 1a570b04e62b..75e6973b1f74 100644
--- a/packages/cli/src/commands/destroy/layout/__tests__/layout.test.js
+++ b/packages/cli/src/commands/destroy/layout/__tests__/layout.test.js
@@ -26,7 +26,7 @@ afterEach(() => {
test('destroys layout files', async () => {
const unlinkSpy = jest.spyOn(fs, 'unlinkSync')
const t = tasks({ componentName: 'layout', filesFn: files, name: 'Blog' })
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(() => {
const generatedFiles = Object.keys(files({ name: 'Blog' }))
@@ -45,7 +45,7 @@ test('destroys layout files with stories and tests', async () => {
stories: true,
tests: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(() => {
const generatedFiles = Object.keys(
diff --git a/packages/cli/src/commands/destroy/page/__tests__/page.test.js b/packages/cli/src/commands/destroy/page/__tests__/page.test.js
index 7f0b449a8ba8..1ef535f59735 100644
--- a/packages/cli/src/commands/destroy/page/__tests__/page.test.js
+++ b/packages/cli/src/commands/destroy/page/__tests__/page.test.js
@@ -36,9 +36,9 @@ afterEach(() => {
test('destroys page files', async () => {
const unlinkSpy = jest.spyOn(fs, 'unlinkSync')
const t = tasks({ name: 'About' })
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(() => {
+ return t.tasks[0].run().then(() => {
const generatedFiles = Object.keys(files({ name: 'About' }))
expect(generatedFiles.length).toEqual(unlinkSpy.mock.calls.length)
generatedFiles.forEach((f) => expect(unlinkSpy).toHaveBeenCalledWith(f))
@@ -60,9 +60,9 @@ test('destroys page files with stories and tests', async () => {
const unlinkSpy = jest.spyOn(fs, 'unlinkSync')
const t = tasks(fileOptions)
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(() => {
+ return t.tasks[0].run().then(() => {
const generatedFiles = Object.keys(files(fileOptions))
expect(generatedFiles.length).toEqual(unlinkSpy.mock.calls.length)
generatedFiles.forEach((f) => expect(unlinkSpy).toHaveBeenCalledWith(f))
@@ -71,9 +71,9 @@ test('destroys page files with stories and tests', async () => {
test('cleans up route from Routes.js', async () => {
const t = tasks({ name: 'About' })
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[1].run().then(() => {
+ return t.tasks[1].run().then(() => {
const routes = fs.readFileSync(getPaths().web.routes)
expect(routes).toEqual(
[
@@ -88,9 +88,9 @@ test('cleans up route from Routes.js', async () => {
test('cleans up route with a custom path from Routes.js', async () => {
const t = tasks({ name: 'About', path: '/about-us' })
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[1].run().then(() => {
+ return t.tasks[1].run().then(() => {
const routes = fs.readFileSync(getPaths().web.routes)
expect(routes).toEqual(
[
diff --git a/packages/cli/src/commands/destroy/page/page.js b/packages/cli/src/commands/destroy/page/page.js
index 00d026d747c8..1701fd404999 100644
--- a/packages/cli/src/commands/destroy/page/page.js
+++ b/packages/cli/src/commands/destroy/page/page.js
@@ -1,5 +1,5 @@
import camelcase from 'camelcase'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { deleteFilesTask, removeRoutesFromRouterTask } from '../../../lib'
import c from '../../../lib/colors'
@@ -44,7 +44,7 @@ export const tasks = ({ name, path }) =>
task: async () => removeRoutesFromRouterTask([camelcase(name)]),
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
export const handler = async ({ name, path }) => {
diff --git a/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js b/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js
index 202c0fcf26fb..66752e7870a9 100644
--- a/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js
+++ b/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js
@@ -63,9 +63,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -110,9 +110,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -136,9 +136,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[1].run().then(() => {
+ return t.tasks[1].run().then(() => {
const routes = fs.readFileSync(getPaths().web.routes)
expect(routes).toEqual(
[
@@ -187,9 +187,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -234,9 +234,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -261,9 +261,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: true,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[1].run().then(() => {
+ return t.tasks[1].run().then(() => {
const routes = fs.readFileSync(getPaths().web.routes)
expect(routes).toEqual(
[
diff --git a/packages/cli/src/commands/destroy/scaffold/__tests__/scaffoldNoNest.test.js b/packages/cli/src/commands/destroy/scaffold/__tests__/scaffoldNoNest.test.js
index c9a20893fa25..5c5681b78291 100644
--- a/packages/cli/src/commands/destroy/scaffold/__tests__/scaffoldNoNest.test.js
+++ b/packages/cli/src/commands/destroy/scaffold/__tests__/scaffoldNoNest.test.js
@@ -63,9 +63,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: false,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -110,9 +110,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: false,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -136,9 +136,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: false,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[1].run().then(() => {
+ return t.tasks[1].run().then(() => {
const routes = fs.readFileSync(getPaths().web.routes)
expect(routes).toEqual(
[
@@ -187,9 +187,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: false,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -234,9 +234,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: false,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(defaults),
@@ -261,9 +261,9 @@ describe('rw destroy scaffold', () => {
tests: false,
nestScaffoldByModel: false,
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[1].run().then(() => {
+ return t.tasks[1].run().then(() => {
const routes = fs.readFileSync(getPaths().web.routes)
expect(routes).toEqual(
[
diff --git a/packages/cli/src/commands/destroy/scaffold/scaffold.js b/packages/cli/src/commands/destroy/scaffold/scaffold.js
index 68ba1bc94b87..83c4b7e38a80 100644
--- a/packages/cli/src/commands/destroy/scaffold/scaffold.js
+++ b/packages/cli/src/commands/destroy/scaffold/scaffold.js
@@ -1,4 +1,4 @@
-import Listr from 'listr'
+import { Listr } from 'listr2'
import pascalcase from 'pascalcase'
import {
@@ -106,7 +106,7 @@ export const tasks = ({ model, path, tests, nestScaffoldByModel }) =>
task: () => removeLayoutImport({ model, path }),
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
export const handler = async ({ model: modelArg }) => {
diff --git a/packages/cli/src/commands/destroy/sdl/__tests__/sdl.test.js b/packages/cli/src/commands/destroy/sdl/__tests__/sdl.test.js
index 5467af0dbb0e..5f0e6f9028bd 100644
--- a/packages/cli/src/commands/destroy/sdl/__tests__/sdl.test.js
+++ b/packages/cli/src/commands/destroy/sdl/__tests__/sdl.test.js
@@ -42,9 +42,9 @@ describe('rw destory sdl', () => {
test('destroys sdl files', async () => {
const unlinkSpy = jest.spyOn(fs, 'unlinkSync')
const t = tasks({ model: 'Post' })
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({ ...getDefaultArgs(builder), name: 'Post' })
)
@@ -68,9 +68,9 @@ describe('rw destory sdl', () => {
test('destroys sdl files', async () => {
const unlinkSpy = jest.spyOn(fs, 'unlinkSync')
const t = tasks({ model: 'Post' })
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
- return t._tasks[0].run().then(async () => {
+ return t.tasks[0].run().then(async () => {
const generatedFiles = Object.keys(
await files({
...getDefaultArgs(builder),
diff --git a/packages/cli/src/commands/destroy/sdl/sdl.js b/packages/cli/src/commands/destroy/sdl/sdl.js
index 4b4074a5b55c..f4755737948e 100644
--- a/packages/cli/src/commands/destroy/sdl/sdl.js
+++ b/packages/cli/src/commands/destroy/sdl/sdl.js
@@ -1,4 +1,4 @@
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { deleteFilesTask } from '../../../lib'
import c from '../../../lib/colors'
@@ -27,7 +27,7 @@ export const tasks = ({ model }) =>
},
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
export const handler = async ({ model }) => {
diff --git a/packages/cli/src/commands/destroy/service/__tests__/service.test.js b/packages/cli/src/commands/destroy/service/__tests__/service.test.js
index 0e350fefac90..31d315bcd5de 100644
--- a/packages/cli/src/commands/destroy/service/__tests__/service.test.js
+++ b/packages/cli/src/commands/destroy/service/__tests__/service.test.js
@@ -44,7 +44,7 @@ describe('rw destory service', () => {
filesFn: files,
name: 'User',
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(async () => {
const generatedFiles = Object.keys(
@@ -74,7 +74,7 @@ describe('rw destory service', () => {
filesFn: files,
name: 'User',
})
- t.setRenderer('silent')
+ t.options.renderer = 'silent'
return t.run().then(async () => {
const generatedFiles = Object.keys(
diff --git a/packages/cli/src/commands/execHandler.js b/packages/cli/src/commands/execHandler.js
index 4b0f9e1e0dfb..d5be57503b1c 100644
--- a/packages/cli/src/commands/execHandler.js
+++ b/packages/cli/src/commands/execHandler.js
@@ -1,7 +1,6 @@
import path from 'path'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import { registerApiSideBabelHook } from '@redwoodjs/internal/dist/build/babel/api'
import { getWebSideDefaultBabelConfig } from '@redwoodjs/internal/dist/build/babel/web'
@@ -123,8 +122,8 @@ export const handler = async (args) => {
]
const tasks = new Listr(scriptTasks, {
- collapse: false,
- renderer: VerboseRenderer,
+ rendererOptions: { collapse: false },
+ renderer: 'verbose',
})
try {
diff --git a/packages/cli/src/commands/generate/__tests__/createYargsForComponentGeneration.test.js b/packages/cli/src/commands/generate/__tests__/createYargsForComponentGeneration.test.js
index bde93763946c..696e20820538 100644
--- a/packages/cli/src/commands/generate/__tests__/createYargsForComponentGeneration.test.js
+++ b/packages/cli/src/commands/generate/__tests__/createYargsForComponentGeneration.test.js
@@ -2,8 +2,8 @@
global.__dirname = __dirname
import '../../../lib/test'
-jest.mock('listr')
-import Listr from 'listr'
+jest.mock('listr2')
+import { Listr } from 'listr2'
import * as helpers from '../helpers'
diff --git a/packages/cli/src/commands/generate/dataMigration/dataMigration.js b/packages/cli/src/commands/generate/dataMigration/dataMigration.js
index 7dc32c29357b..fb7d9b0a3c7a 100644
--- a/packages/cli/src/commands/generate/dataMigration/dataMigration.js
+++ b/packages/cli/src/commands/generate/dataMigration/dataMigration.js
@@ -1,7 +1,7 @@
import fs from 'fs'
import path from 'path'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { paramCase } from 'param-case'
import terminalLink from 'terminal-link'
@@ -71,7 +71,7 @@ export const handler = async (args) => {
},
},
].filter(Boolean),
- { collapse: false }
+ { rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/commands/generate/dbAuth/dbAuth.js b/packages/cli/src/commands/generate/dbAuth/dbAuth.js
index a6f52cec0895..caed879f2c6a 100644
--- a/packages/cli/src/commands/generate/dbAuth/dbAuth.js
+++ b/packages/cli/src/commands/generate/dbAuth/dbAuth.js
@@ -1,7 +1,7 @@
import fs from 'fs'
import path from 'path'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import prompts from 'prompts'
import terminalLink from 'terminal-link'
@@ -252,7 +252,7 @@ const tasks = ({
},
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
}
diff --git a/packages/cli/src/commands/generate/directive/directive.js b/packages/cli/src/commands/generate/directive/directive.js
index a9bba3ac4014..50abbd97baec 100644
--- a/packages/cli/src/commands/generate/directive/directive.js
+++ b/packages/cli/src/commands/generate/directive/directive.js
@@ -2,7 +2,7 @@ import path from 'path'
import camelcase from 'camelcase'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import prompts from 'prompts'
import { getConfig } from '@redwoodjs/internal/dist/config'
@@ -165,7 +165,7 @@ export const handler = async (args) => {
},
},
].filter(Boolean),
- { collapse: false }
+ { rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/commands/generate/function/function.js b/packages/cli/src/commands/generate/function/function.js
index dfb5c347f22a..bc85f77ae362 100644
--- a/packages/cli/src/commands/generate/function/function.js
+++ b/packages/cli/src/commands/generate/function/function.js
@@ -1,7 +1,7 @@
import path from 'path'
import camelcase from 'camelcase'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -127,7 +127,7 @@ export const handler = async ({ name, force, ...rest }) => {
},
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
try {
diff --git a/packages/cli/src/commands/generate/helpers.js b/packages/cli/src/commands/generate/helpers.js
index a3fe4bf4326c..3f45367fb17a 100644
--- a/packages/cli/src/commands/generate/helpers.js
+++ b/packages/cli/src/commands/generate/helpers.js
@@ -1,8 +1,7 @@
import fs from 'fs'
import path from 'path'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import { paramCase } from 'param-case'
import pascalcase from 'pascalcase'
import terminalLink from 'terminal-link'
@@ -200,9 +199,9 @@ export const createYargsForComponentGeneration = ({
...includeAdditionalTasks(options),
],
{
- collapse: false,
+ rendererOptions: { collapse: false },
exitOnError: true,
- renderer: options.verbose && VerboseRenderer,
+ renderer: options.verbose && 'verbose',
}
)
diff --git a/packages/cli/src/commands/generate/model/model.js b/packages/cli/src/commands/generate/model/model.js
index b6c4f55eb8c6..2c4f38407e5e 100644
--- a/packages/cli/src/commands/generate/model/model.js
+++ b/packages/cli/src/commands/generate/model/model.js
@@ -1,6 +1,6 @@
import path from 'path'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { getPaths, writeFilesTask, generateTemplate } from '../../../lib'
@@ -56,7 +56,7 @@ export const handler = async ({ force, ...args }) => {
},
},
].filter(Boolean),
- { collapse: false }
+ { rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/commands/generate/page/page.js b/packages/cli/src/commands/generate/page/page.js
index 5f2fd2418e1a..b521b2064b6a 100644
--- a/packages/cli/src/commands/generate/page/page.js
+++ b/packages/cli/src/commands/generate/page/page.js
@@ -1,7 +1,7 @@
import { execSync } from 'child_process'
import camelcase from 'camelcase'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import pascalcase from 'pascalcase'
import { getConfig } from '@redwoodjs/internal/dist/config'
@@ -243,7 +243,7 @@ export const handler = async ({
},
},
].filter(Boolean),
- { collapse: false }
+ { rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/commands/generate/scaffold/scaffold.js b/packages/cli/src/commands/generate/scaffold/scaffold.js
index 5d04c323e8f5..3cc12c14a1d0 100644
--- a/packages/cli/src/commands/generate/scaffold/scaffold.js
+++ b/packages/cli/src/commands/generate/scaffold/scaffold.js
@@ -4,7 +4,7 @@ import path from 'path'
import camelcase from 'camelcase'
import execa from 'execa'
import humanize from 'humanize-string'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { paramCase } from 'param-case'
import pascalcase from 'pascalcase'
import terminalLink from 'terminal-link'
@@ -796,7 +796,7 @@ export const tasks = ({
task: generateTypes,
},
],
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
}
diff --git a/packages/cli/src/commands/generate/script/script.js b/packages/cli/src/commands/generate/script/script.js
index bd1876b67ca3..1e195c1cfc03 100644
--- a/packages/cli/src/commands/generate/script/script.js
+++ b/packages/cli/src/commands/generate/script/script.js
@@ -1,7 +1,7 @@
import fs from 'fs'
import path from 'path'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -79,7 +79,7 @@ export const handler = async ({ force, ...args }) => {
},
},
].filter(Boolean),
- { collapse: false }
+ { rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/commands/generate/sdl/sdl.js b/packages/cli/src/commands/generate/sdl/sdl.js
index a3000b1cf0b7..03aa6bf1cdf3 100644
--- a/packages/cli/src/commands/generate/sdl/sdl.js
+++ b/packages/cli/src/commands/generate/sdl/sdl.js
@@ -3,7 +3,7 @@ import path from 'path'
import boxen from 'boxen'
import camelcase from 'camelcase'
import chalk from 'chalk'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { getConfig } from '@redwoodjs/internal/dist/config'
@@ -290,7 +290,7 @@ export const handler = async ({
task: generateTypes,
},
].filter(Boolean),
- { collapse: false, exitOnError: true }
+ { rendererOptions: { collapse: false }, exitOnError: true }
)
await tasks.run()
diff --git a/packages/cli/src/commands/prerenderHandler.js b/packages/cli/src/commands/prerenderHandler.js
index 3f8985c75cdb..9a1a9b260a12 100644
--- a/packages/cli/src/commands/prerenderHandler.js
+++ b/packages/cli/src/commands/prerenderHandler.js
@@ -1,8 +1,7 @@
import fs from 'fs'
import path from 'path'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import { getPaths } from '@redwoodjs/internal/dist/paths'
import { runPrerender, writePrerenderedHtmlFile } from '@redwoodjs/prerender'
@@ -278,7 +277,8 @@ export const handler = async ({ path: routerPath, dryRun, verbose }) => {
const listrTasks = await getTasks(dryRun, routerPath)
const tasks = new Listr(listrTasks, {
- renderer: verbose ? VerboseRenderer : 'default',
+ renderer: verbose ? 'verbose' : 'default',
+ rendererOptions: { collapse: false },
concurrent: !dryRun,
})
diff --git a/packages/cli/src/commands/setup/auth/__tests__/authHandler.test.js b/packages/cli/src/commands/setup/auth/__tests__/authHandler.test.js
index 6d1ba6b72a10..790ab036bf4f 100644
--- a/packages/cli/src/commands/setup/auth/__tests__/authHandler.test.js
+++ b/packages/cli/src/commands/setup/auth/__tests__/authHandler.test.js
@@ -14,12 +14,12 @@ jest.mock('../../../../lib/project', () => ({
}))
jest.mock('execa')
-jest.mock('listr')
+jest.mock('listr2')
import fs from 'fs'
import chalk from 'chalk'
-import listr from 'listr'
+import { Listr } from 'listr2'
import * as auth from '../auth'
@@ -33,7 +33,7 @@ describe('Auth generator tests', () => {
const mockListrRun = jest.fn()
- listr.mockImplementation(() => {
+ Listr.mockImplementation(() => {
return {
run: mockListrRun,
}
diff --git a/packages/cli/src/commands/setup/auth/auth.js b/packages/cli/src/commands/setup/auth/auth.js
index 59786f83dd82..65763cd684f2 100644
--- a/packages/cli/src/commands/setup/auth/auth.js
+++ b/packages/cli/src/commands/setup/auth/auth.js
@@ -2,7 +2,7 @@ import fs from 'fs'
import path from 'path'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import prompts from 'prompts'
import terminalLink from 'terminal-link'
@@ -455,7 +455,7 @@ export const handler = async (yargs) => {
},
},
].filter(Boolean),
- { collapse: false }
+ { rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/commands/setup/custom-web-index/custom-web-index.js b/packages/cli/src/commands/setup/custom-web-index/custom-web-index.js
index d561c63fee89..ca229f4da903 100644
--- a/packages/cli/src/commands/setup/custom-web-index/custom-web-index.js
+++ b/packages/cli/src/commands/setup/custom-web-index/custom-web-index.js
@@ -2,7 +2,7 @@ import fs from 'fs'
import path from 'path'
import chalk from 'chalk'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -24,44 +24,47 @@ export const builder = (yargs) => {
}
export const handler = async ({ force }) => {
- const tasks = new Listr([
- {
- title: 'Creating new entry point in `web/src/index.js`.',
- task: () => {
- // @TODO figure out how we're handling typescript
- // In this file, we're setting everything to js
- // @Note, getPaths.web.index is null, when it doesn't exist
- const entryPointFile =
- getPaths().web.index ?? path.join(getPaths().web.src, 'index.js')
+ const tasks = new Listr(
+ [
+ {
+ title: 'Creating new entry point in `web/src/index.js`.',
+ task: () => {
+ // @TODO figure out how we're handling typescript
+ // In this file, we're setting everything to js
+ // @Note, getPaths.web.index is null, when it doesn't exist
+ const entryPointFile =
+ getPaths().web.index ?? path.join(getPaths().web.src, 'index.js')
- return writeFile(
- entryPointFile,
- fs
- .readFileSync(
- path.join(
- getPaths().base,
- // NOTE we're copying over the index.js before babel transform
- 'node_modules/@redwoodjs/web/src/entry/index.js'
+ return writeFile(
+ entryPointFile,
+ fs
+ .readFileSync(
+ path.join(
+ getPaths().base,
+ // NOTE we're copying over the index.js before babel transform
+ 'node_modules/@redwoodjs/web/src/entry/index.js'
+ )
)
- )
- .toString()
- .replace('~redwood-app-root', './App'),
- { overwriteExisting: force }
- )
+ .toString()
+ .replace('~redwood-app-root', './App'),
+ { overwriteExisting: force }
+ )
+ },
},
- },
- {
- title: 'One more thing...',
- task: (_ctx, task) => {
- task.title = `One more thing...\n
+ {
+ title: 'One more thing...',
+ task: (_ctx, task) => {
+ task.title = `One more thing...\n
${c.green(
'Quick link to the docs on configuring a custom entry point for your RW app'
)}
${chalk.hex('#e8e8e8')('https://redwoodjs.com/docs/custom-web-index')}
`
+ },
},
- },
- ])
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/deploy/helpers/index.js b/packages/cli/src/commands/setup/deploy/helpers/index.js
index 97c5cad9f52d..5ef215884b27 100644
--- a/packages/cli/src/commands/setup/deploy/helpers/index.js
+++ b/packages/cli/src/commands/setup/deploy/helpers/index.js
@@ -4,7 +4,7 @@ import path from 'path'
import boxen from 'boxen'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import {
getInstalledRedwoodVersion,
diff --git a/packages/cli/src/commands/setup/deploy/providers/baremetal.js b/packages/cli/src/commands/setup/deploy/providers/baremetal.js
index ef7233b95c6a..de8c639e1dcd 100644
--- a/packages/cli/src/commands/setup/deploy/providers/baremetal.js
+++ b/packages/cli/src/commands/setup/deploy/providers/baremetal.js
@@ -1,7 +1,7 @@
// import terminalLink from 'terminal-link'
import path from 'path'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -37,17 +37,20 @@ const notes = [
]
export const handler = async ({ force }) => {
- const tasks = new Listr([
- addPackagesTask({
- packages: ['node-ssh'],
- devDependency: true,
- }),
- addFilesTask({
- files,
- force,
- }),
- printSetupNotes(notes),
- ])
+ const tasks = new Listr(
+ [
+ addPackagesTask({
+ packages: ['node-ssh'],
+ devDependency: true,
+ }),
+ addFilesTask({
+ files,
+ force,
+ }),
+ printSetupNotes(notes),
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
} catch (e) {
diff --git a/packages/cli/src/commands/setup/deploy/providers/flightcontrol.js b/packages/cli/src/commands/setup/deploy/providers/flightcontrol.js
index fb192d9f1946..58235874504f 100644
--- a/packages/cli/src/commands/setup/deploy/providers/flightcontrol.js
+++ b/packages/cli/src/commands/setup/deploy/providers/flightcontrol.js
@@ -4,7 +4,7 @@ import { EOL } from 'os'
import path from 'path'
import { getSchema, getConfig } from '@prisma/internals'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -302,23 +302,26 @@ const notes = [
]
export const handler = async ({ force, database }) => {
- const tasks = new Listr([
- {
- title: 'Adding flightcontrol.json',
- task: async () => {
- const fileData = await getFlightcontrolJson(database)
- let files = {}
- files[fileData.path] = JSON.stringify(fileData.content, null, 2)
- return writeFilesTask(files, { overwriteExisting: force })
+ const tasks = new Listr(
+ [
+ {
+ title: 'Adding flightcontrol.json',
+ task: async () => {
+ const fileData = await getFlightcontrolJson(database)
+ let files = {}
+ files[fileData.path] = JSON.stringify(fileData.content, null, 2)
+ return writeFilesTask(files, { overwriteExisting: force })
+ },
},
- },
- updateGraphQLFunction(),
- updateDbAuth(),
- updateApp(),
- updateApiURLTask('${REDWOOD_API_URL}'),
- addToDotEnvDefaultTask(),
- printSetupNotes(notes),
- ])
+ updateGraphQLFunction(),
+ updateDbAuth(),
+ updateApp(),
+ updateApiURLTask('${REDWOOD_API_URL}'),
+ addToDotEnvDefaultTask(),
+ printSetupNotes(notes),
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/deploy/providers/layer0.js b/packages/cli/src/commands/setup/deploy/providers/layer0.js
index c9d6030ccfbe..9fd69d273c46 100644
--- a/packages/cli/src/commands/setup/deploy/providers/layer0.js
+++ b/packages/cli/src/commands/setup/deploy/providers/layer0.js
@@ -1,6 +1,6 @@
import fs from 'fs'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -40,29 +40,32 @@ const prismaBinaryTargetAdditions = () => {
}
export const handler = async () => {
- const tasks = new Listr([
- addPackagesTask({
- packages: ['@layer0/cli'],
- devDependency: true,
- }),
- preRequisiteCheckTask([
+ const tasks = new Listr(
+ [
+ addPackagesTask({
+ packages: ['@layer0/cli'],
+ devDependency: true,
+ }),
+ preRequisiteCheckTask([
+ {
+ title: 'Checking if Layer0 is installed...',
+ command: ['yarn', ['layer0', '--version']],
+ errorMessage: ERR_MESSAGE_MISSING_CLI,
+ },
+ {
+ title: 'Initializing with Layer0',
+ command: ['yarn', ['layer0', 'init']],
+ errorMessage: ERR_MESSAGE_NOT_INITIALIZED,
+ },
+ ]),
{
- title: 'Checking if Layer0 is installed...',
- command: ['yarn', ['layer0', '--version']],
- errorMessage: ERR_MESSAGE_MISSING_CLI,
+ title: 'Adding necessary Prisma binaries...',
+ task: () => prismaBinaryTargetAdditions(),
},
- {
- title: 'Initializing with Layer0',
- command: ['yarn', ['layer0', 'init']],
- errorMessage: ERR_MESSAGE_NOT_INITIALIZED,
- },
- ]),
- {
- title: 'Adding necessary Prisma binaries...',
- task: () => prismaBinaryTargetAdditions(),
- },
- printSetupNotes(notes),
- ])
+ printSetupNotes(notes),
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
} catch (e) {
diff --git a/packages/cli/src/commands/setup/deploy/providers/netlify.js b/packages/cli/src/commands/setup/deploy/providers/netlify.js
index afc9e76113bb..9d8261f2ece9 100644
--- a/packages/cli/src/commands/setup/deploy/providers/netlify.js
+++ b/packages/cli/src/commands/setup/deploy/providers/netlify.js
@@ -1,7 +1,7 @@
// import terminalLink from 'terminal-link'
import path from 'path'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -23,14 +23,17 @@ const notes = [
]
export const handler = async ({ force }) => {
- const tasks = new Listr([
- updateApiURLTask('/.netlify/functions'),
- addFilesTask({
- files,
- force,
- }),
- printSetupNotes(notes),
- ])
+ const tasks = new Listr(
+ [
+ updateApiURLTask('/.netlify/functions'),
+ addFilesTask({
+ files,
+ force,
+ }),
+ printSetupNotes(notes),
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
} catch (e) {
diff --git a/packages/cli/src/commands/setup/deploy/providers/render.js b/packages/cli/src/commands/setup/deploy/providers/render.js
index 854ce0304f32..9449307f03c5 100644
--- a/packages/cli/src/commands/setup/deploy/providers/render.js
+++ b/packages/cli/src/commands/setup/deploy/providers/render.js
@@ -3,7 +3,7 @@ import fs from 'fs'
import path from 'path'
import { getSchema, getConfig } from '@prisma/internals'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -89,24 +89,27 @@ const additionalFiles = [
]
export const handler = async ({ force, database }) => {
- const tasks = new Listr([
- {
- title: 'Adding render.yaml',
- task: async () => {
- const fileData = await getRenderYamlContent(database)
- let files = {}
- files[fileData.path] = fileData.content
- return writeFilesTask(files, { overwriteExisting: force })
+ const tasks = new Listr(
+ [
+ {
+ title: 'Adding render.yaml',
+ task: async () => {
+ const fileData = await getRenderYamlContent(database)
+ let files = {}
+ files[fileData.path] = fileData.content
+ return writeFilesTask(files, { overwriteExisting: force })
+ },
},
- },
- updateApiURLTask('/.redwood/functions'),
- // Add health check api function
- addFilesTask({
- files: additionalFiles,
- force,
- }),
- printSetupNotes(notes),
- ])
+ updateApiURLTask('/.redwood/functions'),
+ // Add health check api function
+ addFilesTask({
+ files: additionalFiles,
+ force,
+ }),
+ printSetupNotes(notes),
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/deploy/providers/serverless.js b/packages/cli/src/commands/setup/deploy/providers/serverless.js
index 397d9f1d681d..7a6fdedfa45e 100644
--- a/packages/cli/src/commands/setup/deploy/providers/serverless.js
+++ b/packages/cli/src/commands/setup/deploy/providers/serverless.js
@@ -2,7 +2,7 @@
import fs from 'fs'
import path from 'path'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -131,6 +131,7 @@ export const handler = async ({ force }) => {
],
{
exitOnError: true,
+ rendererOptions: { collapse: false },
}
)
try {
diff --git a/packages/cli/src/commands/setup/deploy/providers/vercel.js b/packages/cli/src/commands/setup/deploy/providers/vercel.js
index 393496e83a17..4e135ee8b9cd 100644
--- a/packages/cli/src/commands/setup/deploy/providers/vercel.js
+++ b/packages/cli/src/commands/setup/deploy/providers/vercel.js
@@ -1,5 +1,5 @@
// import terminalLink from 'terminal-link'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -15,7 +15,9 @@ const notes = [
]
export const handler = async () => {
- const tasks = new Listr([updateApiURLTask('/api'), printSetupNotes(notes)])
+ const tasks = new Listr([updateApiURLTask('/api'), printSetupNotes(notes)], {
+ rendererOptions: { collapse: false },
+ })
try {
await tasks.run()
} catch (e) {
diff --git a/packages/cli/src/commands/setup/generator/generator.js b/packages/cli/src/commands/setup/generator/generator.js
index 54f6fe6d1bdb..a46d064dbd1b 100644
--- a/packages/cli/src/commands/setup/generator/generator.js
+++ b/packages/cli/src/commands/setup/generator/generator.js
@@ -2,7 +2,7 @@ import fs from 'fs'
import path from 'path'
import fse from 'fs-extra'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { getPaths } from '../../../lib'
@@ -89,7 +89,7 @@ const tasks = ({ name, force }) => {
},
},
],
- { collapse: false, errorOnExist: true }
+ { rendererOptions: { collapse: false }, errorOnExist: true }
)
}
diff --git a/packages/cli/src/commands/setup/graphiql/__tests__/graphiqlHandler.test.js b/packages/cli/src/commands/setup/graphiql/__tests__/graphiqlHandler.test.js
index ada9a6f2edf0..0f5f7e1b0535 100644
--- a/packages/cli/src/commands/setup/graphiql/__tests__/graphiqlHandler.test.js
+++ b/packages/cli/src/commands/setup/graphiql/__tests__/graphiqlHandler.test.js
@@ -17,9 +17,9 @@ jest.mock('../../../../lib/project', () => ({
isTypeScriptProject: () => false,
}))
-jest.mock('listr')
+jest.mock('listr2')
import chalk from 'chalk'
-import listr from 'listr'
+import { Listr } from 'listr2'
import * as graphiql from '../graphiql'
@@ -30,7 +30,7 @@ describe('Graphiql generator tests', () => {
const cSpy = jest.spyOn(console, 'error').mockImplementation(() => {})
const mockListrRun = jest.fn()
- listr.mockImplementation(() => {
+ Listr.mockImplementation(() => {
return {
run: mockListrRun,
}
diff --git a/packages/cli/src/commands/setup/graphiql/graphiql.js b/packages/cli/src/commands/setup/graphiql/graphiql.js
index b08a0a0ef33a..dcb4325f35ba 100644
--- a/packages/cli/src/commands/setup/graphiql/graphiql.js
+++ b/packages/cli/src/commands/setup/graphiql/graphiql.js
@@ -3,7 +3,7 @@ import path from 'path'
import CryptoJS from 'crypto-js'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { v4 as uuidv4 } from 'uuid'
@@ -265,7 +265,7 @@ export const handler = async ({ provider, id, token, expiry, view }) => {
},
},
].filter(Boolean),
- { collapse: false }
+ { rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/commands/setup/i18n/i18n.js b/packages/cli/src/commands/setup/i18n/i18n.js
index 5a21eb13c1c7..72da76912c92 100644
--- a/packages/cli/src/commands/setup/i18n/i18n.js
+++ b/packages/cli/src/commands/setup/i18n/i18n.js
@@ -3,7 +3,7 @@ import path from 'path'
import chalk from 'chalk'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -48,151 +48,157 @@ const localesExists = (lng) => {
export const handler = async ({ force }) => {
const rwPaths = getPaths()
- const tasks = new Listr([
- {
- title: 'Installing packages...',
- task: async () => {
- return new Listr([
- {
- title:
- 'Install i18n, i18next, react-i18next and i18next-browser-languagedetector',
- task: async () => {
- /**
- * Install i18n, i18next, react-i18next and i18next-browser-languagedetector
- */
- await execa('yarn', [
- 'workspace',
- 'web',
- 'add',
- 'i18n',
- 'i18next',
- 'react-i18next',
- 'i18next-browser-languagedetector',
- ])
- },
- },
- ])
- },
- },
- {
- title: 'Configure i18n...',
- task: () => {
- /**
- * Write i18n.js in web/src
- *
- * Check if i18n config already exists.
- * If it exists, throw an error.
- */
- if (!force && i18nConfigExists()) {
- throw new Error(
- 'i18n config already exists.\nUse --force to override existing config.'
- )
- } else {
- return writeFile(
- path.join(getPaths().web.src, 'i18n.js'),
- fs
- .readFileSync(
- path.resolve(__dirname, 'templates', 'i18n.js.template')
- )
- .toString(),
- { overwriteExisting: force }
+ const tasks = new Listr(
+ [
+ {
+ title: 'Installing packages...',
+ task: async () => {
+ return new Listr(
+ [
+ {
+ title:
+ 'Install i18n, i18next, react-i18next and i18next-browser-languagedetector',
+ task: async () => {
+ /**
+ * Install i18n, i18next, react-i18next and i18next-browser-languagedetector
+ */
+ await execa('yarn', [
+ 'workspace',
+ 'web',
+ 'add',
+ 'i18n',
+ 'i18next',
+ 'react-i18next',
+ 'i18next-browser-languagedetector',
+ ])
+ },
+ },
+ ],
+ { rendererOptions: { collapse: false } }
)
- }
+ },
},
- },
- {
- title: 'Adding locale file for French...',
- task: () => {
- /**
- * Make web/src/locales if it doesn't exist
- * and write fr.json there
- *
- * Check if fr.json already exists.
- * If it exists, throw an error.
- */
+ {
+ title: 'Configure i18n...',
+ task: () => {
+ /**
+ * Write i18n.js in web/src
+ *
+ * Check if i18n config already exists.
+ * If it exists, throw an error.
+ */
+ if (!force && i18nConfigExists()) {
+ throw new Error(
+ 'i18n config already exists.\nUse --force to override existing config.'
+ )
+ } else {
+ return writeFile(
+ path.join(getPaths().web.src, 'i18n.js'),
+ fs
+ .readFileSync(
+ path.resolve(__dirname, 'templates', 'i18n.js.template')
+ )
+ .toString(),
+ { overwriteExisting: force }
+ )
+ }
+ },
+ },
+ {
+ title: 'Adding locale file for French...',
+ task: () => {
+ /**
+ * Make web/src/locales if it doesn't exist
+ * and write fr.json there
+ *
+ * Check if fr.json already exists.
+ * If it exists, throw an error.
+ */
- if (!force && localesExists('fr')) {
- throw new Error(
- 'fr.json config already exists.\nUse --force to override existing config.'
- )
- } else {
- return writeFile(
- path.join(getPaths().web.src, '/locales/fr.json'),
- fs
- .readFileSync(
- path.resolve(__dirname, 'templates', 'fr.json.template')
- )
- .toString(),
- { overwriteExisting: force }
- )
- }
+ if (!force && localesExists('fr')) {
+ throw new Error(
+ 'fr.json config already exists.\nUse --force to override existing config.'
+ )
+ } else {
+ return writeFile(
+ path.join(getPaths().web.src, '/locales/fr.json'),
+ fs
+ .readFileSync(
+ path.resolve(__dirname, 'templates', 'fr.json.template')
+ )
+ .toString(),
+ { overwriteExisting: force }
+ )
+ }
+ },
},
- },
- {
- title: 'Adding locale file for English...',
- task: () => {
- /**
- * Make web/src/locales if it doesn't exist
- * and write en.json there
- *
- * Check if en.json already exists.
- * If it exists, throw an error.
- */
- if (!force && localesExists('en')) {
- throw new Error(
- 'en.json already exists.\nUse --force to override existing config.'
- )
- } else {
- return writeFile(
- path.join(getPaths().web.src, '/locales/en.json'),
- fs
- .readFileSync(
- path.resolve(__dirname, 'templates', 'en.json.template')
- )
- .toString(),
- { overwriteExisting: force }
- )
- }
+ {
+ title: 'Adding locale file for English...',
+ task: () => {
+ /**
+ * Make web/src/locales if it doesn't exist
+ * and write en.json there
+ *
+ * Check if en.json already exists.
+ * If it exists, throw an error.
+ */
+ if (!force && localesExists('en')) {
+ throw new Error(
+ 'en.json already exists.\nUse --force to override existing config.'
+ )
+ } else {
+ return writeFile(
+ path.join(getPaths().web.src, '/locales/en.json'),
+ fs
+ .readFileSync(
+ path.resolve(__dirname, 'templates', 'en.json.template')
+ )
+ .toString(),
+ { overwriteExisting: force }
+ )
+ }
+ },
+ },
+ {
+ title: 'Adding import to App.{js,tsx}...',
+ task: (_ctx, task) => {
+ /**
+ * Add i18n import to the last import of App.{js,tsx}
+ *
+ * Check if i18n import already exists.
+ * If it exists, throw an error.
+ */
+ let appJS = fs.readFileSync(APP_JS_PATH)
+ if (i18nImportExist(appJS)) {
+ task.skip('Import already exists in App.js')
+ } else {
+ fs.writeFileSync(APP_JS_PATH, addI18nImport(appJS))
+ }
+ },
},
- },
- {
- title: 'Adding import to App.{js,tsx}...',
- task: (_ctx, task) => {
- /**
- * Add i18n import to the last import of App.{js,tsx}
- *
- * Check if i18n import already exists.
- * If it exists, throw an error.
- */
- let appJS = fs.readFileSync(APP_JS_PATH)
- if (i18nImportExist(appJS)) {
- task.skip('Import already exists in App.js')
- } else {
- fs.writeFileSync(APP_JS_PATH, addI18nImport(appJS))
- }
+ {
+ title: 'Configuring Storybook...',
+ // skip this task if the user's storybook config already includes "withI18n"
+ skip: () => fileIncludes(rwPaths.web.storybookConfig, 'withI18n'),
+ task: async () =>
+ extendStorybookConfiguration(
+ path.join(__dirname, 'templates', 'storybook.preview.js.template')
+ ),
},
- },
- {
- title: 'Configuring Storybook...',
- // skip this task if the user's storybook config already includes "withI18n"
- skip: () => fileIncludes(rwPaths.web.storybookConfig, 'withI18n'),
- task: async () =>
- extendStorybookConfiguration(
- path.join(__dirname, 'templates', 'storybook.preview.js.template')
- ),
- },
- {
- title: 'One more thing...',
- task: (_ctx, task) => {
- task.title = `One more thing...\n
+ {
+ title: 'One more thing...',
+ task: (_ctx, task) => {
+ task.title = `One more thing...\n
${c.green('Quick link to the docs:')}\n
${chalk.hex('#e8e8e8')(
'https://react.i18next.com/guides/quick-start/'
)}
`
+ },
},
- },
- ])
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/tsconfig/tsconfig.js b/packages/cli/src/commands/setup/tsconfig/tsconfig.js
index 1a7b8d578877..588057eea294 100644
--- a/packages/cli/src/commands/setup/tsconfig/tsconfig.js
+++ b/packages/cli/src/commands/setup/tsconfig/tsconfig.js
@@ -1,7 +1,7 @@
import path from 'path'
import chalk from 'chalk'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -33,41 +33,44 @@ export const handler = async ({ force }) => {
const CRWA_TEMPLATE_URL = `https://raw.githubusercontent.com/redwoodjs/redwood/${GITHUB_VERSION_TAG}/packages/create-redwood-app/template`
- const tasks = new Listr([
- {
- title: 'Creating tsconfig in web',
- task: () => {
- const webConfigPath = path.join(getPaths().web.base, 'tsconfig.json')
+ const tasks = new Listr(
+ [
+ {
+ title: 'Creating tsconfig in web',
+ task: () => {
+ const webConfigPath = path.join(getPaths().web.base, 'tsconfig.json')
- const templateUrl = `${CRWA_TEMPLATE_URL}/web/tsconfig.json`
+ const templateUrl = `${CRWA_TEMPLATE_URL}/web/tsconfig.json`
- return saveRemoteFileToDisk(templateUrl, webConfigPath, {
- overwriteExisting: force,
- })
+ return saveRemoteFileToDisk(templateUrl, webConfigPath, {
+ overwriteExisting: force,
+ })
+ },
},
- },
- {
- title: 'Creating tsconfig in api',
- task: () => {
- const webConfigPath = path.join(getPaths().api.base, 'tsconfig.json')
+ {
+ title: 'Creating tsconfig in api',
+ task: () => {
+ const webConfigPath = path.join(getPaths().api.base, 'tsconfig.json')
- const templateUrl = `${CRWA_TEMPLATE_URL}/api/tsconfig.json`
+ const templateUrl = `${CRWA_TEMPLATE_URL}/api/tsconfig.json`
- return saveRemoteFileToDisk(templateUrl, webConfigPath, {
- overwriteExisting: force,
- })
+ return saveRemoteFileToDisk(templateUrl, webConfigPath, {
+ overwriteExisting: force,
+ })
+ },
},
- },
- {
- title: 'One more thing...',
- task: (_ctx, task) => {
- task.title = `One more thing...\n
+ {
+ title: 'One more thing...',
+ task: (_ctx, task) => {
+ task.title = `One more thing...\n
${c.green('Quick link to the docs on configuring TypeScript')}
${chalk.hex('#e8e8e8')('https://redwoodjs.com/docs/typescript')}
`
+ },
},
- },
- ])
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
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 cf605e20907e..95752e09e24b 100644
--- a/packages/cli/src/commands/setup/ui/libraries/chakra-ui.js
+++ b/packages/cli/src/commands/setup/ui/libraries/chakra-ui.js
@@ -1,7 +1,7 @@
import path from 'path'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { getPaths, writeFile } from '../../../../lib'
import c from '../../../../lib/colors'
@@ -42,64 +42,70 @@ export async function handler({ force, install }) {
'framer-motion@^6',
]
- const tasks = new Listr([
- {
- title: 'Installing packages...',
- skip: () => !install,
- task: () => {
- return new Listr([
- {
- title: `Install ${packages.join(', ')}`,
- task: async () => {
- await execa('yarn', ['workspace', 'web', 'add', ...packages])
- },
- },
- ])
+ const tasks = new Listr(
+ [
+ {
+ title: 'Installing packages...',
+ skip: () => !install,
+ task: () => {
+ return new Listr(
+ [
+ {
+ title: `Install ${packages.join(', ')}`,
+ task: async () => {
+ await execa('yarn', ['workspace', 'web', 'add', ...packages])
+ },
+ },
+ ],
+ { rendererOptions: { collapse: false } }
+ )
+ },
},
- },
- {
- title: 'Setting up Chakra UI...',
- skip: () => fileIncludes(rwPaths.web.app, 'ChakraProvider'),
- task: () =>
- extendJSXFile(rwPaths.web.app, {
- insertComponent: {
- name: 'ChakraProvider',
- props: { theme: 'extendedTheme' },
- within: 'RedwoodProvider',
- insertBefore: '',
- },
- imports: [
- "import { ChakraProvider, ColorModeScript, extendTheme } from '@chakra-ui/react'",
- "import * as theme from 'config/chakra.config'",
- ],
- moduleScopeLines: ['const extendedTheme = extendTheme(theme)'],
- }),
- },
- {
- title: `Creating Theme File...`,
- task: () => {
- writeFile(
- path.join(rwPaths.web.config, 'chakra.config.js'),
- CHAKRA_THEME_AND_COMMENTS,
- { overwriteExisting: force }
- )
+ {
+ title: 'Setting up Chakra UI...',
+ skip: () => fileIncludes(rwPaths.web.app, 'ChakraProvider'),
+ task: () =>
+ extendJSXFile(rwPaths.web.app, {
+ insertComponent: {
+ name: 'ChakraProvider',
+ props: { theme: 'extendedTheme' },
+ within: 'RedwoodProvider',
+ insertBefore: '',
+ },
+ imports: [
+ "import { ChakraProvider, ColorModeScript, extendTheme } from '@chakra-ui/react'",
+ "import * as theme from 'config/chakra.config'",
+ ],
+ moduleScopeLines: ['const extendedTheme = extendTheme(theme)'],
+ }),
},
- },
- {
- title: 'Configure Storybook...',
- // skip this task if the user's storybook config already includes "withChakra"
- skip: () => fileIncludes(rwPaths.web.storybookConfig, 'withChakra'),
- task: async () =>
- extendStorybookConfiguration(
- path.join(
- __dirname,
- '..',
- 'templates',
- 'chakra.storybook.preview.js.template'
+ {
+ title: `Creating Theme File...`,
+ task: () => {
+ writeFile(
+ path.join(rwPaths.web.config, 'chakra.config.js'),
+ CHAKRA_THEME_AND_COMMENTS,
+ { overwriteExisting: force }
)
- ),
- },
- ])
+ },
+ },
+ {
+ title: 'Configure Storybook...',
+ // skip this task if the user's storybook config already includes "withChakra"
+ skip: () => fileIncludes(rwPaths.web.storybookConfig, 'withChakra'),
+ task: async () =>
+ extendStorybookConfiguration(
+ path.join(
+ __dirname,
+ '..',
+ 'templates',
+ 'chakra.storybook.preview.js.template'
+ )
+ ),
+ },
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/ui/libraries/mantine.js b/packages/cli/src/commands/setup/ui/libraries/mantine.js
index 1adbdacb4cb9..6b7166d88c65 100644
--- a/packages/cli/src/commands/setup/ui/libraries/mantine.js
+++ b/packages/cli/src/commands/setup/ui/libraries/mantine.js
@@ -1,7 +1,7 @@
import path from 'path'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { getPaths, writeFile } from '../../../../lib'
import c from '../../../../lib/colors'
@@ -60,66 +60,72 @@ export async function handler({ force, install, packages }) {
packages.includes(ALL_KEYWORD) ? ALL_MANTINE_PACKAGES : packages
).map((pack) => `@mantine/${pack}`)
- const tasks = new Listr([
- {
- title: 'Installing packages...',
- skip: () => !install,
- task: () => {
- return new Listr([
- {
- title: `Install ${installPackages.join(', ')}`,
- task: async () => {
- await execa('yarn', [
- 'workspace',
- 'web',
- 'add',
- '-D',
- '@emotion/react',
- ...installPackages,
- ])
+ const tasks = new Listr(
+ [
+ {
+ title: 'Installing packages...',
+ skip: () => !install,
+ task: () => {
+ return new Listr(
+ [
+ {
+ title: `Install ${installPackages.join(', ')}`,
+ task: async () => {
+ await execa('yarn', [
+ 'workspace',
+ 'web',
+ 'add',
+ '-D',
+ '@emotion/react',
+ ...installPackages,
+ ])
+ },
+ },
+ ],
+ { rendererOptions: { collapse: false } }
+ )
+ },
+ },
+ {
+ title: 'Setting up Mantine...',
+ skip: () => fileIncludes(rwPaths.web.app, 'MantineProvider'),
+ task: () =>
+ extendJSXFile(rwPaths.web.app, {
+ insertComponent: {
+ name: 'MantineProvider',
+ props: { theme: 'theme' },
+ within: 'RedwoodProvider',
},
- },
- ])
+ imports: [
+ "import { MantineProvider } from '@mantine/core'",
+ "import * as theme from 'config/mantine.config'",
+ ],
+ }),
},
- },
- {
- title: 'Setting up Mantine...',
- skip: () => fileIncludes(rwPaths.web.app, 'MantineProvider'),
- task: () =>
- extendJSXFile(rwPaths.web.app, {
- insertComponent: {
- name: 'MantineProvider',
- props: { theme: 'theme' },
- within: 'RedwoodProvider',
- },
- imports: [
- "import { MantineProvider } from '@mantine/core'",
- "import * as theme from 'config/mantine.config'",
- ],
- }),
- },
- {
- title: `Creating Theme File...`,
- task: () => {
- writeFile(configFilePath, MANTINE_THEME_AND_COMMENTS, {
- overwriteExisting: force,
- })
+ {
+ title: `Creating Theme File...`,
+ task: () => {
+ writeFile(configFilePath, MANTINE_THEME_AND_COMMENTS, {
+ overwriteExisting: force,
+ })
+ },
},
- },
- {
- title: 'Configure Storybook...',
- skip: () => fileIncludes(rwPaths.web.storybookConfig, 'withMantine'),
- task: async () =>
- extendStorybookConfiguration(
- path.join(
- __dirname,
- '..',
- 'templates',
- 'mantine.storybook.preview.js.template'
- )
- ),
- },
- ])
+ {
+ title: 'Configure Storybook...',
+ skip: () => fileIncludes(rwPaths.web.storybookConfig, 'withMantine'),
+ task: async () =>
+ extendStorybookConfiguration(
+ path.join(
+ __dirname,
+ '..',
+ 'templates',
+ 'mantine.storybook.preview.js.template'
+ )
+ ),
+ },
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js b/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js
index 6cc364451125..2a359275be7e 100644
--- a/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js
+++ b/packages/cli/src/commands/setup/ui/libraries/tailwindcss.js
@@ -3,7 +3,7 @@ import path from 'path'
import execa from 'execa'
import { outputFileSync } from 'fs-extra'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -73,223 +73,240 @@ export const handler = async ({ force, install }) => {
'bradlc.vscode-tailwindcss',
]
- const tasks = new Listr([
- {
- title: 'Installing project-wide packages...',
- skip: () => !install,
- task: () => {
- return new Listr([
- {
- title: `Install ${projectPackages.join(', ')}`,
- task: async () => {
- const yarnVersion = await execa('yarn', ['--version'])
- const isYarnV1 = yarnVersion.stdout.trim().startsWith('1')
- await execa('yarn', [
- 'add',
- '-D',
- ...(isYarnV1 ? ['-W'] : []),
- ...projectPackages,
- ])
- },
- },
- ])
- },
- },
- {
- title: 'Installing web workspace-wide packages...',
- skip: () => !install,
- task: () => {
- return new Listr([
- {
- title: `Install ${webWorkspacePackages.join(', ')}`,
- task: async () => {
- await execa('yarn', [
- 'workspace',
- 'web',
- 'add',
- '-D',
- ...webWorkspacePackages,
- ])
- },
- },
- ])
- },
- },
- {
- title: 'Configuring PostCSS...',
- task: () => {
- /**
- * Check if PostCSS config already exists.
- * If it exists, throw an error.
- */
- const postCSSConfigPath = rwPaths.web.postcss
-
- if (!force && fs.existsSync(postCSSConfigPath)) {
- throw new Error(
- 'PostCSS config already exists.\nUse --force to override existing config.'
+ const tasks = new Listr(
+ [
+ {
+ title: 'Installing project-wide packages...',
+ skip: () => !install,
+ task: () => {
+ return new Listr(
+ [
+ {
+ title: `Install ${projectPackages.join(', ')}`,
+ task: async () => {
+ const yarnVersion = await execa('yarn', ['--version'])
+ const isYarnV1 = yarnVersion.stdout.trim().startsWith('1')
+ await execa('yarn', [
+ 'add',
+ '-D',
+ ...(isYarnV1 ? ['-W'] : []),
+ ...projectPackages,
+ ])
+ },
+ },
+ ],
+ { rendererOptions: { collapse: false } }
)
- } else {
- const postCSSConfig = fs.readFileSync(
- path.join(__dirname, '../templates/postcss.config.js.template'),
- 'utf-8'
+ },
+ },
+ {
+ title: 'Installing web workspace-wide packages...',
+ skip: () => !install,
+ task: () => {
+ return new Listr(
+ [
+ {
+ title: `Install ${webWorkspacePackages.join(', ')}`,
+ task: async () => {
+ await execa('yarn', [
+ 'workspace',
+ 'web',
+ 'add',
+ '-D',
+ ...webWorkspacePackages,
+ ])
+ },
+ },
+ ],
+ { rendererOptions: { collapse: false } }
)
-
- return outputFileSync(postCSSConfigPath, postCSSConfig)
- }
+ },
},
- },
- {
- title: 'Initializing Tailwind CSS...',
- task: async () => {
- const tailwindConfigPath = path.join(
- rwPaths.web.config,
- 'tailwind.config.js'
- )
+ {
+ title: 'Configuring PostCSS...',
+ task: () => {
+ /**
+ * Check if PostCSS config already exists.
+ * If it exists, throw an error.
+ */
+ const postCSSConfigPath = rwPaths.web.postcss
- if (fs.existsSync(tailwindConfigPath)) {
- if (force) {
- // `yarn tailwindcss init` will fail these files already exists
- fs.unlinkSync(tailwindConfigPath)
- } else {
+ if (!force && fs.existsSync(postCSSConfigPath)) {
throw new Error(
- 'Tailwindcss config already exists.\nUse --force to override existing config.'
+ 'PostCSS config already exists.\nUse --force to override existing config.'
)
+ } else {
+ const postCSSConfig = fs.readFileSync(
+ path.join(__dirname, '../templates/postcss.config.js.template'),
+ 'utf-8'
+ )
+
+ return outputFileSync(postCSSConfigPath, postCSSConfig)
}
- }
+ },
+ },
+ {
+ title: 'Initializing Tailwind CSS...',
+ task: async () => {
+ const tailwindConfigPath = path.join(
+ rwPaths.web.config,
+ 'tailwind.config.js'
+ )
- await execa('yarn', ['tailwindcss', 'init', tailwindConfigPath], {
- cwd: rwPaths.web.base,
- })
+ if (fs.existsSync(tailwindConfigPath)) {
+ if (force) {
+ // `yarn tailwindcss init` will fail these files already exists
+ fs.unlinkSync(tailwindConfigPath)
+ } else {
+ throw new Error(
+ 'Tailwindcss config already exists.\nUse --force to override existing config.'
+ )
+ }
+ }
- // Replace `content`.
- const tailwindConfig = fs.readFileSync(tailwindConfigPath, 'utf-8')
- const newTailwindConfig = tailwindConfig.replace(
- 'content: []',
- "content: ['src/**/*.{js,jsx,ts,tsx}']"
- )
- fs.writeFileSync(tailwindConfigPath, newTailwindConfig)
+ await execa('yarn', ['tailwindcss', 'init', tailwindConfigPath], {
+ cwd: rwPaths.web.base,
+ })
+
+ // Replace `content`.
+ const tailwindConfig = fs.readFileSync(tailwindConfigPath, 'utf-8')
+ const newTailwindConfig = tailwindConfig.replace(
+ 'content: []',
+ "content: ['src/**/*.{js,jsx,ts,tsx}']"
+ )
+ fs.writeFileSync(tailwindConfigPath, newTailwindConfig)
+ },
},
- },
- {
- title: 'Adding import to index.css...',
- task: (_ctx, task) => {
- const INDEX_CSS_PATH = path.join(rwPaths.web.src, 'index.css')
- const indexCSS = fs.readFileSync(INDEX_CSS_PATH, 'utf-8')
+ {
+ title: 'Adding import to index.css...',
+ task: (_ctx, task) => {
+ const INDEX_CSS_PATH = path.join(rwPaths.web.src, 'index.css')
+ const indexCSS = fs.readFileSync(INDEX_CSS_PATH, 'utf-8')
- if (tailwindImportsExist(indexCSS)) {
- task.skip('Imports already exist in index.css')
- } else {
- const newIndexCSS = tailwindImportsAndNotes.join('\n') + indexCSS
- fs.writeFileSync(INDEX_CSS_PATH, newIndexCSS)
- }
+ if (tailwindImportsExist(indexCSS)) {
+ task.skip('Imports already exist in index.css')
+ } else {
+ const newIndexCSS = tailwindImportsAndNotes.join('\n') + indexCSS
+ fs.writeFileSync(INDEX_CSS_PATH, newIndexCSS)
+ }
+ },
},
- },
- {
- title: 'Adding recommended VS Code extensions...',
- task: (_ctx, task) => {
- const VS_CODE_EXTENSIONS_PATH = path.join(
- rwPaths.base,
- '.vscode/extensions.json'
- )
+ {
+ title: 'Adding recommended VS Code extensions...',
+ task: (_ctx, task) => {
+ const VS_CODE_EXTENSIONS_PATH = path.join(
+ rwPaths.base,
+ '.vscode/extensions.json'
+ )
- if (!usingVSCode()) {
- task.skip("Looks like your're not using VS Code")
- } else {
- let originalExtensionsJson = { recommendations: [] }
- if (fs.existsSync(VS_CODE_EXTENSIONS_PATH)) {
- const originalExtensionsFile = fs.readFileSync(
+ if (!usingVSCode()) {
+ task.skip("Looks like your're not using VS Code")
+ } else {
+ let originalExtensionsJson = { recommendations: [] }
+ if (fs.existsSync(VS_CODE_EXTENSIONS_PATH)) {
+ const originalExtensionsFile = fs.readFileSync(
+ VS_CODE_EXTENSIONS_PATH,
+ 'utf-8'
+ )
+ originalExtensionsJson = JSON.parse(originalExtensionsFile)
+ }
+ const newExtensionsJson = {
+ ...originalExtensionsJson,
+ recommendations: [
+ ...originalExtensionsJson.recommendations,
+ ...recommendedVSCodeExtensions,
+ ],
+ }
+ fs.writeFileSync(
VS_CODE_EXTENSIONS_PATH,
- 'utf-8'
+ JSON.stringify(newExtensionsJson, null, 2)
)
- originalExtensionsJson = JSON.parse(originalExtensionsFile)
}
- const newExtensionsJson = {
- ...originalExtensionsJson,
- recommendations: [
- ...originalExtensionsJson.recommendations,
- ...recommendedVSCodeExtensions,
- ],
- }
- fs.writeFileSync(
- VS_CODE_EXTENSIONS_PATH,
- JSON.stringify(newExtensionsJson, null, 2)
- )
- }
+ },
},
- },
- {
- title: 'Adding tailwind config entry in prettier...',
- task: async (_ctx) => {
- const prettierConfigPath = path.join(rwPaths.base, 'prettier.config.js')
- // Add tailwindcss ordering plugin to prettier
- const prettierConfig = fs.readFileSync(prettierConfigPath, 'utf-8')
- const tailwindConfigPath = path
- .relative(
+ {
+ title: 'Adding tailwind config entry in prettier...',
+ task: async (_ctx) => {
+ const prettierConfigPath = path.join(
rwPaths.base,
- path.posix.join(rwPaths.web.config, 'tailwind.config.js')
+ 'prettier.config.js'
)
- .replaceAll('\\', '/')
-
- let newPrettierConfig = prettierConfig
- if (newPrettierConfig.includes('tailwindConfig: ')) {
- if (force) {
- newPrettierConfig = newPrettierConfig.replace(
- /tailwindConfig: .*(,)?/,
- `tailwindConfig: './${tailwindConfigPath}',`
+ // Add tailwindcss ordering plugin to prettier
+ const prettierConfig = fs.readFileSync(prettierConfigPath, 'utf-8')
+ const tailwindConfigPath = path
+ .relative(
+ rwPaths.base,
+ path.posix.join(rwPaths.web.config, 'tailwind.config.js')
)
+ .replaceAll('\\', '/')
+
+ let newPrettierConfig = prettierConfig
+ if (newPrettierConfig.includes('tailwindConfig: ')) {
+ if (force) {
+ newPrettierConfig = newPrettierConfig.replace(
+ /tailwindConfig: .*(,)?/,
+ `tailwindConfig: './${tailwindConfigPath}',`
+ )
+ } else {
+ throw new Error(
+ 'tailwindConfig setting already exists in prettier configuration.\nUse --force to override existing config.'
+ )
+ }
} else {
- throw new Error(
- 'tailwindConfig setting already exists in prettier configuration.\nUse --force to override existing config.'
+ newPrettierConfig = newPrettierConfig.replace(
+ /,(\n\s*)(\}\n?)$/,
+ `,\n tailwindConfig: './${tailwindConfigPath}',$1$2`
)
}
- } else {
- newPrettierConfig = newPrettierConfig.replace(
- /,(\n\s*)(\}\n?)$/,
- `,\n tailwindConfig: './${tailwindConfigPath}',$1$2`
- )
- }
- fs.writeFileSync(prettierConfigPath, newPrettierConfig)
+ fs.writeFileSync(prettierConfigPath, newPrettierConfig)
+ },
},
- },
- {
- title: 'Adding tailwind prettier plugin...',
- task: async (_ctx, task) => {
- const prettierConfigPath = path.join(rwPaths.base, 'prettier.config.js')
- // Add tailwindcss ordering plugin to prettier
- const prettierConfig = fs.readFileSync(prettierConfigPath, 'utf-8')
-
- let newPrettierConfig = prettierConfig
- if (newPrettierConfig.includes('plugins: [')) {
- const pluginsMatch = newPrettierConfig.match(
- /plugins: \[[\sa-z\(\)'\-,]*]/
+ {
+ title: 'Adding tailwind prettier plugin...',
+ task: async (_ctx, task) => {
+ const prettierConfigPath = path.join(
+ rwPaths.base,
+ 'prettier.config.js'
)
+ // Add tailwindcss ordering plugin to prettier
+ const prettierConfig = fs.readFileSync(prettierConfigPath, 'utf-8')
+
+ let newPrettierConfig = prettierConfig
+ if (newPrettierConfig.includes('plugins: [')) {
+ const pluginsMatch = newPrettierConfig.match(
+ /plugins: \[[\sa-z\(\)'\-,]*]/
+ )
- const matched = pluginsMatch && pluginsMatch[0]
+ const matched = pluginsMatch && pluginsMatch[0]
- if (
- matched &&
- (matched.includes("require('prettier-plugin-tailwindcss')") ||
- matched.includes('require("prettier-plugin-tailwindcss")'))
- ) {
- task.skip('tailwindcss-plugin-prettier already required in plugins')
+ if (
+ matched &&
+ (matched.includes("require('prettier-plugin-tailwindcss')") ||
+ matched.includes('require("prettier-plugin-tailwindcss")'))
+ ) {
+ task.skip(
+ 'tailwindcss-plugin-prettier already required in plugins'
+ )
+ } else {
+ newPrettierConfig = newPrettierConfig.replace(
+ /plugins: \[(\n\s+)*/,
+ `plugins: [$1require('prettier-plugin-tailwindcss'),$1`
+ )
+ }
} else {
newPrettierConfig = newPrettierConfig.replace(
- /plugins: \[(\n\s+)*/,
- `plugins: [$1require('prettier-plugin-tailwindcss'),$1`
+ /,(\n\s*)(\}\n?)$/,
+ `,\n plugins: [require('prettier-plugin-tailwindcss')],$1$2`
)
}
- } else {
- newPrettierConfig = newPrettierConfig.replace(
- /,(\n\s*)(\}\n?)$/,
- `,\n plugins: [require('prettier-plugin-tailwindcss')],$1$2`
- )
- }
- fs.writeFileSync(prettierConfigPath, newPrettierConfig)
+ fs.writeFileSync(prettierConfigPath, newPrettierConfig)
+ },
},
- },
- ])
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/ui/libraries/windicss.js b/packages/cli/src/commands/setup/ui/libraries/windicss.js
index b70b935de0b2..0af8611881e5 100644
--- a/packages/cli/src/commands/setup/ui/libraries/windicss.js
+++ b/packages/cli/src/commands/setup/ui/libraries/windicss.js
@@ -2,7 +2,7 @@ import fs from 'fs'
import path from 'path'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -35,102 +35,114 @@ export const handler = async ({ force, install }) => {
const packages = ['windicss-webpack-plugin', 'windicss']
- const tasks = new Listr([
- {
- title: 'Installing packages...',
- skip: () => !install,
- task: () => {
- return new Listr([
- {
- title: `Install ${packages.join(', ')}`,
- task: async () => {
- await execa('yarn', [
- 'workspace',
- 'web',
- 'add',
- '-D',
- ...packages,
- ])
- },
- },
- ])
+ const tasks = new Listr(
+ [
+ {
+ title: 'Installing packages...',
+ skip: () => !install,
+ task: () => {
+ return new Listr(
+ [
+ {
+ title: `Install ${packages.join(', ')}`,
+ task: async () => {
+ await execa('yarn', [
+ 'workspace',
+ 'web',
+ 'add',
+ '-D',
+ ...packages,
+ ])
+ },
+ },
+ ],
+ { rendererOptions: { collapse: false } }
+ )
+ },
},
- },
- {
- title: 'Setup Webpack...',
- task: () => {
- return new Listr([
- {
- title: 'Setup Webpack',
- task: async () => {
- await execa('yarn', ['redwood', 'setup', 'webpack'])
- },
- },
- {
- title: 'Configure WindiCSS',
- task: async () => {
- const webpackConfig = fs.readFileSync(
- rwPaths.web.webpack,
- 'utf-8'
- )
- const newWebpackConfig =
- `const WindiCSSWebpackPlugin = require('windicss-webpack-plugin')\n\n` +
- webpackConfig.replace(
- '// config.plugins.push(YOUR_PLUGIN)',
- '// config.plugins.push(YOUR_PLUGIN)\n config.plugins.push(new WindiCSSWebpackPlugin())'
- )
- fs.writeFileSync(rwPaths.web.webpack, newWebpackConfig)
- },
- },
- ])
+ {
+ title: 'Setup Webpack...',
+ task: () => {
+ return new Listr(
+ [
+ {
+ title: 'Setup Webpack',
+ task: async () => {
+ await execa('yarn', ['redwood', 'setup', 'webpack'])
+ },
+ },
+ {
+ title: 'Configure WindiCSS',
+ task: async () => {
+ const webpackConfig = fs.readFileSync(
+ rwPaths.web.webpack,
+ 'utf-8'
+ )
+ const newWebpackConfig =
+ `const WindiCSSWebpackPlugin = require('windicss-webpack-plugin')\n\n` +
+ webpackConfig.replace(
+ '// config.plugins.push(YOUR_PLUGIN)',
+ '// config.plugins.push(YOUR_PLUGIN)\n config.plugins.push(new WindiCSSWebpackPlugin())'
+ )
+ fs.writeFileSync(rwPaths.web.webpack, newWebpackConfig)
+ },
+ },
+ ],
+ { rendererOptions: { collapse: false } }
+ )
+ },
},
- },
- {
- title: 'Initializing WindiCSS...',
- task: async () => {
- const windiConfigPath = path.join(rwPaths.web.config, 'windi.config.js')
+ {
+ title: 'Initializing WindiCSS...',
+ task: async () => {
+ const windiConfigPath = path.join(
+ rwPaths.web.config,
+ 'windi.config.js'
+ )
- if (fs.existsSync(windiConfigPath)) {
- if (force) {
- fs.unlinkSync(windiConfigPath)
- } else {
- throw new Error(
- 'Windicss config already exists.\nUse --force to override existing config.'
- )
+ if (fs.existsSync(windiConfigPath)) {
+ if (force) {
+ fs.unlinkSync(windiConfigPath)
+ } else {
+ throw new Error(
+ 'Windicss config already exists.\nUse --force to override existing config.'
+ )
+ }
}
- }
- const windiConfig = [
- "import { defineConfig } from 'windicss/helpers'",
- '',
- 'export default defineConfig({',
- ' extract: {',
- " include: ['**/*.{js,jsx,tsx,css}'],",
- " exclude: ['node_modules', '.git', 'dist'],",
- ' },',
- '})',
- ].join('\n')
- fs.writeFileSync(windiConfigPath, windiConfig)
+ const windiConfig = [
+ "import { defineConfig } from 'windicss/helpers'",
+ '',
+ 'export default defineConfig({',
+ ' extract: {',
+ " include: ['**/*.{js,jsx,tsx,css}'],",
+ " exclude: ['node_modules', '.git', 'dist'],",
+ ' },',
+ '})',
+ ].join('\n')
+ fs.writeFileSync(windiConfigPath, windiConfig)
+ },
},
- },
- {
- title: `Adding import to ${rwPaths.web.app}...`,
- task: (_ctx, task) => {
- const APP_FILE_PATH = rwPaths.web.app
- const appFile = fs.readFileSync(APP_FILE_PATH, 'utf-8')
+ {
+ title: `Adding import to ${rwPaths.web.app}...`,
+ task: (_ctx, task) => {
+ const APP_FILE_PATH = rwPaths.web.app
+ const appFile = fs.readFileSync(APP_FILE_PATH, 'utf-8')
- if (windiImportsExist(appFile)) {
- task.skip('Imports already exist in ' + APP_FILE_PATH)
- } else {
- const newAppFile = appFile.replace(
- "import Routes from 'src/Routes'",
- "import Routes from 'src/Routes'\n\nimport 'windi.css'"
- )
- fs.writeFileSync(APP_FILE_PATH, newAppFile)
- }
+ if (windiImportsExist(appFile)) {
+ task.skip('Imports already exist in ' + APP_FILE_PATH)
+ } else {
+ const newAppFile = appFile.replace(
+ "import Routes from 'src/Routes'",
+ "import Routes from 'src/Routes'\n\nimport 'windi.css'"
+ )
+ fs.writeFileSync(APP_FILE_PATH, newAppFile)
+ }
+ },
},
- },
- ])
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/setup/webpack/webpack.js b/packages/cli/src/commands/setup/webpack/webpack.js
index 118c2b3b9ccd..d8dec75acbc4 100644
--- a/packages/cli/src/commands/setup/webpack/webpack.js
+++ b/packages/cli/src/commands/setup/webpack/webpack.js
@@ -2,7 +2,7 @@ import fs from 'fs'
import path from 'path'
import chalk from 'chalk'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -22,27 +22,32 @@ export const builder = (yargs) => {
}
export const handler = async ({ force }) => {
- const tasks = new Listr([
- {
- title: 'Adding webpack file to your web folder...',
- task: () => {
- const webpackConfigFile = `${getPaths().web.config}/webpack.config.js`
+ const tasks = new Listr(
+ [
+ {
+ title: 'Adding webpack file to your web folder...',
+ task: () => {
+ const webpackConfigFile = `${getPaths().web.config}/webpack.config.js`
- return writeFile(
- webpackConfigFile,
- fs
- .readFileSync(
- path.resolve(__dirname, 'templates', 'webpack.config.js.template')
- )
- .toString(),
- { overwriteExisting: force }
- )
+ return writeFile(
+ webpackConfigFile,
+ fs
+ .readFileSync(
+ path.resolve(
+ __dirname,
+ 'templates',
+ 'webpack.config.js.template'
+ )
+ )
+ .toString(),
+ { overwriteExisting: force }
+ )
+ },
},
- },
- {
- title: 'One more thing...',
- task: (_ctx, task) => {
- task.title = `One more thing...\n
+ {
+ title: 'One more thing...',
+ task: (_ctx, task) => {
+ task.title = `One more thing...\n
${c.green(
'Quick link to the docs on configuring custom webpack config:'
)}
@@ -50,9 +55,11 @@ export const handler = async ({ force }) => {
'https://redwoodjs.com/docs/webpack-configuration#configuring-webpack'
)}
`
+ },
},
- },
- ])
+ ],
+ { rendererOptions: { collapse: false } }
+ )
try {
await tasks.run()
diff --git a/packages/cli/src/commands/type-checkHandler.js b/packages/cli/src/commands/type-checkHandler.js
index 01a9c743852e..09d815cf33c6 100644
--- a/packages/cli/src/commands/type-checkHandler.js
+++ b/packages/cli/src/commands/type-checkHandler.js
@@ -2,7 +2,7 @@ import path from 'path'
import concurrently from 'concurrently'
import execa from 'execa'
-import Listr from 'listr'
+import { Listr } from 'listr2'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -58,16 +58,19 @@ export const handler = async ({ sides, verbose, prisma, generate }) => {
})
}
if (generate) {
- await new Listr([
- {
- title: 'Generating types',
- task: () =>
- execa('yarn rw-gen', {
- shell: true,
- stdio: verbose ? 'inherit' : 'ignore',
- }),
- },
- ]).run()
+ await new Listr(
+ [
+ {
+ title: 'Generating types',
+ task: () =>
+ execa('yarn rw-gen', {
+ shell: true,
+ stdio: verbose ? 'inherit' : 'ignore',
+ }),
+ },
+ ],
+ { renderer: verbose && 'verbose', rendererOptions: { collapse: false } }
+ ).run()
}
const exitCode = await typeCheck()
diff --git a/packages/cli/src/commands/upgrade.js b/packages/cli/src/commands/upgrade.js
index c2cb6c016fea..402c8b4d1f48 100644
--- a/packages/cli/src/commands/upgrade.js
+++ b/packages/cli/src/commands/upgrade.js
@@ -3,8 +3,7 @@ import path from 'path'
import execa from 'execa'
import latestVersion from 'latest-version'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import terminalLink from 'terminal-link'
import { errorTelemetry } from '@redwoodjs/telemetry'
@@ -131,7 +130,7 @@ export const handler = async ({ dryRun, tag, verbose, dedupe }) => {
},
},
],
- { collapse: false, renderer: verbose && VerboseRenderer }
+ { renderer: verbose && 'verbose', rendererOptions: { collapse: false } }
)
try {
diff --git a/packages/cli/src/lib/index.js b/packages/cli/src/lib/index.js
index 213befd6dcdd..86053dcf96e1 100644
--- a/packages/cli/src/lib/index.js
+++ b/packages/cli/src/lib/index.js
@@ -6,8 +6,7 @@ import * as babel from '@babel/core'
import camelcase from 'camelcase'
import decamelize from 'decamelize'
import execa from 'execa'
-import Listr from 'listr'
-import VerboseRenderer from 'listr-verbose-renderer'
+import { Listr } from 'listr2'
import { memoize } from 'lodash'
import lodash from 'lodash/string'
import { paramCase } from 'param-case'
@@ -469,8 +468,8 @@ export const runCommandTask = async (commands, { verbose }) => {
},
})),
{
- renderer: verbose && VerboseRenderer,
- dateFormat: false,
+ renderer: verbose && 'verbose',
+ rendererOptions: { collapse: false, dateFormat: false },
}
)
diff --git a/yarn.lock b/yarn.lock
index 94fb9a323c77..3d1f20084582 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6273,8 +6273,7 @@ __metadata:
fs-extra: 10.1.0
jest: 29.1.2
latest-version: 5.1.0
- listr: 0.14.3
- listr-verbose-renderer: 0.6.0
+ listr2: 5.0.5
lodash: 4.17.21
param-case: 3.0.4
pascalcase: 1.0.0
@@ -12954,10 +12953,10 @@ __metadata:
languageName: node
linkType: hard
-"colorette@npm:^2.0.10, colorette@npm:^2.0.14, colorette@npm:^2.0.16":
- version: 2.0.16
- resolution: "colorette@npm:2.0.16"
- checksum: 7430bd996545347f262ae9716bfc8ca3776606e9db854279082004f3141b15a64ad2ee0e4f10cacba5a07cc92ca3edc2d01cbe73fd2843ccd80e98d0e3a8e79b
+"colorette@npm:^2.0.10, colorette@npm:^2.0.14, colorette@npm:^2.0.16, colorette@npm:^2.0.19":
+ version: 2.0.19
+ resolution: "colorette@npm:2.0.19"
+ checksum: 2bcc9134095750fece6e88167011499b964b78bf0ea953469130ddb1dba3c8fe6c03debb0ae181e710e2be10900d117460f980483a7df4ba4a1bac3b182ecb64
languageName: node
linkType: hard
@@ -14239,7 +14238,7 @@ __metadata:
languageName: node
linkType: hard
-"date-fns@npm:^2.0.1, date-fns@npm:^2.16.1":
+"date-fns@npm:^2.16.1":
version: 2.28.0
resolution: "date-fns@npm:2.28.0"
checksum: ecdacd36326e7f5f8c4f1e78ae931a8997109f1c841f5163053b866585ca899521b0e7a114eeb48a9fe5135a550787bd4bbd8baa321cded0b4d823f847889a80
@@ -21417,18 +21416,6 @@ __metadata:
languageName: node
linkType: hard
-"listr-verbose-renderer@npm:0.6.0":
- version: 0.6.0
- resolution: "listr-verbose-renderer@npm:0.6.0"
- dependencies:
- chalk: ^2.4.1
- cli-cursor: ^2.1.0
- date-fns: ^2.0.1
- figures: ^2.0.0
- checksum: 3e81779c84e031ac0c4f637521185e83c687dcdd5fcaedc5e928e9dfe2e1372fea9f9c8c311a5b0c0db67eba5df570a3b4131ca63b02027f9635577cca61c81d
- languageName: node
- linkType: hard
-
"listr-verbose-renderer@npm:^0.5.0":
version: 0.5.0
resolution: "listr-verbose-renderer@npm:0.5.0"
@@ -21441,6 +21428,27 @@ __metadata:
languageName: node
linkType: hard
+"listr2@npm:5.0.5":
+ version: 5.0.5
+ resolution: "listr2@npm:5.0.5"
+ dependencies:
+ cli-truncate: ^2.1.0
+ colorette: ^2.0.19
+ log-update: ^4.0.0
+ p-map: ^4.0.0
+ rfdc: ^1.3.0
+ rxjs: ^7.5.6
+ through: ^2.3.8
+ wrap-ansi: ^7.0.0
+ peerDependencies:
+ enquirer: ">= 2.3.0 < 3"
+ peerDependenciesMeta:
+ enquirer:
+ optional: true
+ checksum: 293eea149301ca95822359af647ef8238cbb0a052287a4bf3bb6811802b66afd21117b6c5a391a4c0356b9dff41ad9324b159f49bd3c78562b6bc8b1fd8d988a
+ languageName: node
+ linkType: hard
+
"listr2@npm:^3.8.3":
version: 3.14.0
resolution: "listr2@npm:3.14.0"
@@ -27305,12 +27313,12 @@ __metadata:
languageName: node
linkType: hard
-"rxjs@npm:^7.0.0, rxjs@npm:^7.5.1, rxjs@npm:^7.5.5":
- version: 7.5.6
- resolution: "rxjs@npm:7.5.6"
+"rxjs@npm:^7.0.0, rxjs@npm:^7.5.1, rxjs@npm:^7.5.5, rxjs@npm:^7.5.6":
+ version: 7.5.7
+ resolution: "rxjs@npm:7.5.7"
dependencies:
tslib: ^2.1.0
- checksum: d8077fb4a06c05f52fcc974ab9884d163924b8085c661c92030a522920510bf0c75583caee70409ab11992320c31f562f5402afe8b81255370c09773209fec5c
+ checksum: 283620b3c90b85467c3549f7cda0dd768bc18719cccbbdd9aacadb0f0946827ab20d036f1a00d78066d769764e73070bfee8706091d77b8d971975598f6cbbd4
languageName: node
linkType: hard