Skip to content

Releases: crayon-js/crayon

Crayon 2.2.0

15 May 11:42
Compare
Choose a tag to compare

Breaking changes:

+ const x = crayon as any as Crayon<...>
- const x = crayon as Crayon<...>

Improvements:

  • Fixed issue with overwriting config properties
  • Fixed issues with extending styles
  • Improved rgb -> ansi8 and rgb -> ansi4 color conversion
  • Improved typings, in addition to extending styles it's now possible to extend functions and their typings:
    import crayon from 'crayon.js';
    import { Crayon } from 'crayon.js/lib/types';
    /*
      Styles - Template Literal Type
        example: 'gray' | 'grey'
        default: void
      Functions - Template Literal Type
        example: 'rainbowize' | 'somethingelse'
        default: void
      Object - object
        example: {
            rainbowize: (shift: number) => Crayon<Styles, Functions, Object>
        }
        default: void
     */
   type Styles = 'gray' | 'grey';
   type Functions = 'somethingelse';
   type Object = {
       rainbowize: (shift: number) => Crayon<Styles, Functions, Object>
   };

   const typedCrayon = crayon as any as Crayon<Styles, Functions, Object>;
  // now typedCrayon has autocompletion for gray, grey, somethingelse (no arguments autocompletion) and rainbowize

Crayon 2.1.1

10 May 09:27
Compare
Choose a tag to compare
  • Fixed type definiton of adding aliases
  • Updated README for Deno

Crayon 2.1

08 May 10:31
Compare
Choose a tag to compare

Added support for 🦕 Deno

Crayon 2.0

06 May 14:21
Compare
Choose a tag to compare

Crayon 2.0 ships with many bugfixes and some interesting changes.

Breaking changes

  • CSS Keywords are now shipped as extension in @crayon.js/keywords package, see here and here.
  • Color support detection is now shipped as extension in @crayon.js/color-support package, see here and here.
  • Crayon.js is now ES Module instead of CommonJS
  • - crayon.colorSupport
    + crayon.config.colorSupport
  • @crayon.js/lite is deprecated - main crayon.js package is now the same out of the box without using extension packages.

Improvements

  • Fixed style caching
  • Nesting and chaining styles has been improved and fixed (also in literal templates)
  • Added support for chaining and functions for literal templates
  • Cleaned up type definitions
  • Functions and variables are now reusable to user and can be easily extended (look here):
  • Created Wiki
  • Using defineProperty instead of Proxies
  • Hugely improved performance
  • Lower package size (even when combined with @crayon.js/color-support and @crayon.js/keywords)

All changes

Deno Release 1.0.0

12 Apr 15:44
Compare
Choose a tag to compare

Make crayon.js work on deno

Release 1.1

11 Apr 21:58
Compare
Choose a tag to compare
  • Added support for template literals
  • Fixed invalid color conversion
  • Added jest coverage test