autoprefixer-stylus
Advanced tools
Comparing version 0.14.0 to 1.0.0
55
index.js
@@ -1,5 +0,5 @@ | ||
var ap = require('autoprefixer'), | ||
postcss = require('postcss'), | ||
map = require('multi-stage-sourcemap'), | ||
path = require('path'); | ||
const autoprefixer = require('autoprefixer') | ||
const postcss = require('postcss') | ||
const map = require('multi-stage-sourcemap') | ||
const path = require('path') | ||
@@ -18,22 +18,21 @@ /** | ||
module.exports = function(opts) { | ||
if (!opts) { opts = {}; } | ||
module.exports = function(opts = {}) { | ||
// pull `hideWarnings` out so we can pass opts to autoprefixer | ||
var showWarnings = !opts.hideWarnings; | ||
delete opts.hideWarnings; | ||
const showWarnings = !opts.hideWarnings | ||
delete opts.hideWarnings | ||
return function(style){ | ||
style = this || style; | ||
var filename = style.options.filename; | ||
return function(style) { | ||
style = this || style | ||
const filename = style.options.filename | ||
style.on('end', function(err, css){ | ||
style.on('end', function(err, css) { | ||
if (err) throw new Error(err) | ||
// configure the options to be passed to autoprefixer | ||
var process_opts = { | ||
const processOpts = { | ||
from: filename, | ||
to: path.join( | ||
path.dirname(filename), | ||
path.basename(filename, path.extname(filename)) | ||
) + '.css' | ||
to: | ||
path.join( | ||
path.dirname(filename), | ||
path.basename(filename, path.extname(filename)) | ||
) + '.css' | ||
} | ||
@@ -43,29 +42,27 @@ | ||
if (style.sourcemap) { | ||
process_opts.map = { annotation: false } | ||
processOpts.map = { annotation: false } | ||
} | ||
// run autoprefixer | ||
var res = postcss([ap(opts)]).process(css, process_opts); | ||
var res = postcss([autoprefixer(opts)]).process(css, processOpts) | ||
// if sourcemaps are generated, combine the two | ||
if (res.map && style.sourcemap) { | ||
var combined_map = map.transfer({ | ||
var combinedMap = map.transfer({ | ||
fromSourceMap: res.map.toString(), | ||
toSourceMap: style.sourcemap | ||
}); | ||
}) | ||
// then set the combined result as the new sourcemap | ||
style.sourcemap = JSON.parse(combined_map); | ||
style.sourcemap = JSON.parse(combinedMap) | ||
} | ||
if (showWarnings) { | ||
res.warnings().forEach(console.error); | ||
res.warnings().forEach(console.error) | ||
} | ||
// return the css output | ||
return res.css; | ||
}); | ||
return res.css | ||
}) | ||
} | ||
} |
{ | ||
"name": "autoprefixer-stylus", | ||
"description": "autoprefixer for stylus", | ||
"version": "0.14.0", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jescalan/autoprefixer-stylus.git" | ||
"version": "1.0.0", | ||
"author": "Jeff Escalante", | ||
"dependencies": { | ||
"autoprefixer": "9.6.1", | ||
"multi-stage-sourcemap": "0.3.1", | ||
"postcss": "7.0.17" | ||
}, | ||
"devDependencies": { | ||
"chai": "3.5.0", | ||
"coffee-script": "1.12.6", | ||
"coveralls": "2.13.1", | ||
"chai": "4.2.0", | ||
"coveralls": "3.0.5", | ||
"css-parse": "2.0.0", | ||
"istanbul": "0.4.5", | ||
"mocha": "3.4.1", | ||
"mocha-lcov-reporter": "1.3.0", | ||
"mocha": "6.2.0", | ||
"nyc": "^14.1.1", | ||
"rimraf": "^2.6.3", | ||
"stylus": "0.54.5" | ||
}, | ||
"author": "Jeff Escalante", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"repository": "https://github.com/jescalan/autoprefixer-stylus", | ||
"scripts": { | ||
"test": "mocha", | ||
"coveralls": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage", | ||
"coverage": "istanbul cover _mocha --report html -- -R spec && open coverage/index.html" | ||
}, | ||
"engines": { | ||
"node": ">= 4" | ||
}, | ||
"dependencies": { | ||
"autoprefixer": "7.1.0", | ||
"multi-stage-sourcemap": "0.2.1", | ||
"postcss": "6.0.1" | ||
"coverage": "nyc report --reporter=html && open coverage/index.html", | ||
"coveralls": "nyc report --reporter=text-lcov | coveralls && rimraf ./coverage", | ||
"test": "nyc mocha" | ||
} | ||
} |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7
56
1
5485
48
1
+ Addedansi-styles@3.2.1(transitive)
+ Addedautoprefixer@9.6.1(transitive)
+ Addedbrowserslist@4.24.3(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedmulti-stage-sourcemap@0.3.1(transitive)
+ Addednode-releases@2.0.19(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@7.0.17(transitive)
+ Addedpostcss-value-parser@4.2.0(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsupports-color@5.5.06.1.0(transitive)
+ Addedupdate-browserslist-db@1.1.1(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedautoprefixer@7.1.0(transitive)
- Removedbrowserslist@2.11.3(transitive)
- Removedchalk@1.1.3(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-flag@1.0.0(transitive)
- Removedmulti-stage-sourcemap@0.2.1(transitive)
- Removedpostcss@6.0.1(transitive)
- Removedpostcss-value-parser@3.3.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.03.2.3(transitive)
Updatedautoprefixer@9.6.1
Updatedmulti-stage-sourcemap@0.3.1
Updatedpostcss@7.0.17