Update dependency chalk to v5
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
chalk | devDependencies | major | 1.1.3 -> 5.0.1 |
Release Notes
chalk/chalk
v5.0.1
- Add
main
field to package.json for backwards compatibility with some developer tools85f7e96
v5.0.0
Breaking
-
This package is now pure ESM. Please read this.
- If you use TypeScript, you need to use TypeScript 4.7 or later. Why.
- If you use a bundler, make sure it supports ESM and that you have correctly configured it for ESM.
- The Chalk issue tracker is not a support channel for your favorite build/bundler tool.
- It's totally fine to stay on Chalk v4. It's been stable for years.
- Require Node.js 12.20
fa16f4e
- Move some properties off the default export to individual named exports:
-
chalk.Instance
→Chalk
-
chalk.supportsColor
→supportsColor
-
chalk.stderr
→chalkStderr
-
chalk.stderr.supportsColor
→supportsColorStderr
-
- Remove
.keyword()
,.hsl()
,.hsv()
,.hwb()
, and.ansi()
coloring methods (#433)4cf2e40
- These were not commonly used and added a lot of bloat to Chalk. You can achieve the same by using the
color-convert
package.
- These were not commonly used and added a lot of bloat to Chalk. You can achieve the same by using the
- The tagged template literal support moved into a separate package:
chalk-template
(#524)c987c61
-import chalk from 'chalk';
+import chalkTemplate from 'chalk-template';
-chalk`2 + 3 = {bold ${2 + 3}}`;
+chalkTemplate`2 + 3 = {bold ${2 + 3}}`;
Improvements
- Bundle dependencies
04fdbd6
- This means Chalk no longer has any dependencies
🎉
- This means Chalk no longer has any dependencies
- The install size is less than half of v4.
- Add
overline
style (#433)4cf2e40
- Preserve function prototype methods (#434)
0fba91b
v4.1.2
- Readme updates
v4.1.1
v4.1.0
v4.0.0
Breaking
-if (chalk.level > Level.None) {}
+if (chalk.level > 0) {}
Improvements
v3.0.0
This release has been in development for more than a year and massively improves performance and the time it takes to import Chalk.
Thanks to @stroncium for his hard work on this.
Breaking
- Require Node.js 8
3ef170b
- Remove the
.enabled
property in favor of.level
(#356)1f77953
- Why: It was confusing to users to have two properties for detecting color support.
- Migrate:
-if (chalk.enabled) {}
+if (chalk.level > 0) {}
-new chalk.constructor({level: 1});
+new chalk.Instance({level: 1})
Minor breaking
- Use CommonJS-compatible export in TypeScript definition (#344)
98628d9
- Why: Faking default export for TypeScript broke IntelliSense for JavaScript.
- Migrate:
-import chalk from 'chalk';
+import chalk = require('chalk');
- Drop built-in Flow type definition
d3be9c6
- Why: None of us use Flow and we were not good at maintaining the type definition. You can get the types at flow-typed (needs to be updated to Chalk v3, open an issue on
flow-typed
).
- Why: None of us use Flow and we were not good at maintaining the type definition. You can get the types at flow-typed (needs to be updated to Chalk v3, open an issue on
- Rename the
ChalkOptions
TypeScript type toOptions
cf66156
- Remove
dim
style workaround for Windows (#331)cd5de7a
- Why: The issue was fixed in newer Windows 10 builds.
- Remove the
blue
color workaround for Windows (#330)2ca015c
- Why: The issue was fixed in newer Windows 10 builds.
Enhancements
- Massively improve performance! (#337)
c08417e
- Improve require speed (#358)
61aca7c
- Add
chalk.stderr
for printing to stderr (#359)2a53389
- Add
blackBright
color. It's the same as thegray
color, but added for consistency.c25c32a
- Fix support for bracketed Unicode escapes in template literals (#350)
9830948
- Export TypeScript types for colors and modifiers (#357)
6b4d206
- Add
ansi256
andbgAnsi256
to TypeScript declaration (#368)fb8e85a
- Add
ansi
andbgAnsi
to TypeScript declaration (#369)18c280d
Color detection
- The
FORCE_COLOR
environment variable can now be used to force a certain color level (#315)af4a078
- Add support for GitHub Actions in the color detection https://github.com/chalk/supports-color/commit/79d13032e2aa7a011f1c8badc866bcf4bc500f7a
- Give
TERM=dumb
higher priority in the color detection https://github.com/chalk/supports-color/commit/8d6a7b5830a96858a95ce9cfee1840dc30a3e837 - Add support for VT220 in the color detection https://github.com/chalk/supports-color/commit/ed0fe39d600ff1c286b3948abbef88eaef4f8f27
Fixes
- Fix support for nested styles (#335)
87156ce
- Fix const enum for TypeScript (#364)
4e65299
- Fix TypeScript type for
supportsColor
which is top‑level only (#342)b3e9b91
- Fix TypeScript type for
chalk.supportsColor
(#347)d82b2a6
- Fix TypeScript type for tagged template literal argument to accept
unknown
instead of juststring
(#316)7f6e563
v2.4.2
- Strict mode in Flow definition (#309) https://github.com/chalk/chalk/commit/f95d9ec8c92329fd087fbd3ecb7a87d0e8345b59
This release is done from the v2-release
branch, as master
branch targets the work-in-progress v3 release.
v2.4.1
- Improved Flow type definition for CommonJS interop.
v2.4.0
- Added Flow type definitions. https://github.com/chalk/chalk/commit/7c6f83f719b241b7a1a1cd54b256d123e53eab4a
v2.3.2
- Fixed detection of color support for VSCode debug console. https://github.com/chalk/supports-color/commit/b764af94766fd44e8a2ebf690c1c1b2e86d61328
- Fixed detection of 24M colors in Konsole. https://github.com/chalk/supports-color/commit/d6e08c83d0e24241cb7d24206ef8753e839103eb
- Fixed using
chalk.ansi256
when in a terminal with 256-color level support. https://github.com/chalk/ansi-styles/commit/1ac7472f8bb4f583299b6d5ef87a383f7b564b4b
v2.3.1
- Calculate proper
level
when forcing color. https://github.com/chalk/supports-color/commit/b16e9a4b9f13b3930e184e2f582b55091216fe47 - Detect 16m color support on Windows >=10.0.14931. https://github.com/chalk/supports-color/commit/cf7bd05b814246e76c7f09bdb8e14a2ee581a2dd
v2.3.0
- Added a
.visible()
method for emitting text only when Chalk is enabled. This can be useful for purely cosmetic content that shouldn't be shown when there are no colors, like when piping the output. https://github.com/chalk/chalk/commit/dc092b4a5f5ca77dd1e22607cdf2fdd388803064 - TypeScript type definitions improvements. https://github.com/chalk/chalk/commit/7be154c074026f77b99e7d854b3a4cdd5e4ae502
v2.2.2
v2.2.0
Chalk now comes with TypeScript type definitions built-in. https://github.com/chalk/chalk/commit/f653b061d6fbdb1c7224f7d80476391202c47877
Note: It's incompatible with @types/chalk
if you're currently using that: https://github.com/chalk/chalk/issues/215
v2.1.0
v2.0.1
v2.0.0
Chalk is a Node.js module for styling and colorizing terminal output.
Two years ago, @qix- asked me about adding 256/Truecolor support to Chalk. He soon after joined the Chalk team. And now we’re finally able to ship Truecolor support in Chalk!
Chalk has had an immense growth since the 1.0.0 release in 2015. It's now trusted by more than 17.000 packages, up from 3000, and it's the 5th most depended upon package on npm.
Highlights
Breaking changes
- Requires Node.js 4 or later.
- Removed
chalk.hasColor()
. Use thehas-ansi
package directly instead. https://github.com/chalk/chalk/commit/04cae226cc0fc11fd7898f3fa91fdc4a3b3e496b - Removed
chalk.stripColor()
. Use thestrip-ansi
package directly instead. https://github.com/chalk/chalk/commit/04cae226cc0fc11fd7898f3fa91fdc4a3b3e496b - Removed
chalk.styles
. Use theansi-styles
package directly instead. https://github.com/chalk/chalk/commit/870249689acc6b04e81e96d2c09c39b76c640a94
256/Truecolor support
Chalk now supports 256 colors and Truecolor (16 million colors). Terminal apps like Hyper and iTerm supports Truecolor, enabling you to create really immersive CLI experiences. Chalk is smart enough to downsample the colors to whatever the terminal supports, so you can use any colors without having to think whether it's supported or not.
https://github.com/chalk/chalk/commit/cb3f2308e17cd2878d2722db7762bdc725e9ff48
Tagged template literal
Chalk now ships with a tagged template literal that makes it much nicer to create long strings with lots of different styling.
const name = 'Sindre';
console.log(chalk`{bold Hello ${name}}`);
https://github.com/chalk/chalk/commit/f66271e01a901470a3d5afcb3feae552848ccf0c
Other
- Added bright color variants. https://github.com/chalk/ansi-styles/commit/d1d855e75b9178700312d4076a42b510c9e0c289
- Fixed a bleed issue on macOS. https://github.com/chalk/chalk/commit/05f87e25e108726ee469aa56cc88fcc160a911ed
- Added support for 256 color output on Windows 10 build 10586 or newer. https://github.com/chalk/supports-color/commit/340588ef8225d294d72aea7dd3343287220ed093
All changes
Made with
Configuration
-
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.