Skip to content

Commit

Permalink
chore: add rollup-plugin-cleanup to remove comments from d.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
webdiscus committed Apr 8, 2024
1 parent d94f80a commit c797844
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 79 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log

## 3.0.3 (2024-04-09)

- chore: add rollup-plugin-cleanup to remove comments from d.ts file for dist, that save yet 3 KB
- chore: update license year

## 3.0.2 (2024-04-08)

- chore: create mini version of README for NPM to minify package size
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2023, webdiscus
Copyright (c) 2024, webdiscus

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
45 changes: 12 additions & 33 deletions README.npm.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<div align="center">
<h1 align="center">
<a href="https://github.com/webdiscus/ansis">
<img width="323" src="docs/img/ansis-logo.png" alt="ansis"><br>
ANSI Styling
</a>
</h1>
</div>

<p align="center">
<a href="https://github.com/webdiscus/ansis">
<img width="323" src="docs/img/ansis-logo.png" alt="ansis"><br>
<font size="5">ANSI Styling</font>
</a>
</p>

---
[![node](https://img.shields.io/node/v/ansis)](https://nodejs.org)
[![Test](https://github.com/webdiscus/ansis/actions/workflows/test.yml/badge.svg)](https://github.com/webdiscus/ansis/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/webdiscus/ansis/branch/master/graph/badge.svg?token=H7SFJONX1X)](https://codecov.io/gh/webdiscus/ansis)
[![node](https://img.shields.io/npm/dm/ansis)](https://www.npmjs.com/package/ansis)

The Node.js library to colorize terminal with ANSI colors & styles, **smaller** and **faster** alternative to [Chalk][chalk].
The Node.js library to colorize terminal with ANSI colors & styles, **smaller** and **faster** alternative to [Chalk](https://github.com/chalk/chalk).

#### Usage example

Expand All @@ -28,12 +27,12 @@ hex('#E0115F').bold.underline('Hello TrueColor!')
```

🚀 [Install and Quick Start](https://github.com/webdiscus/ansis#install)\
📖 [Read full docs on GitHub][ansis]
📖 [Read full docs on GitHub](https://github.com/webdiscus/ansis)

## 🏆 Compare & Benchmark

See the [features comparison](https://github.com/webdiscus/ansis#compare) and [benchmarks](https://github.com/webdiscus/ansis#benchmark) of most popular terminal colors libraries:\
[ansis][ansis], [chalk][chalk], [kleur][kleur], [kolorist][kolorist], [colors.js][colors.js], [colorette][colorette], [picocolors][picocolors], [ansi-colors][ansi-colors], [cli-color][cli-color], [colors-cli][colors-cli].
`ansis` `chalk` `kleur` `kolorist` `colors.js` `colorette` `picocolors` `ansi-colors` `cli-color` `colors-cli`.

## 💡 Highlights

Expand All @@ -50,7 +49,7 @@ See the [features comparison](https://github.com/webdiscus/ansis#compare) and [b
- [Base ANSI 16 colors](https://github.com/webdiscus/ansis#base-colors) ``` red`Error!` ``` ``` redBright`Error!` ``` ``` bgRed`Error!` ``` ``` bgRedBright`Error!` ```
- [ANSI 256 colors](https://github.com/webdiscus/ansis#256-colors) ``` fg(56)`violet` ``` ``` bg(208)`orange` ```
- [TrueColor](https://github.com/webdiscus/ansis#truecolor) (**RGB**, **HEX**) ``` rgb(224, 17, 95)`Ruby` ```, ``` hex('#96C')`Amethyst` ```
- [Fallback](https://github.com/webdiscus/ansis#fallback) to supported [color space](https://github.com/webdiscus/ansis#color-support): TrueColor —> 256 colors —> 16 colors —> no
- [Fallback](https://github.com/webdiscus/ansis#fallback) to supported color space: TrueColor —> 256 colors —> 16 colors —> no
colors
- [ANSI codes](https://github.com/webdiscus/ansis#escape-codes) as `open` and `close` properties ``` `Hello ${red.open}World${red.close}!` ```
- [Strip ANSI codes](https://github.com/webdiscus/ansis#strip) method `ansis.strip()`
Expand All @@ -62,23 +61,3 @@ See the [features comparison](https://github.com/webdiscus/ansis#compare) and [b
## License

[ISC](https://github.com/webdiscus/ansis/blob/master/LICENSE)

[colors.js]: https://github.com/Marak/colors.js

[colorette]: https://github.com/jorgebucaran/colorette

[picocolors]: https://github.com/alexeyraspopov/picocolors

[cli-color]: https://github.com/medikoo/cli-color

[colors-cli]: https://github.com/jaywcjlove/colors-cli

[ansi-colors]: https://github.com/doowb/ansi-colors

[kleur]: https://github.com/lukeed/kleur

[kolorist]: https://github.com/marvinhagemeister/kolorist

[chalk]: https://github.com/chalk/chalk

[ansis]: https://github.com/webdiscus/ansis
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ansis",
"version": "3.0.2",
"description": "Colorize text in terminal and console output with ANSI colors & styles",
"version": "3.0.3",
"description": "Colorize terminal with ANSI colors & styles",
"keywords": [
"ansi",
"colour",
Expand Down Expand Up @@ -94,6 +94,7 @@
"ansis": "file:dist",
"prettier": "^3.2.5",
"rollup": "^4.13.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-dts": "^6.1.0",
"terser": "^5.30.0",
Expand Down
51 changes: 8 additions & 43 deletions pkg/package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,20 @@
{
"name": "ansis",
"version": "3.0.2",
"description": "Colorize text in terminal and console output with ANSI colors & styles",
"version": "3.0.3",
"description": "Colorize terminal with ANSI colors & styles",
"keywords": [
"ansi",
"colour",
"color",
"colors",
"styles",
"truecolor",
"ansi256",
"terminal",
"xterm",
"console",
"cli",
"log",
"logging",
"strip-color",
"truecolor",
"rgb",
"red",
"green",
"yellow",
"blue",
"magenta",
"cyan",
"FORCE_COLOR",
"NO_COLOR",
"ansi-colors",
"chalk",
"colorette",
"colors.js",
"kleur",
"picocolors"
"chalk"
],
"license": "ISC",
"author": "webdiscus (https://github.com/webdiscus)",
"maintainers": [
"webdiscus (https://github.com/webdiscus)"
],
"funding": {
"type": "patreon",
"url": "https://patreon.com/biodiscus"
},
"author": "webdiscus",
"homepage": "https://github.com/webdiscus/ansis",
"bugs": {
"url": "https://github.com/webdiscus/ansis/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/webdiscus/ansis.git"
},
"repository": "webdiscus/ansis",
"sideEffects": false,
"main": "./index.js",
"types": "./index.d.ts",
Expand All @@ -74,6 +40,5 @@
"package.json",
"LICENSE",
"README.md"
],
"dependencies": {}
]
}
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import terser from '@rollup/plugin-terser';
import replace from '@rollup/plugin-replace';
import cleanup from 'rollup-plugin-cleanup';
import copy from 'rollup-plugin-copy';
import dts from 'rollup-plugin-dts';
import { minify } from 'terser';
Expand Down Expand Up @@ -60,6 +61,7 @@ export default [
},
],
plugins: [
cleanup({ extensions: ['ts'] }),
dts(),
],
},
Expand Down

0 comments on commit c797844

Please sign in to comment.