Skip to content

Releases: anru/signales

Polish typescript support

31 Mar 11:02
c2eef9f
Compare
Choose a tag to compare

Get rid of found TS issues

Typescripted

28 Jan 12:26
61b14ba
Compare
Choose a tag to compare

In this release signales:

  • Was rewritten in Typescript entirely, so Signales typings are generated by the compiler, not written by hand.
    This gives 100% consistency between the types and the actual runtime.
  • New methods: child, clone.
  • New options: scopeFormatter.
  • stderr stream by default instead of stdout.

Migration guide to v2.0.0

Named imports

If you use direct import signales in commonjs you should migrate to named imports:

// replace this
const signale = require('signales') // doesn't work

// to this
const { signale } = require('signales') // ok

If you use ES modules there is no action to do.

stderr stream by default

Also, by default, signales writes messages to stderr as of version 2.0.0.
In order use stdout stream pass that intention explicitly:

import { Signale } from 'signales'

const signale = new Signale({ stream: process.stdout })

New scopes formatting

Scope formatting was changed. Old formatter:

signale.scope('foo', 'bar').success('hello')
//=> //=> [foo] [bar] › ✔  success  hello

New formatter:

signale.scope('foo', 'bar').success('hello')
//=> //=> [foo::bar] › ✔  success  hello

In order to return to old formmater you can use new scopeFormatter option
and built-in Signales.barsScopeFormatter formatter:

import { Signales } from 'signales'

const logger = new Signales({ scopeFormatter: Signales.barsScopeFormatter, scope: ['foo', 'bar'] })
logger.success('hello')
//=> [foo] [bar] › ✔  success  hello