Skip to content

Commit

Permalink
Replace kleur to colorette
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jun 24, 2020
1 parent b4c9546 commit 255deab
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 39 deletions.
8 changes: 4 additions & 4 deletions lib/autoprefixer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
let browserslist = require('browserslist')
let colorette = require('colorette')
let postcss = require('postcss')
let agents = require('caniuse-lite').agents
let kleur = require('kleur/colors')

let Browsers = require('./browsers')
let Prefixes = require('./prefixes')
Expand Down Expand Up @@ -79,10 +79,10 @@ module.exports = postcss.plugin('autoprefixer', (...reqs) => {
reqs = options.overrideBrowserslist
} else if (options.browsers) {
if (typeof console !== 'undefined' && console.warn) {
if (kleur.red) {
if (colorette.red) {
console.warn(
kleur.red(
WARNING.replace(/`[^`]+`/g, i => kleur.yellow(i.slice(1, -1)))
colorette.red(
WARNING.replace(/`[^`]+`/g, i => colorette.yellow(i.slice(1, -1)))
)
)
} else {
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
"author": "Andrey Sitnik <[email protected]>",
"license": "MIT",
"repository": "postcss/autoprefixer",
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
},
"dependencies": {
"@babel/register": "^7.10.3",
"browserslist": "^4.12.0",
"caniuse-lite": "^1.0.30001087",
"kleur": "^4.0.1",
"colorette": "^1.2.0",
"normalize-range": "^0.1.2",
"num2fraction": "^1.2.2",
"postcss": "^7.0.32",
Expand All @@ -40,7 +37,7 @@
"@babel/plugin-transform-proto-to-assign": "^7.10.1",
"@babel/preset-env": "^7.10.3",
"@logux/eslint-config": "^35.0.3",
"@size-limit/preset-small-lib": "4.5.1",
"@size-limit/preset-small-lib": "4.5.2",
"babel-core": "^7.0.0-0",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.2.6",
Expand Down Expand Up @@ -69,7 +66,7 @@
"jest": "^24.9.0",
"jest-ci": "^0.1.1",
"lint-staged": "^10.2.11",
"size-limit": "^4.5.1"
"size-limit": "^4.5.2"
},
"lint-staged": {
"*.js": "eslint"
Expand Down Expand Up @@ -142,6 +139,7 @@
"defaults"
],
"browser": {
"colorette": false,
"chalk": false
},
"babel": {
Expand Down
4 changes: 2 additions & 2 deletions test/webpack.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
jest.doMock('kleur/colors', () => ({ }))
jest.doMock('colorette', () => ({ }))

let autoprefixer = require('../lib/autoprefixer')

it('works without kleur', () => {
it('works without colorette', () => {
jest.spyOn(console, 'warn').mockImplementation(() => true)
let instance = autoprefixer({ browsers: ['last 1 version'] })
expect(instance.browsers).toEqual(['last 1 version'])
Expand Down
55 changes: 28 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1061,25 +1061,25 @@
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"

"@size-limit/[email protected].1":
version "4.5.1"
resolved "https://registry.yarnpkg.com/@size-limit/file/-/file-4.5.1.tgz#8a35c970ef786361ca85446b80e61d7ce81566c9"
integrity sha512-/NqXm0hypfPmLO4EhfQXMoIJ+gq+zePTrlWZAJ0usCuhYY89iZMvPR4FokGgAO8+JizNMoK4mjLgIRzuOcS2wg==
"@size-limit/[email protected].2":
version "4.5.2"
resolved "https://registry.yarnpkg.com/@size-limit/file/-/file-4.5.2.tgz#c904c08bed011c297f62637c1c86c6c2c5375185"
integrity sha512-t8IS2TOs2mm35HHIvH8rG596XZy77121LuIDbRpYbokVygN4EUMmxaV9iteQgpTuhRN4CUbJZJvAi55RMv3K7w==
dependencies:
semver "7.3.2"

"@size-limit/[email protected].1":
version "4.5.1"
resolved "https://registry.yarnpkg.com/@size-limit/preset-small-lib/-/preset-small-lib-4.5.1.tgz#d160291bd6df18216844e1de0cfcaa42b2092148"
integrity sha512-cw+dUsPncw6IcfBGqOOH9phev0zuryYkzQDomTzuTc1mDqB3s3S7+9lA1yBr49ByNnoQVhCrt0SJ+yM5AyosaA==
"@size-limit/[email protected].2":
version "4.5.2"
resolved "https://registry.yarnpkg.com/@size-limit/preset-small-lib/-/preset-small-lib-4.5.2.tgz#7977d0dfe65d5bb535c2a4fd738806e786b8c8f2"
integrity sha512-6msDVypvfYm+3oJ5uOPM3AwQyeogL4wUjqxzwNkG1BkNZLhHyFNjf6X7TNylyiABbHB7IXH6x+EA2u7Kt9ymSg==
dependencies:
"@size-limit/file" "4.5.1"
"@size-limit/webpack" "4.5.1"
"@size-limit/file" "4.5.2"
"@size-limit/webpack" "4.5.2"

"@size-limit/[email protected].1":
version "4.5.1"
resolved "https://registry.yarnpkg.com/@size-limit/webpack/-/webpack-4.5.1.tgz#f0f41f176df7261c5c5c8db7ed08372d101adc8e"
integrity sha512-goB1gcd5qHq6vMRqWVeGzYeyN5aapl2GmbE/zh0iLZIeRHKpy1HqC6MLuXdxZRsNDYakFMIO2xFcLxK4C1Kyug==
"@size-limit/[email protected].2":
version "4.5.2"
resolved "https://registry.yarnpkg.com/@size-limit/webpack/-/webpack-4.5.2.tgz#68fd089834175874972a04e6240912c2e462efed"
integrity sha512-liqD+N3EQXjMyoZ0UmlTdwo8pBj5ORHkebTmCAYPAfS/P46JEVDUi47Q6s+dzOVY9O/JgSGUyf3VrP/Er7gJ0g==
dependencies:
css-loader "^3.6.0"
escape-string-regexp "^4.0.0"
Expand Down Expand Up @@ -2657,6 +2657,11 @@ color@^3.0.0:
color-convert "^1.9.1"
color-string "^1.5.2"

colorette@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.0.tgz#45306add826d196e8c87236ac05d797f25982e63"
integrity sha512-soRSroY+OF/8OdA3PTQXwaDJeMc7TfknKKrxeSCencL2a4+Tx5zhxmmv7hdpCjhKBjehzp8+bwe/T68K0hpIjw==

combine-source-map@^0.8.0, combine-source-map@~0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b"
Expand Down Expand Up @@ -5988,11 +5993,6 @@ kleur@^3.0.3:
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==

kleur@^4.0.0, kleur@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.0.1.tgz#3d4948534b666e2578f93b6fafb62108e64f05ef"
integrity sha512-Qs6SqCLm63rd0kNVh+wO4XsWLU6kgfwwaPYsLiClWf0Tewkzsa6MvB21bespb8cz+ANS+2t3So1ge3gintzhlw==

labeled-stream-splicer@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz#42a41a16abcd46fd046306cf4f2c3576fffb1c21"
Expand Down Expand Up @@ -8600,17 +8600,17 @@ sisteransi@^1.0.4:
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==

size-limit@^4.5.1:
version "4.5.1"
resolved "https://registry.yarnpkg.com/size-limit/-/size-limit-4.5.1.tgz#8773bcd6c8573398787695c52d3e70423195e5c9"
integrity sha512-QW5xWm/qhU57HPebmY2oF8lcqIIhh1yYJWpCIU302drwJTFUye4qCcUjzpnB+pYSGb88q5kBsG5oixXAiWOC0g==
size-limit@^4.5.2:
version "4.5.2"
resolved "https://registry.yarnpkg.com/size-limit/-/size-limit-4.5.2.tgz#7448e2a41ad1d335143010409446684819cbcc8a"
integrity sha512-5UFx+Y7Yo6PkUxwQCigcT/1TrbPqThdD5uoAy1p2Q3ajBRzWdKb+pK2k+/p8D8pEbFIh4JFN+m5fwdPpgAJ1yQ==
dependencies:
bytes "^3.1.0"
chokidar "^3.4.0"
ci-job-number "^1.2.2"
colorette "^1.2.0"
cosmiconfig "^6.0.0"
globby "^11.0.1"
kleur "^4.0.0"
ora "^4.0.4"
read-pkg-up "^7.0.1"

Expand Down Expand Up @@ -9189,10 +9189,11 @@ through2@^2.0.0, through2@^2.0.3, through2@~2.0.0:
xtend "~4.0.1"

through2@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.1.tgz#39276e713c3302edf9e388dd9c812dd3b825bd5a"
integrity sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==
version "3.0.2"
resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4"
integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==
dependencies:
inherits "^2.0.4"
readable-stream "2 || 3"

"through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8:
Expand Down

0 comments on commit 255deab

Please sign in to comment.