Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 41aa293

Browse files
Merge pull request #220 from csstools/next/release
PostCSS 8 Support
2 parents 268e8a3 + 860144d commit 41aa293

27 files changed

+398
-500
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/test.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test
2+
on:
3+
push:
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node: [12, 16]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: ${{ matrix.node }}
16+
17+
- run: yarn install --ignore-scripts
18+
- run: yarn run test

.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
dist
12
node_modules
23
package-lock.json
4+
yarn.lock
35
*.log*
46
*.result.css
57
.*
68
!.editorconfig
9+
!.gitattributes
10+
!.github
711
!.gitignore
812
!.rollup.js
913
!.tape.js
10-
!.travis.yml
11-
/index.js*
12-
/index.mjs*

.rollup.js

+7-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
import babel from 'rollup-plugin-babel';
1+
import pkg from './package.json'
22

33
export default {
4-
input: 'src/postcss.js',
5-
output: [
6-
{ file: 'index.js', format: 'cjs', sourcemap: true },
7-
{ file: 'index.mjs', format: 'esm', sourcemap: true }
8-
],
9-
plugins: [
10-
babel({
11-
presets: [
12-
['@babel/env', { targets: { node: 6 } }]
13-
]
14-
})
15-
]
16-
};
4+
...pkg.rollup,
5+
plugins: pkg.rollup.plugins.map(plugin => require(plugin)()),
6+
onwarn(warning, warn) {
7+
if (warning.code !== 'UNRESOLVED_IMPORT') warn(warning)
8+
}
9+
}

.tape.js

+1-12
Original file line numberDiff line numberDiff line change
@@ -89,29 +89,18 @@ module.exports = {
8989
}
9090
},
9191
'insert:after': {
92-
message: 'supports { stage: 1, features: { "color-mod-function": { unresolved: "warn" } }, insertAfter: { "color-mod-function": [ require("postcss-simple-vars")() ] } } usage',
92+
message: 'supports { stage: 1, insertAfter: { "color-mod-function": [ require("postcss-simple-vars")() ] } } usage',
9393
options: {
9494
stage: 1,
95-
features: {
96-
'color-mod-function': {
97-
unresolved: 'warn'
98-
}
99-
},
10095
insertAfter: {
10196
'color-mod-function': require('postcss-simple-vars')
10297
}
10398
},
104-
warnings: 2
10599
},
106100
'insert:after:exec': {
107101
message: 'supports { stage: 2, features: { "color-mod-function": { unresolved: "ignore" } }, insertAfter: { "color-mod-function": require("postcss-simple-vars")() } } usage',
108102
options: {
109103
stage: 2,
110-
features: {
111-
'color-mod-function': {
112-
unresolved: 'ignore'
113-
}
114-
},
115104
insertAfter: {
116105
'color-mod-function': require('postcss-simple-vars')()
117106
}

.travis.yml

-18
This file was deleted.

CHANGELOG.md

+39
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Changes to PostCSS Preset Env
22

3+
### 7.0.0 (September 22, 2021)
4+
5+
- Updated `autoprefixer` to 10.3.5 (major)
6+
- Updated `browserslist` to 4.12.0 (minor)
7+
- Updated `caniuse-lite` to 1.0.30001048 (patch)
8+
- Updated `css-blank-pseudo` to 2.0.0 (major)
9+
- Updated `css-has-pseudo` to 2.0.0 (major)
10+
- Updated `css-prefers-color-scheme` to 5.0.0 (major)
11+
- Updated `cssdb` to 5.0.0 (major)
12+
- Updated `postcss` to 7.0.27 (major)
13+
- Updated `postcss-attribute-case-insensitive` to 5.0.0 (major)
14+
- Updated `postcss-color-functional-notation` to 4.0.0 (major)
15+
- Updated `postcss-color-hex-alpha` to 7.0.0 (major)
16+
- Updated `postcss-color-rebeccapurple` to 7.0.0 (major)
17+
- Updated `postcss-custom-media` to 8.0.0 (major)
18+
- Updated `postcss-custom-properties` to 12.0.0 (major)
19+
- Updated `postcss-custom-selectors` to 6.0.0 (major)
20+
- Updated `postcss-dir-pseudo-class` to 6.0.0 (major)
21+
- Updated `postcss-double-position-gradients` to 3.0.0 (major)
22+
- Updated `postcss-env-function` to 4.0.0 (major)
23+
- Updated `postcss-focus-visible` to 6.0.1 (major)
24+
- Updated `postcss-focus-within` to 5.0.1 (major)
25+
- Updated `postcss-font-variant` to 5.0.0 (major)
26+
- Updated `postcss-gap-properties` to 3.0.0 (major)
27+
- Updated `postcss-image-set-function` to 4.0.0 (major)
28+
- Updated `postcss-initial` to 3.0.2 (patch)
29+
- Updated `postcss-lab-function` to 4.0.0 (major)
30+
- Updated `postcss-logical` to 5.0.0 (major)
31+
- Updated `postcss-media-minmax` to 5.0.0 (major)
32+
- Updated `postcss-nesting` to 8.0.1 (major)
33+
- Updated `postcss-overflow-shorthand` to 3.0.0 (major)
34+
- Updated `postcss-page-break` to 3.0.4 (major)
35+
- Updated `postcss-place` to 7.0.0 (major)
36+
- Updated `postcss-pseudo-class-any-link` to 7.0.0 (major)
37+
- Updated `postcss-replace-overflow-wrap` to 4.0.0 (major)
38+
- Updated `postcss-selector-matches` to 4.0.0 (major)
39+
- Removed `postcss-color-gray`
40+
- Updated support for Node 12+ (major)
41+
342
### 6.7.0 (July 8, 2019)
443

544
- Fixed the issue of autoprefixer alerting an upcoming change to the API

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# PostCSS Preset Env [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]
22

3-
[![NPM Version][npm-img]][npm-url]
4-
[![Build Status][cli-img]][cli-url]
5-
[![Support Chat][git-img]][git-url]
3+
[<img alt="npm version" src="https://img.shields.io/npm/v/postcss-preset-env.svg" height="20">][npm-url]
4+
[<img alt="build status" src="https://github.com/csstools/postcss-preset-env/workflows/test/badge.svg" height="20">][cli-url]
5+
[<img alt="support chat" src="https://img.shields.io/badge/support-chat-blue.svg" height="20">][git-url]
66

77
[PostCSS Preset Env] lets you convert modern CSS into something most browsers
88
can understand, determining the polyfills you need based on your targeted
@@ -362,8 +362,8 @@ postcssPresetEnv({
362362
});
363363
```
364364

365-
[cli-img]: https://img.shields.io/travis/csstools/postcss-preset-env/master.svg
366-
[cli-url]: https://travis-ci.org/csstools/postcss-preset-env
365+
[cli-img]: https://github.com/postcss/postcss-preset-env/workflows/test/badge.svg
366+
[cli-url]: https://github.com/postcss/postcss-preset-env/actions/workflows/test.yml?query=workflow/test
367367
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
368368
[git-url]: https://gitter.im/postcss/postcss
369369
[npm-img]: https://img.shields.io/npm/v/postcss-preset-env.svg

package.json

+95-62
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,118 @@
11
{
22
"name": "postcss-preset-env",
3-
"version": "6.7.0",
3+
"version": "7.0.0",
44
"description": "Convert modern CSS into something browsers understand",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",
77
"repository": "csstools/postcss-preset-env",
88
"homepage": "https://github.com/csstools/postcss-preset-env#readme",
99
"bugs": "https://github.com/csstools/postcss-preset-env/issues",
10-
"main": "index.js",
11-
"module": "index.mjs",
10+
"main": "dist/index.js",
11+
"module": "dist/index.mjs",
1212
"files": [
13-
"index.js",
14-
"index.js.map",
15-
"index.mjs",
16-
"index.mjs.map"
13+
"dist"
1714
],
1815
"scripts": {
19-
"build": "rollup -c .rollup.js --silent",
20-
"prepublishOnly": "npm test",
21-
"pretest:tape": "npm run build",
22-
"test": "npm run test:js && npm run test:tape",
23-
"test:js": "eslint src/*.js src/lib/*.js src/patch/*.js --cache --ignore-path .gitignore --quiet",
24-
"test:tape": "postcss-tape"
16+
"build": "npx rollup -c .rollup.js",
17+
"build:watch": "npx rollup -c .rollup.js --watch",
18+
"lint": "npx eslint --cache src",
19+
"lint:fix": "npx eslint --cache --fix",
20+
"pretest": "npm install && npm run build",
21+
"test": "npm run lint && npm run tape",
22+
"tape": "npx postcss-tape",
23+
"prepublishOnly": "npm test"
2524
},
2625
"engines": {
27-
"node": ">=6.0.0"
26+
"node": ">=12"
27+
},
28+
"peerDependencies": {
29+
"postcss": "^8.3"
2830
},
2931
"dependencies": {
30-
"autoprefixer": "^9.6.1",
31-
"browserslist": "^4.6.4",
32-
"caniuse-lite": "^1.0.30001040",
33-
"css-blank-pseudo": "^0.1.4",
34-
"css-has-pseudo": "^0.10.0",
35-
"css-prefers-color-scheme": "^3.1.1",
36-
"cssdb": "^4.4.0",
37-
"postcss": "^8.3.4",
38-
"postcss-attribute-case-insensitive": "^4.0.1",
39-
"postcss-color-functional-notation": "^2.0.1",
40-
"postcss-color-gray": "^5.0.0",
41-
"postcss-color-hex-alpha": "^5.0.3",
42-
"postcss-color-mod-function": "^3.0.3",
43-
"postcss-color-rebeccapurple": "^4.0.1",
44-
"postcss-custom-media": "^7.0.8",
45-
"postcss-custom-properties": "^8.0.11",
46-
"postcss-custom-selectors": "^5.1.2",
47-
"postcss-dir-pseudo-class": "^5.0.0",
48-
"postcss-double-position-gradients": "^1.0.0",
49-
"postcss-env-function": "^2.0.2",
50-
"postcss-focus-visible": "^4.0.0",
51-
"postcss-focus-within": "^4.0.0",
52-
"postcss-font-variant": "^4.0.0",
53-
"postcss-gap-properties": "^2.0.0",
54-
"postcss-image-set-function": "^3.0.1",
55-
"postcss-initial": "^3.0.1",
56-
"postcss-lab-function": "^2.0.1",
57-
"postcss-logical": "^3.0.0",
58-
"postcss-media-minmax": "^4.0.0",
59-
"postcss-nesting": "^7.0.0",
60-
"postcss-overflow-shorthand": "^2.0.0",
61-
"postcss-page-break": "^2.0.0",
62-
"postcss-place": "^4.0.1",
63-
"postcss-pseudo-class-any-link": "^6.0.0",
64-
"postcss-replace-overflow-wrap": "^3.0.0",
65-
"postcss-selector-matches": "^4.0.0",
66-
"postcss-selector-not": "^4.0.0"
32+
"autoprefixer": "^10.4.0",
33+
"browserslist": "^4.17.5",
34+
"caniuse-lite": "^1.0.30001272",
35+
"css-blank-pseudo": "^2.0.0",
36+
"css-has-pseudo": "^2.0.0",
37+
"css-prefers-color-scheme": "^5.0.0",
38+
"cssdb": "^5.0.0",
39+
"postcss": "^8.3",
40+
"postcss-attribute-case-insensitive": "^5.0.0",
41+
"postcss-color-functional-notation": "^4.0.0",
42+
"postcss-color-hex-alpha": "^8.0.0",
43+
"postcss-color-rebeccapurple": "^7.0.0",
44+
"postcss-custom-media": "^8.0.0",
45+
"postcss-custom-properties": "^12.0.0",
46+
"postcss-custom-selectors": "^6.0.0",
47+
"postcss-dir-pseudo-class": "^6.0.0",
48+
"postcss-double-position-gradients": "^3.0.0",
49+
"postcss-env-function": "^4.0.1",
50+
"postcss-focus-visible": "^6.0.1",
51+
"postcss-focus-within": "^5.0.1",
52+
"postcss-font-variant": "^5.0.0",
53+
"postcss-gap-properties": "^3.0.0",
54+
"postcss-image-set-function": "^4.0.0",
55+
"postcss-initial": "^3.0.4",
56+
"postcss-lab-function": "^4.0.0",
57+
"postcss-logical": "^5.0.0",
58+
"postcss-media-minmax": "^5.0.0",
59+
"postcss-nesting": "^10.0.0",
60+
"postcss-overflow-shorthand": "^3.0.0",
61+
"postcss-page-break": "^3.0.4",
62+
"postcss-place": "^7.0.0",
63+
"postcss-pseudo-class-any-link": "^7.0.0",
64+
"postcss-replace-overflow-wrap": "^4.0.0",
65+
"postcss-selector-not": "^5.0.0"
6766
},
6867
"devDependencies": {
69-
"@babel/core": "^7.5.0",
70-
"@babel/preset-env": "^7.5.2",
71-
"babel-eslint": "^10.0.2",
72-
"eslint": "^5.16.0",
73-
"eslint-config-dev": "^2.0.0",
74-
"postcss-simple-vars": "^5.0.2",
75-
"postcss-tape": "^4.0.0",
68+
"@babel/core": "^7.15.8",
69+
"@babel/preset-env": "^7.15.8",
70+
"eslint": "^8.1.0",
71+
"postcss-simple-vars": "^6.0.3",
72+
"postcss-tape": "^6.0.1",
7673
"pre-commit": "^1.2.2",
77-
"rollup": "^1.16.6",
78-
"rollup-plugin-babel": "^4.3.3"
74+
"rollup": "^2.58.3",
75+
"rollup-plugin-babel": "^4.4.0"
76+
},
77+
"babel": {
78+
"presets": [
79+
[
80+
"@babel/env",
81+
{
82+
"targets": "maintained node versions"
83+
}
84+
]
85+
]
7986
},
8087
"eslintConfig": {
81-
"extends": "dev",
82-
"parser": "babel-eslint"
88+
"env": {
89+
"browser": true,
90+
"es6": true,
91+
"node": true
92+
},
93+
"extends": "eslint:recommended",
94+
"parserOptions": {
95+
"ecmaVersion": 2020,
96+
"sourceType": "module"
97+
},
98+
"root": true
99+
},
100+
"rollup": {
101+
"input": "src/postcss.js",
102+
"plugins": [
103+
"rollup-plugin-babel"
104+
],
105+
"output": [
106+
{
107+
"exports": "default",
108+
"file": "dist/index.js",
109+
"format": "cjs"
110+
},
111+
{
112+
"file": "dist/index.mjs",
113+
"format": "esm"
114+
}
115+
]
83116
},
84117
"keywords": [
85118
"postcss",

src/cli.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (process.argv.length < 3) {
1414
}
1515

1616
// get process and plugin options from the command line
17-
const fileRegExp = /^[\w\/.]+$/;
17+
const fileRegExp = /^[\w/.]+$/;
1818
const argRegExp = /^--(\w+)=("|')?(.+)\2$/;
1919
const relaxedJsonPropRegExp = /(['"])?([a-z0-9A-Z_]+)(['"])?:/g;
2020
const relaxedJsonValueRegExp = /("[a-z0-9A-Z_]+":\s*)(?!true|false|null|\d+)'?([A-z0-9]+)'?([,}])/g;
@@ -106,6 +106,7 @@ function getStdin() {
106106
process.stdin.on('readable', () => {
107107
let chunk;
108108

109+
// eslint-disable-next-line no-cond-assign
109110
while (chunk = process.stdin.read()) {
110111
data += chunk;
111112
}

src/lib/ids-by-execution-order.js

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export default [
1919
'all-property', // run all-property before other property polyfills
2020
'color-functional-notation',
2121
'double-position-gradients',
22-
'gray-function',
2322
'hexadecimal-alpha-notation',
2423
'lab-function',
2524
'rebeccapurple-color',

0 commit comments

Comments
 (0)