Releases: crayon-js/crayon
Releases · crayon-js/crayon
Crayon 2.2.0
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
andrgb -> 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
- Fixed type definiton of adding aliases
- Updated README for Deno
Crayon 2.1
Added support for 🦕 Deno
Crayon 2.0
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 - maincrayon.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
)
Deno Release 1.0.0
Make crayon.js work on deno
Release 1.1
- Added support for template literals
- Fixed invalid color conversion
- Added jest coverage test