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 43c4aaf
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 87 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
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<div align="center">
<h1 align="center">
<a href="https://www.npmjs.com/package/ansis">
<img width="323" src="docs/img/ansis-logo.png" alt="ansis"><br>
ANSI Styling
</a>
</h1>
</div>
<p align="center">
<a href="https://www.npmjs.com/package/ansis">
<img width="323" src="docs/img/ansis-logo.png" alt="ansis"><br>
<font size="5">ANSI Styling</font>
</a>
</p>

---
[![npm](https://img.shields.io/npm/v/ansis?logo=npm&color=brightgreen "npm package")](https://www.npmjs.com/package/ansis "download npm package")
[![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)
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 43c4aaf

Please sign in to comment.