ESM only and a rewrite from scratch
Pre-releaseBreaking changes
-
This release changes the styling for a lot of elements. Which directly is not a breaking change, but the output will look different from how it used to look earlier.
-
The
CLI_UI_IS_TESTING
environment variable is no longer entertained. Instead, you must instantiate thecliui
function in raw mode when writing tests. -
The
tasks.verbose
method has been removed. Instead usetasks({ verbose: true })
. -
The
/api
module has been removed. The main module is the only module you have to import now. -
The
actions
class no longer accepts a message forsuccedded
,failed
andskipped
method calls. The message is passed at the time of creating the action.// Earlier logger.action('CREATE').succeeded('config/auth.ts') // Now logger.action('Creating config/auth.ts').succeeded()
-
Package main module now has only one default export. Earlier it was multiple named exports for all the UI elements.
// Earlier import { logger, colors, table } from '@poppinss/cliui'
// Now import cliui from '@poppinss/cliui' const { logger, colors, table } = cliui()
-
The logger methods now accepts an options object with
suffix
andprefix
. Earlier they are passed as idependent arguments.// Earlier - logger.info('downloading packages', undefined, 'npm i') // Now + logger.info('downloading packages', { suffix: 'npm i' })
-
The
logUpdateDone
method has been replaced withlogUpdatePersist
-
The
renderer.logs
property has been replaced withrenderer.getLogs()
-
Types are exported from a submodule
@poppinss/cliui/types
. -
The
task.complete
andtask.failed
methods have been removed. Either you can return a string value to mark the task as passed. Or return/throw an Error to mark it as failed.
Note: The library earlier was doing too many checks with
supportsColor
,testing
, andisInteractive
flags. Now they all have been removed. During testing you need to turn on the raw modecliui({ raw: true })
and the support for colors is detected internally.
If you face any other breaking change not covered in this changelog, then please create an issue for the same.
Commits
- fix: types errors 3085911
- docs: update package description 7e45d7e
- test: update assertion check to be more flexible fbe1214
- refactor: update logger actions to consistently display action status as label 960a954
- test: conver path to url when importing test files 3121e55
- refactor: complete rewrite in ESM 81d53c6
Full Changelog: v3.0.5...v4.0.0-0