Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Upgrade to PostCSS 5.x #209

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
sudo: false

# iojs requires GCC 4.8
# https://github.com/wadey/node-microtime/issues/34#issuecomment-138529797
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those weird things required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to wadey/node-microtime#34 (comment), yes. I'd be happy to prove me wrong though. I don't like it any more than you do!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So feel free to add a comment in the travis yml about that, so future contributors might understand what is it about (or even you in the future :D)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added comments to the new microtime commit jednano@dba072a


language: node_js
node_js:
- iojs
Expand Down
4 changes: 2 additions & 2 deletions docs/content/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ To know all available options, please check corresponding postcss plugin:
- `colorRgba`
[(=> postcss-color-rgba-fallback)](https://www.npmjs.com/package/postcss-color-rgba-fallback)
- `autoprefixer`
[(=> autoprefixer-core)](https://www.npmjs.com/package/autoprefixer-core)
[(=> autoprefixer)](https://www.npmjs.com/package/autoprefixer)

_Note: order is important to get everything working correctly._

Expand Down Expand Up @@ -193,7 +193,7 @@ If you want, you can pass option to the PostCSS plugins used
{
messages: {
browser: {
// see https://github.com/postcss/postcss-messages
// see https://github.com/postcss/postcss-browser-reporter
}

console: {
Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,37 @@
"cssnext": "dist/bin.js"
},
"dependencies": {
"autoprefixer-core": "^5.0.0",
"autoprefixer": "^6.0.2",
"caniuse-api": "^1.3.1",
"chalk": "^1.0.0",
"chokidar": "^1.0.0",
"commander": "^2.3.0",
"cssnano": "^2.6.1",
"cssnano": "^3.0.0",
"exit": "^0.1.2",
"mkdirp": "^0.5.1",
"pixrem": "^1.1.0",
"pixrem": "^2.0.0",
"pleeease-filters": "^1.0.0",
"postcss": "^4.0.2",
"postcss-calc": "^4.0.0",
"postcss-color-function": "^1.1.0",
"postcss-color-gray": "^2.0.0",
"postcss-color-hex-alpha": "^1.1.0",
"postcss-color-hwb": "^1.1.0",
"postcss-color-rebeccapurple": "^1.1.0",
"postcss-color-rgba-fallback": "^1.0.0",
"postcss-custom-media": "^4.0.0",
"postcss-custom-properties": "^4.0.0",
"postcss-custom-selectors": "^2.3.0",
"postcss-font-variant": "^1.0.0",
"postcss-import": "^6.0.0",
"postcss-media-minmax": "^1.1.0",
"postcss-messages": "^0.2.2",
"postcss-pseudo-class-any-link": "^0.2.1",
"postcss-pseudoelements": "^2.1.1",
"postcss-reporter": "^0.1.0",
"postcss-selector-matches": "^1.2.1",
"postcss-selector-not": "^1.0.1",
"postcss-url": "^4.0.1",
"postcss": "^5.0.4",
"postcss-calc": "^5.0.0",
"postcss-color-function": "^2.0.0",
"postcss-color-gray": "^3.0.0",
"postcss-color-hex-alpha": "^2.0.0",
"postcss-color-hwb": "^2.0.0",
"postcss-color-rebeccapurple": "^2.0.0",
"postcss-color-rgba-fallback": "^2.0.0",
"postcss-custom-media": "^5.0.0",
"postcss-custom-properties": "^5.0.0",
"postcss-custom-selectors": "^3.0.0",
"postcss-font-variant": "^2.0.0",
"postcss-import": "^7.0.0",
"postcss-media-minmax": "^2.0.0",
"postcss-browser-reporter": "^0.3.0",
"postcss-pseudo-class-any-link": "^1.0.0",
"postcss-pseudoelements": "^3.0.0",
"postcss-reporter": "^1.1.0",
"postcss-selector-matches": "^2.0.0",
"postcss-selector-not": "^2.0.0",
"postcss-url": "^5.0.0",
"read-file-stdin": "^0.2.0",
"to-slug-case": "^0.1.2",
"to-space-case": "^0.1.3",
Expand Down Expand Up @@ -100,7 +100,7 @@
"metalsmith-rss": "^1.0.0",
"metalsmith-url": "^1.0.0",
"metalsmith-watch": "^1.0.1",
"microtime": "^1.2.0",
"microtime": "^1.5.0",
"nano-logger": "^1.0.0",
"node-libs-browser": "^0.5.0",
"normalize.css": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/option.plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test("cssnext option: plugins", (t) => {
{
plugins: [
styles => {
styles.eachAtRule(atRule => {
styles.walkAtRules(atRule => {
atRule.name = "ok"
})
},
Expand Down
2 changes: 1 addition & 1 deletion src/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ export default {
return require("postcss-color-rgba-fallback")(options)
},
autoprefixer(options) {
return require("autoprefixer-core")(options)
return require("autoprefixer")(options)
},
}
2 changes: 1 addition & 1 deletion src/fixes/custom-selectors-missing-colon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default postcss.plugin(

return (styles, result) => {
let alert = false
styles.eachAtRule("custom-selector", rule => {
styles.walkAtRules("custom-selector", rule => {
if (rule.params.indexOf("--") === 0) {

// display big warning once
Expand Down
14 changes: 7 additions & 7 deletions src/option.messages.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import postcssMessagesConsole from "postcss-reporter"
// https://github.com/postcss/postcss-messages/issues/16
// import postcssMessagesCSS from "postcss-messages"
import postcssMessagesCSS from "./plugins/messages"
import postcssMessageCSSstyles from "./option.messages.browser.styles.js"
// https://github.com/postcss/postcss-browser-reporter/issues/16
// import postcssBrowserReporter from "postcss-browser-reporter"
import postcssBrowserReporter from "./plugins/messages"
import postcssBrowserReporterStyles from "./option.messages.browser.styles.js"

export default (options) => {
// true === all interfaces
if (options.messages === true) {
return [
postcssMessagesCSS({styles: postcssMessageCSSstyles}),
postcssBrowserReporter({styles: postcssBrowserReporterStyles}),
postcssMessagesConsole,
]
}
Expand All @@ -18,8 +18,8 @@ export default (options) => {
return [
...options.messages.browser
? [
postcssMessagesCSS({
styles: postcssMessageCSSstyles,
postcssBrowserReporter({
styles: postcssBrowserReporterStyles,
...(
typeof options.messages.browser === "object"
? options.messages.browser
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/messages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// why this plugin ?
// https://github.com/postcss/postcss-messages/issues/16
// https://github.com/postcss/postcss-browser-reporter/issues/16

import postcss from "postcss"
import colors from "chalk"
Expand Down Expand Up @@ -41,7 +41,7 @@ function escapeForCSS(string) {
}

export default postcss.plugin(
"postcss-messages",
"postcss-browser-reporter",
(options) => {
options = {
...options,
Expand Down Expand Up @@ -69,7 +69,7 @@ export default postcss.plugin(
selector = options.selector
}
else {
css.eachRule(rule => {
css.walkRules(rule => {
if (
rule.selector === "html::before" ||
rule.selector === "html:before"
Expand Down