Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sindresorhus/gulp-autoprefixer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 51886049f1b2bf1e3ac0631ef2a48137f4acfe10
Choose a base ref
...
head repository: sindresorhus/gulp-autoprefixer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dfe3919bdd4fa6549db217d16868316a6fc601d3
Choose a head ref
  • 11 commits
  • 10 files changed
  • 5 contributors

Commits on Oct 28, 2017

  1. Test against Node.js v8 (#90)

    MarkHerhold authored and sindresorhus committed Oct 28, 2017
    Copy the full SHA
    60aead3 View commit details

Commits on Dec 29, 2017

  1. Drop dependency on deprecated gulp-util (#94)

    Fixes #93
    demurgos authored and sindresorhus committed Dec 29, 2017

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    94f3447 View commit details
  2. Meta tweaks

    sindresorhus committed Dec 29, 2017
    Copy the full SHA
    27816c3 View commit details
  3. 4.1.0

    sindresorhus committed Dec 29, 2017
    Copy the full SHA
    d008588 View commit details

Commits on Feb 28, 2018

  1. Copy the full SHA
    7828646 View commit details
  2. Copy the full SHA
    e954e6e View commit details
  3. Meta tweaks

    sindresorhus committed Feb 28, 2018
    Copy the full SHA
    e526a78 View commit details
  4. 5.0.0

    sindresorhus committed Feb 28, 2018
    Copy the full SHA
    18a27be View commit details

Commits on Aug 26, 2018

  1. Require Node.js 6

    sindresorhus committed Aug 26, 2018
    Copy the full SHA
    ea0b7f8 View commit details
  2. Copy the full SHA
    c225cbd View commit details
  3. 6.0.0

    sindresorhus committed Aug 26, 2018
    Copy the full SHA
    dfe3919 View commit details
Showing with 76 additions and 85 deletions.
  1. +1 −1 .editorconfig
  2. +1 −2 .gitattributes
  3. +1 −0 .gitignore
  4. +1 −0 .npmrc
  5. +2 −2 .travis.yml
  6. +12 −8 index.js
  7. +4 −16 license
  8. +45 −43 package.json
  9. +4 −8 readme.md
  10. +5 −5 test.js
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -7,6 +7,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
[*.yml]
indent_style = space
indent_size = 2
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
yarn.lock
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo: false
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
20 changes: 12 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
const gutil = require('gulp-util');
const fancyLog = require('fancy-log');
const PluginError = require('plugin-error');
const through = require('through2');
const applySourceMap = require('vinyl-sourcemaps-apply');
const autoprefixer = require('autoprefixer');
@@ -13,7 +14,7 @@ module.exports = opts => {
}

if (file.isStream()) {
cb(new gutil.PluginError('gulp-autoprefixer', 'Streaming not supported'));
cb(new PluginError('gulp-autoprefixer', 'Streaming not supported'));
return;
}

@@ -25,25 +26,28 @@ module.exports = opts => {
file.contents = Buffer.from(res.css);

if (res.map && file.sourceMap) {
applySourceMap(file, res.map.toString());
const map = res.map.toJSON();
map.file = file.relative;
map.sources = map.sources.map(() => file.relative);
applySourceMap(file, map);
}

const warnings = res.warnings();

if (warnings.length > 0) {
gutil.log('gulp-autoprefixer:', '\n ' + warnings.join('\n '));
fancyLog('gulp-autoprefixer:', '\n ' + warnings.join('\n '));
}

setImmediate(cb, null, file);
}).catch(err => {
const cssError = err.name === 'CssSyntaxError';
}).catch(error => {
const cssError = error.name === 'CssSyntaxError';

if (cssError) {
err.message += err.showSourceCode();
error.message += error.showSourceCode();
}

// Prevent stream unhandled exception from being suppressed by Promise
setImmediate(cb, new gutil.PluginError('gulp-autoprefixer', err, {
setImmediate(cb, new PluginError('gulp-autoprefixer', error, {
fileName: file.path,
showStack: !cssError
}));
20 changes: 4 additions & 16 deletions license
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
The MIT License (MIT)
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
88 changes: 45 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
{
"name": "gulp-autoprefixer",
"version": "4.0.0",
"description": "Prefix CSS",
"license": "MIT",
"repository": "sindresorhus/gulp-autoprefixer",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4.5"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"gulpplugin",
"autoprefixer",
"postcss",
"css",
"prefix",
"prefixes",
"stylesheet",
"preprocess",
"postcss-runner"
],
"dependencies": {
"autoprefixer": "^7.0.0",
"gulp-util": "^3.0.0",
"postcss": "^6.0.1",
"through2": "^2.0.0",
"vinyl-sourcemaps-apply": "^0.2.0"
},
"devDependencies": {
"ava": "*",
"gulp-sourcemaps": "^2.6.0",
"p-event": "^1.1.0",
"xo": "*"
}
"name": "gulp-autoprefixer",
"version": "6.0.0",
"description": "Prefix CSS",
"license": "MIT",
"repository": "sindresorhus/gulp-autoprefixer",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"gulpplugin",
"autoprefixer",
"postcss",
"css",
"prefix",
"prefixes",
"stylesheet",
"preprocess",
"postcss-runner"
],
"dependencies": {
"autoprefixer": "^9.1.3",
"fancy-log": "^1.3.2",
"plugin-error": "^1.0.1",
"postcss": "^7.0.2",
"through2": "^2.0.0",
"vinyl-sourcemaps-apply": "^0.2.0"
},
"devDependencies": {
"ava": "*",
"gulp-sourcemaps": "^2.6.0",
"p-event": "^2.1.0",
"vinyl": "^2.1.0",
"xo": "*"
}
}
12 changes: 4 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
@@ -5,20 +5,16 @@
*Issues with the output should be reported on the Autoprefixer [issue tracker](https://github.com/postcss/autoprefixer/issues).*


---

<p align="center">👾</p>
<p align="center"><b>Improve your JavaScript skills with this awesome <a href="https://ES6.io/friend/AWESOME">ES6 course</a> by Wes Bos.</b><br>Try his free <a href="https://javascript30.com/friend/AWESOME">JavaScript 30 course</a> for a taste of what to expect. You might also like his <a href="https://ReactForBeginners.com/friend/AWESOME">React</a> & <a href="https://SublimeTextBook.com/friend/AWESOME">Sublime</a> course.</p>

---


## Install

```
$ npm install --save-dev gulp-autoprefixer
```

<a href="https://www.patreon.com/sindresorhus">
<img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
</a>


## Usage

10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import test from 'ava';
import gutil from 'gulp-util';
import Vinyl from 'vinyl';
import sourceMaps from 'gulp-sourcemaps';
import pEvent from 'p-event';
import m from '.';
@@ -9,11 +9,11 @@ test('autoprefix CSS', async t => {
const stream = m();
const data = pEvent(stream, 'data');

stream.end(new gutil.File({
stream.end(new Vinyl({
cwd: __dirname,
base: path.join(__dirname, 'fixture'),
path: path.join(__dirname, 'fixture', 'fixture.css'),
contents: Buffer.from('a {\n\tdisplay: flex;\n}')
contents: Buffer.from('::placeholder {\n\tcolor: gray;\n}')
}));

const file = await data;
@@ -32,7 +32,7 @@ test('generate source maps', async t => {
}))
.pipe(write);

init.end(new gutil.File({
init.end(new Vinyl({
cwd: __dirname,
base: path.join(__dirname, 'fixture'),
path: path.join(__dirname, 'fixture', 'fixture.css'),
@@ -61,7 +61,7 @@ test('read upstream source maps', async t => {
stream.pipe(write);

stream.end(
testFile = new gutil.File({
testFile = new Vinyl({
cwd: __dirname,
base: path.join(__dirname, 'fixture'),
path: path.join(__dirname, 'fixture', 'fixture.css'),