postcss-cli
Advanced tools
Comparing version 7.1.0 to 7.1.1
@@ -0,1 +1,6 @@ | ||
# 7.1.1 / 2020-04-27 | ||
- Fix bug where external source maps were not properly generated ([#324](https://github.com/postcss/postcss-cli/pull/324)) | ||
- Update dependencies | ||
# 7.1.0 / 2020-01-09 | ||
@@ -2,0 +7,0 @@ |
50
index.js
@@ -31,6 +31,6 @@ 'use strict' | ||
syntax: argv.syntax ? require(argv.syntax) : undefined, | ||
stringifier: argv.stringifier ? require(argv.stringifier) : undefined | ||
stringifier: argv.stringifier ? require(argv.stringifier) : undefined, | ||
}, | ||
plugins: argv.use | ||
? argv.use.map(plugin => { | ||
? argv.use.map((plugin) => { | ||
try { | ||
@@ -45,3 +45,3 @@ return require(plugin)() | ||
}) | ||
: [] | ||
: [], | ||
} | ||
@@ -76,3 +76,3 @@ | ||
}) | ||
.then(i => { | ||
.then((i) => { | ||
if (!i || !i.length) { | ||
@@ -88,3 +88,3 @@ error('Input Error: You must pass a valid list of files to parse') | ||
if (i[0] !== 'stdin') i = i.map(i => path.resolve(i)) | ||
if (i[0] !== 'stdin') i = i.map((i) => path.resolve(i)) | ||
@@ -95,3 +95,3 @@ input = i | ||
}) | ||
.then(results => { | ||
.then((results) => { | ||
if (argv.watch) { | ||
@@ -105,4 +105,4 @@ const printMessage = () => | ||
stabilityThreshold: 50, | ||
pollInterval: 10 | ||
} | ||
pollInterval: 10, | ||
}, | ||
}) | ||
@@ -112,3 +112,3 @@ | ||
watcher.on('ready', printMessage).on('change', file => { | ||
watcher.on('ready', printMessage).on('change', (file) => { | ||
let recompile = [] | ||
@@ -119,3 +119,3 @@ | ||
recompile = recompile.concat( | ||
depGraph.dependantsOf(file).filter(file => input.includes(file)) | ||
depGraph.dependantsOf(file).filter((file) => input.includes(file)) | ||
) | ||
@@ -126,3 +126,3 @@ | ||
return files(recompile) | ||
.then(results => watcher.add(dependencies(results))) | ||
.then((results) => watcher.add(dependencies(results))) | ||
.then(printMessage) | ||
@@ -133,3 +133,3 @@ .catch(error) | ||
}) | ||
.catch(err => { | ||
.catch((err) => { | ||
error(err) | ||
@@ -144,3 +144,3 @@ | ||
return postcssrc(ctx, path) | ||
.then(rc => { | ||
.then((rc) => { | ||
if (rc.options.from || rc.options.to) { | ||
@@ -154,3 +154,3 @@ error( | ||
}) | ||
.catch(err => { | ||
.catch((err) => { | ||
if (!err.message.includes('No PostCSS Config found')) throw err | ||
@@ -164,5 +164,5 @@ }) | ||
return Promise.all( | ||
files.map(file => { | ||
files.map((file) => { | ||
if (file === 'stdin') { | ||
return stdin().then(content => { | ||
return stdin().then((content) => { | ||
if (!content) return error('Input Error: Did not receive any STDIN') | ||
@@ -173,3 +173,3 @@ return css(content, 'stdin') | ||
return read(file).then(content => css(content, file)) | ||
return read(file).then((content) => css(content, file)) | ||
}) | ||
@@ -186,3 +186,3 @@ ) | ||
basename: path.basename(file), | ||
extname: path.extname(file) | ||
extname: path.extname(file), | ||
} | ||
@@ -203,3 +203,3 @@ | ||
return rc(ctx, argv.config) | ||
.then(config => { | ||
.then((config) => { | ||
config = config || cliConfig | ||
@@ -234,3 +234,3 @@ const options = { ...config.options } | ||
.process(css, options) | ||
.then(result => { | ||
.then((result) => { | ||
const tasks = [] | ||
@@ -243,3 +243,3 @@ | ||
const mapfile = getMapfile(options) | ||
tasks.push(fs.outputFile(mapfile, result.map)) | ||
tasks.push(fs.outputFile(mapfile, result.map.toString())) | ||
} | ||
@@ -263,3 +263,3 @@ } else process.stdout.write(result.css, 'utf8') | ||
}) | ||
.catch(err => { | ||
.catch((err) => { | ||
throw err | ||
@@ -274,9 +274,9 @@ }) | ||
results.forEach(result => { | ||
results.forEach((result) => { | ||
if (result.messages <= 0) return | ||
result.messages | ||
.filter(msg => (msg.type === 'dependency' ? msg : '')) | ||
.filter((msg) => (msg.type === 'dependency' ? msg : '')) | ||
.map(depGraph.add) | ||
.forEach(dependency => messages.push(dependency.file)) | ||
.forEach((dependency) => messages.push(dependency.file)) | ||
}) | ||
@@ -283,0 +283,0 @@ |
@@ -47,3 +47,3 @@ 'use strict' | ||
type: 'string', | ||
conflicts: ['dir', 'replace'] | ||
conflicts: ['dir', 'replace'], | ||
}) | ||
@@ -54,3 +54,3 @@ .option('d', { | ||
type: 'string', | ||
conflicts: ['output', 'replace'] | ||
conflicts: ['output', 'replace'], | ||
}) | ||
@@ -61,7 +61,7 @@ .option('r', { | ||
type: 'boolean', | ||
conflicts: ['output', 'dir'] | ||
conflicts: ['output', 'dir'], | ||
}) | ||
.option('include-dotfiles', { | ||
desc: 'Enables glob to match files/dirs that begin with "."', | ||
type: 'boolean' | ||
type: 'boolean', | ||
}) | ||
@@ -73,3 +73,3 @@ .alias('map', 'm') | ||
desc: 'Be verbose', | ||
type: 'boolean' | ||
type: 'boolean', | ||
}) | ||
@@ -80,7 +80,7 @@ .option('watch', { | ||
type: 'boolean', | ||
conflicts: 'replace' | ||
conflicts: 'replace', | ||
}) | ||
.option('env', { | ||
desc: 'A shortcut for setting NODE_ENV', | ||
type: 'string' | ||
type: 'string', | ||
}) | ||
@@ -94,15 +94,15 @@ .group( | ||
desc: 'List of postcss plugins to use', | ||
type: 'array' | ||
type: 'array', | ||
}) | ||
.option('parser', { | ||
desc: 'Custom postcss parser', | ||
type: 'string' | ||
type: 'string', | ||
}) | ||
.option('stringifier', { | ||
desc: 'Custom postcss stringifier', | ||
type: 'string' | ||
type: 'string', | ||
}) | ||
.option('syntax', { | ||
desc: 'Custom postcss syntax', | ||
type: 'string' | ||
type: 'string', | ||
}) | ||
@@ -117,3 +117,3 @@ .group(['ext', 'base', 'poll', 'config'], 'Advanced options:') | ||
return ext | ||
} | ||
}, | ||
}) | ||
@@ -124,3 +124,3 @@ .option('base', { | ||
type: 'string', | ||
implies: 'dir' | ||
implies: 'dir', | ||
}) | ||
@@ -130,7 +130,7 @@ .option('poll', { | ||
'Use polling for file watching. Can optionally pass polling interval; default 100 ms', | ||
implies: 'watch' | ||
implies: 'watch', | ||
}) | ||
.option('config', { | ||
desc: 'Set a custom directory to look for a config file', | ||
type: 'string' | ||
type: 'string', | ||
}) | ||
@@ -137,0 +137,0 @@ .version(version) |
@@ -7,3 +7,3 @@ 'use strict' | ||
exports.add = message => { | ||
exports.add = (message) => { | ||
message.parent = path.resolve(message.parent) | ||
@@ -18,3 +18,3 @@ message.file = path.resolve(message.file) | ||
exports.dependantsOf = node => { | ||
exports.dependantsOf = (node) => { | ||
node = path.resolve(node) | ||
@@ -21,0 +21,0 @@ |
{ | ||
"name": "postcss-cli", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "CLI for PostCSS", | ||
@@ -21,8 +21,8 @@ "main": "index.js", | ||
"dependencies": { | ||
"chalk": "^3.0.0", | ||
"chalk": "^4.0.0", | ||
"chokidar": "^3.3.0", | ||
"dependency-graph": "^0.8.0", | ||
"fs-extra": "^8.1.0", | ||
"dependency-graph": "^0.9.0", | ||
"fs-extra": "^9.0.0", | ||
"get-stdin": "^7.0.0", | ||
"globby": "^10.0.1", | ||
"globby": "^11.0.0", | ||
"postcss": "^7.0.0", | ||
@@ -36,11 +36,11 @@ "postcss-load-config": "^2.0.0", | ||
"devDependencies": { | ||
"ava": "^2.4.0", | ||
"ava": "^3.1.0", | ||
"coveralls": "^3.0.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-problems": "3.1.0", | ||
"eslint-config-problems": "4.0.0", | ||
"nyc": "^15.0.0", | ||
"postcss-import": "^12.0.0", | ||
"prettier": "~1.19.1", | ||
"prettier": "~2.0.0", | ||
"sugarss": "^2.0.0", | ||
"uuid": "^3.0.1" | ||
"uuid": "^7.0.0" | ||
}, | ||
@@ -75,8 +75,3 @@ "files": [ | ||
"homepage": "https://github.com/postcss/postcss-cli#readme", | ||
"license": "MIT", | ||
"ava": { | ||
"helpers": [ | ||
"test/helpers/*" | ||
] | ||
} | ||
"license": "MIT" | ||
} |
@@ -88,4 +88,4 @@ [![npm][npm]][npm-url] | ||
require('postcss-import')({ ...options }), | ||
require('postcss-url')({ url: 'copy', useHash: true }) | ||
] | ||
require('postcss-url')({ url: 'copy', useHash: true }), | ||
], | ||
} | ||
@@ -109,3 +109,3 @@ ``` | ||
```js | ||
module.exports = ctx => ({ | ||
module.exports = (ctx) => ({ | ||
map: ctx.options.map, | ||
@@ -115,4 +115,4 @@ parser: ctx.file.extname === '.sss' ? 'sugarss' : false, | ||
'postcss-import': { root: ctx.file.dirname }, | ||
cssnano: ctx.env === 'production' ? {} : false | ||
} | ||
cssnano: ctx.env === 'production' ? {} : false, | ||
}, | ||
}) | ||
@@ -130,3 +130,3 @@ ``` | ||
```js | ||
module.exports = ctx => ({ | ||
module.exports = (ctx) => ({ | ||
map: ctx.options.map, | ||
@@ -136,4 +136,4 @@ parser: ctx.options.parser, | ||
'postcss-import': { root: ctx.file.dirname }, | ||
cssnano: ctx.env === 'production' ? {} : false | ||
} | ||
cssnano: ctx.env === 'production' ? {} : false, | ||
}, | ||
}) | ||
@@ -140,0 +140,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30812
+ Addedat-least-node@1.0.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addeddependency-graph@0.9.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
- Removed@types/glob@7.2.0(transitive)
- Removed@types/minimatch@5.1.2(transitive)
- Removed@types/node@22.9.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedchalk@3.0.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddependency-graph@0.8.1(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedglobby@10.0.2(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedundici-types@6.19.8(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedchalk@^4.0.0
Updateddependency-graph@^0.9.0
Updatedfs-extra@^9.0.0
Updatedglobby@^11.0.0