Skip to content

Introduce modes and add ability to switch mode of UI primitives

Pre-release
Pre-release

Choose a tag to compare

@thetutlage thetutlage released this 28 Dec 06:01

Breaking change

Earlier the cliui function accepted { raw: boolean; silent: boolean } options. These options are mutually exclusive and cannot be used together. Therefore, in this release we remove these options and introduce a single mode option.

  • mode = raw means we want to collect all logs in memory and disable transformations
  • mode = silent means we want to disable colors.
  • mode = normal means turn off special modes.

New feature

Also, the UI primitives can toggle the mode after the UI kit has been instantiated.

const ui = cliui()
ui.switchMode('silent')

// Applies no transformation
ui.colors.green('hello world')

Commits

  • ci: force colors when running tests a50e1d3
  • feat: add ability to switch renderer, colors and mode of ui primitives 995b937

Full Changelog: v5.1.0-0...v6.0.0-0