[Snyk] Upgrade kleur from 2.0.2 to 4.1.5 #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to upgrade kleur from 2.0.2 to 4.1.5.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 14 versions ahead of your current version.
The recommended version was released on 2 years ago.
Release notes
Package name: kleur
Patches
Node16
TypeScript module resolution (#57): 06f28e0Thank you @ calebeby~!
process.env
with fallback (#54): ec20016For browser/vite support. Thank you @ farnabaz~!
Chores
Replace
includes()
usage withindexOf
to allow support for older browsers (#45): 86a7db8No behavioral differences. Simply allows
kleur
to run in old browsers (eg, IE8-11) without requiring a polyfill.Thank you @ Krinkle~!
Update benchmarks to reflect
includes
->indexOf
update: 19764d4Patches
process.stdout
check for browser-like polyfills (#42): 01963ccBundlers like
parcel
,webpack
, andbrowserify
polyfillprocess
but don't include astdout
implementation.Thank you @ tinchoz49~!
Patches
NO_COLOR
disables colorization if any value is received (#38, #39, #40, #41): ef5d4a8, b329629Now properly adheres to the
NO_COLOR
spec.Thank you @ stramel and @ chocolateboy~!
Chores
FORCE_COLOR=
works as expected (#41): b329629Much like
NO_COLOR
, use ofFORCE_COLOR=
is expected to be truthy.Patches
kleur/colors
type definitions can be resolved: 06923d0, cc66a6fFeatures
NO_COLOR
standard (#37): d839af7Thank you @ stramel~! 🎉
Chores
Patches
Ensure
process
is defined before settingprocess
-based values (#36): 303e502This allows for
kleur
to be imported into browsers without any bundle-shimming.Patches
Disable colorization if inside a TTY context (#33): 5c7353f
Thank you @ ai~!
$ npx app.js > log.txt
#=> The
log.txt
filled with ANSI codes# After:
$ npx app.js > log.txt
#=> The
log.txt
is plain text# OVERRIDE:
$ FORCE_COLOR=1 npx app.js > log.txt
#=> The
log.txt
filled with ANSI codes; as requestedChores
Patches
Revert to Node 6.x minimum support: 8c01d93
The code works perfectly in that environment, so there's no reason not to.
Truth be told, it was only bumped to 10.x because of the test runner constraint.
(types) fix
kleur/colors
overloaded definition: f2f33a8Original
print
order assumed that every export returnednull
, which is not true.Breaking
The minimum Node.js runtime increased from 6.x to 10.x since 10.x is the oldest active LTS version.
If you need to continue supporting Node 6.x, either continue using
kleur@3.x
or ignore the "engines" constraint ofkleur@4.x
– its CommonJS files will still execute in a Node 6.x environment.Features
Added native ESM support with
exports
map (for Node 12.18.x, Node 14+) (#30): 2da16a9Thank you @ kristoferbaxter~!
Added
module
package entry (for bundler and PikaCDN) (#31): 2da16a9Added new
kleur/colors
entry module: 049c080These changes allow for
import
statements withkleur
.It's done in a way such that Node.js environments that natively support
import
will work. For those that don't and are using webpack/Rollup, the"module"
entry is made available so that you can still take advantage of the ESM format.We took this idea one step further with
kleur/colors
– which individually exports each color, modifier, and background function. This allows you to import only the methods you need, and the unused pieces of code are detached from your code. In other words,kleur/colors
is 100% treeshakeable, which is a big advantage of the ESM format. Node.js (with native ESM support), Rollup, and webpack benefit from this, which means that your programs only include/load thekleur
code you use.If you're not ready to use ESM yet,
require
statements still work for both modules in all environments.import * as colors from 'kleur/colors';
console.log(
kleur.underline().green('kleur natively supports ESM~!')
);
console.log(
colors.white(colors.italic(
... so does "<span class="pl-s1"><span class="pl-kos">${</span> <span class="pl-s1">colors</span><span class="pl-kos">.</span><span class="pl-en">green</span><span class="pl-kos">(</span><span class="pl-s">'kleur/colors'</span><span class="pl-kos">)</span> <span class="pl-kos">}</span></span>"~!
)));
Chores
c8
for code coverage: 06e3ba4kleur/colors
tests: f39b294Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: