diff --git a/.npmignore b/.npmignore index 2ed6967..85f89d0 100644 --- a/.npmignore +++ b/.npmignore @@ -4,6 +4,4 @@ npm-debug.log test/ gulpfile.js .eslintrc -~* -/.postcss-import-url.sublime-project -/.postcss-import-url.sublime-workspace +~* \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..79a5b4d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,28 @@ +# [4.0.0](https://github.com/unlight/postcss-import-url/compare/v3.0.4...v4.0.0) (2019-01-03) + + +### chore + +* Updated dependencies ([b1ed8b2](https://github.com/unlight/postcss-import-url/commit/b1ed8b2)) + + +### Features + +* Added semantic release ([69c494a](https://github.com/unlight/postcss-import-url/commit/69c494a)) + + +### BREAKING CHANGES + +* Node 6+ is required now + +## 3.X.X + +* 3.0.4 (04 Jan 2018) - fixed [#15](https://github.com/unlight/postcss-import-url/issues/15) +* 3.0.3 (02 Jan 2018) - fixed [#13](https://github.com/unlight/postcss-import-url/issues/13), set peer dependency as range >=6 <7 +* 3.0.1 (30 Oct 2017) - updated dependencies (postcss 6), moved postcss to peerDependencies +* 3.0.0 (27 Oct 2017) - using `atRule.source.input.file` to resolve urls +* 2.2.0 (19 Nov 2016) - added option modernBrowser +* 2.1.1 (19 Oct 2016) - added to readme google font notice +* 2.1.0 (09 Jul 2016) - replaced Object.assign by _.assign +* 2.0.0 (08 Jul 2016) - added recursive option +* 1.0.0 (01 Nov 2015) - first release diff --git a/LICENSE b/LICENSE index 5285f42..b442934 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 +Copyright (c) 2018 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 11e4e3c..e80553e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ See [PostCSS](https://github.com/postcss/postcss#usage) docs for examples for yo ## Options * `recursive` (boolean) To import URLs recursively (default: `true`) -* `modernBrowser` (boolean) set user-agent string to 'Mozilla/5.0 AppleWebKit/537.36 Chrome/54.0.2840.99 Safari/537.36', this option maybe useful for importing fonts from Google. Google check `user-agent` header string and respond can be different (default: `false`) +* `modernBrowser` (boolean) set user-agent string to 'Mozilla/5.0 AppleWebKit/537.36 Chrome/65.0.0.0 Safari/537.36', this option maybe useful for importing fonts from Google. Google check `user-agent` header string and respond can be different (default: `false`) * `userAgent` (string) Custom user-agent header (default: `null`) ## Known Issues @@ -46,12 +46,4 @@ Google returns truetype fonts rather than the better woff2 format. Use option `modernBrowser` to explicitly load woff2 fonts. ## Changelog -* 3.0.4 (04 Jan 2018) - fixed [#15](https://github.com/unlight/postcss-import-url/issues/15) -* 3.0.3 (02 Jan 2018) - fixed [#13](https://github.com/unlight/postcss-import-url/issues/13), set peer dependency as range >=6 <7 -* 3.0.1 (30 Oct 2017) - updated dependencies (postcss 6), moved postcss to peerDependencies -* 3.0.0 (27 Oct 2017) - using `atRule.source.input.file` to resolve urls -* 2.2.0 (19 Nov 2016) - added option modernBrowser -* 2.1.1 (19 Oct 2016) - added to readme google font notice -* 2.1.0 (09 Jul 2016) - replaced Object.assign by _.assign -* 2.0.0 (08 Jul 2016) - added recursive option -* 1.0.0 (01 Nov 2015) - first release +See [CHANGELOG](CHANGELOG.md) \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 08146bb..1466da2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,37 +1,38 @@ -var gulp = require("gulp"); -var connect = require("gulp-connect"); -var mocha = require("gulp-mocha"); -var eslint = require("gulp-eslint"); +var gulp = require('gulp'); +var connect = require('gulp-connect'); +var mocha = require('gulp-mocha'); +var eslint = require('gulp-eslint'); -var files = ["index.js", "gulpfile.js"]; +var files = ['index.js', 'gulpfile.js']; -gulp.task("lint", function() { +gulp.task('lint', function() { return gulp.src(files) .pipe(eslint()) .pipe(eslint.format()); // .pipe(eslint.failAfterError()); }); -gulp.task("test", function() { - gulp.start("start-server"); - return gulp.src("test/*.js", {read: false}) +gulp.task('test', function() { + var startServer = gulp.task('start-server'); + startServer(); + return gulp.src('test/*.js', {read: false}) .pipe(mocha({timeout: 5000})) - .on("end", connect.serverClose); + .on('end', connect.serverClose); }); -gulp.task("default", ["lint", "test"]); +gulp.task('default', gulp.series(['lint', 'test'])); -gulp.task("watch", function() { - gulp.watch(files, ["lint", "test"]); +gulp.task('watch', function() { + gulp.watch(files, ['lint', 'test']); }); -gulp.task("start-server", function() { +gulp.task('start-server', function() { connect.server({ - root: "./test", + root: './test', port: 1234 }); }); -gulp.task("close-server", function() { +gulp.task('close-server', function() { connect.serverClose(); }); \ No newline at end of file diff --git a/index.js b/index.js index 8e41658..d7c5888 100644 --- a/index.js +++ b/index.js @@ -62,7 +62,7 @@ function createPromise(remoteFile, options) { reqOptions.headers = {}; reqOptions.headers['connection'] = 'keep-alive'; if (options.modernBrowser) { - reqOptions.headers['user-agent'] = 'Mozilla/5.0 AppleWebKit/538.0 Chrome/54.0 Safari/538'; + reqOptions.headers['user-agent'] = 'Mozilla/5.0 AppleWebKit/538.0 Chrome/65.0.0.0 Safari/538'; } if (options.userAgent) { reqOptions.headers['user-agent'] = String(options.userAgent); diff --git a/package.json b/package.json index 507097e..bbb92cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postcss-import-url", - "version": "3.0.4", + "version": "4.0.0", "description": "PostCSS plugin inlines remote files.", "keywords": [ "postcss", @@ -9,26 +9,35 @@ ], "license": "MIT", "homepage": "https://github.com/unlight/postcss-import-url", + "engines": { + "node": ">=6", + "npm": ">=3" + }, "dependencies": { "http-https": "^1.0.0", - "is-url": "^1.2.2", + "is-url": "^1.2.4", "lodash.assign": "^4.2.0", "lodash.trim": "^4.5.1", "resolve-relative-url": "^1.0.0" }, "peerDependencies": { - "postcss": ">=6 <7" + "postcss": ">=6 <8" }, "devDependencies": { - "chai": "^4.1.2", - "gulp": "^3.9.1", - "gulp-connect": "^5.0.0", - "gulp-eslint": "^4.0.0", - "gulp-mocha": "^5.0.0", + "chai": "^4.2.0", + "gulp": "^4.0.0", + "@semantic-release/changelog": "^3.0.2", + "@semantic-release/git": "^7.0.7", + "@semantic-release/npm": "^5.1.3", + "semantic-release": "^15.13.2", + "gulp-connect": "^5.7.0", + "gulp-eslint": "^5.0.0", + "gulp-mocha": "^6.0.0", "tcp-ping": "^0.1.1" }, "scripts": { - "pretest": "npm install postcss --no-package-lock --no-save", + "prepublishOnly": "sed -i -e 's/devDependencies/_devDependencies/g' package.json", + "pretest": "npm install postcss@7 --no-package-lock --no-save", "test": "gulp" }, "main": "index.js", @@ -41,5 +50,33 @@ }, "bugs": { "url": "https://github.com/unlight/postcss-import-url/issues" + }, + "release": { + "verifyConditions": [ + "@semantic-release/changelog", + "@semantic-release/github", + "@semantic-release/npm", + "@semantic-release/git" + ], + "prepare": [ + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/git" + ], + "publish": [ + "@semantic-release/npm", + "@semantic-release/github" + ], + "success": [ + "@semantic-release/github" + ], + "fail": [ + "@semantic-release/github" + ] + }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } } }