Skip to content

Commit 9f094c7

Browse files
committedApr 12, 2020
9.0.0
1 parent 7c11ae7 commit 9f094c7

11 files changed

+99
-85
lines changed
 

‎.appveyor.yml

-18
This file was deleted.

‎.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
dist
12
node_modules
2-
/index.*
33
package-lock.json
44
*.log*
55
*.result.css

‎.rollup.js

+13-24
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
1-
import babel from 'rollup-plugin-babel';
1+
import pkg from './package.json'
22

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

2211
function patchBabelPluginSyntaxImportMeta () {
2312
return {
2413
name: 'patch-babel-plugin-syntax-import-meta',
2514
renderChunk (code, chunk, options) {
26-
const currentUrlMatch = /var url = require\('url'\);([\W\w]+)const currentURL[^\n]+\nconst currentFilename[^\n]+/;
15+
const currentUrlMatch = /var url = require\('url'\);([\W\w]+)const currentURL[^\n]+\n(const currentFilename)[^\n]+/
2716

28-
const shouldTransformImportMeta = options.format === 'cjs' && currentUrlMatch.test(code);
17+
const shouldTransformImportMeta = options.format === 'cjs' && currentUrlMatch.test(code)
2918

3019
if (shouldTransformImportMeta) {
31-
const updatedCode = code.replace(currentUrlMatch, '$1const currentFilename = __filename;');
20+
const updatedCode = code.replace(currentUrlMatch, '$1$2 = __filename;')
3221

33-
return updatedCode;
22+
return updatedCode
3423
}
3524

36-
return null;
25+
return null
3726
}
38-
};
27+
}
3928
}

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ os:
88
- osx
99

1010
node_js:
11-
- 8
11+
- 10
1212

1313
install:
1414
- npm install --ignore-scripts

‎CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changes to PostCSS Normalize
22

3+
### 9.0.0 (April 12, 2020)
4+
5+
- Updated: `normalize.css` to support any version (major)
6+
- Updated: `sanitize.css` to support any version (major)
7+
- Updated: Node support to 10.0.0 (major).
8+
- Removed: Unused `browserslist` dependency
9+
310
### 8.0.1 (June 10, 2019)
411

512
- Fixed: Issue with Windows failing to resolve normalize
@@ -44,7 +51,7 @@ versions of PostCSS to use PostCSS Normalize. This update resolves that.
4451

4552
### 3.0.0 (May 26, 2017)
4653

47-
- Use jonathantneal/normalize.css v7
54+
- Use csstools/normalize.css v7
4855
- Change the insertion point to `@import-normalize` to avoid confusion or
4956
collision with standard import behavior
5057

‎README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# PostCSS Normalize [<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-normalize.svg" height="20">][npm-url]
4+
[<img alt="build status" src="https://img.shields.io/travis/csstools/postcss-normalize/master.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 Normalize] lets you use the parts of [normalize.css] or [sanitize.css]
88
that you need from your [browserslist].

‎package.json

+53-34
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,83 @@
11
{
22
"name": "postcss-normalize",
3-
"version": "8.0.1",
3+
"version": "9.0.0",
44
"description": "Use the parts of normalize.css or sanitize.css you need from your browserslist",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",
77
"repository": "csstools/postcss-normalize",
88
"homepage": "https://github.com/csstools/postcss-normalize#readme",
99
"bugs": "https://github.com/csstools/postcss-normalize/issues",
10-
"main": "index.cjs.js",
11-
"module": "index.esm.mjs",
10+
"main": "dist/index.cjs.js",
11+
"module": "dist/index.esm.mjs",
1212
"files": [
13-
"index.cjs.js",
14-
"index.cjs.js.map",
15-
"index.esm.mjs",
16-
"index.esm.mjs.map"
13+
"dist"
1714
],
1815
"scripts": {
19-
"build": "rollup --config .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 --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"
2523
},
2624
"engines": {
27-
"node": ">=8.0.0"
25+
"node": ">=10.0.0"
2826
},
2927
"dependencies": {
30-
"@csstools/normalize.css": "^10.1.0",
31-
"browserslist": "^4.6.2",
32-
"postcss": "^7.0.17",
28+
"@csstools/normalize.css": "*",
29+
"postcss": "^7.0.27",
3330
"postcss-browser-comments": "^3.0.0",
34-
"sanitize.css": "^10.0.0"
31+
"sanitize.css": "*"
3532
},
3633
"devDependencies": {
37-
"@babel/core": "^7.4.5",
38-
"@babel/plugin-syntax-import-meta": "^7.2.0",
39-
"@babel/preset-env": "^7.4.5",
40-
"babel-eslint": "^10.0.1",
41-
"eslint": "^5.16.0",
34+
"@babel/core": "^7.9.0",
35+
"@babel/plugin-syntax-import-meta": "^7.8.3",
36+
"@babel/preset-env": "^7.9.5",
37+
"babel-eslint": "^10.1.0",
38+
"eslint": "^6.8.0",
4239
"postcss-import": "^12.0.1",
43-
"postcss-tape": "^5.0.0",
40+
"postcss-tape": "^5.0.2",
4441
"pre-commit": "^1.2.2",
45-
"rollup": "^1.14.6",
46-
"rollup-plugin-babel": "^4.3.2"
42+
"rollup": "^2.6.0",
43+
"rollup-plugin-babel": "^4.4.0"
44+
},
45+
"babel": {
46+
"plugins": [
47+
"@babel/plugin-syntax-import-meta"
48+
],
49+
"presets": [
50+
[
51+
"@babel/env",
52+
{
53+
"targets": "maintained node versions"
54+
}
55+
]
56+
]
4757
},
4858
"eslintConfig": {
4959
"env": {
50-
"browser": true,
5160
"es6": true,
5261
"node": true
5362
},
5463
"extends": "eslint:recommended",
55-
"parser": "babel-eslint",
56-
"parserOptions": {
57-
"ecmaVersion": 2018,
58-
"impliedStrict": true,
59-
"sourceType": "module"
60-
},
61-
"root": true
64+
"parser": "babel-eslint"
65+
},
66+
"rollup": {
67+
"input": "src/index.js",
68+
"plugins": [
69+
"rollup-plugin-babel"
70+
],
71+
"output": [
72+
{
73+
"file": "dist/index.cjs.js",
74+
"format": "cjs"
75+
},
76+
{
77+
"file": "dist/index.esm.js",
78+
"format": "esm"
79+
}
80+
]
6281
},
6382
"keywords": [
6483
"postcss",

‎test/force-sanitize-all.expect.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,14 @@ textarea {
364364
select {
365365
-moz-appearance: none;
366366
-webkit-appearance: none;
367-
background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E") no-repeat right center / 1em;
367+
background: no-repeat right center / 1em;
368368
border-radius: 0;
369369
padding-right: 1em;
370+
}/**
371+
* Change the inconsistent appearance in all browsers (opinionated).
372+
*/
373+
select:not([multiple]):not([size]) {
374+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E");
370375
}/**
371376
* Change the inconsistent appearance in IE (opinionated).
372377
*/

‎test/import-normalize.expect.css

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/import-sanitize-all.expect.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,14 @@ textarea {
364364
select {
365365
-moz-appearance: none;
366366
-webkit-appearance: none;
367-
background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E") no-repeat right center / 1em;
367+
background: no-repeat right center / 1em;
368368
border-radius: 0;
369369
padding-right: 1em;
370+
}/**
371+
* Change the inconsistent appearance in all browsers (opinionated).
372+
*/
373+
select:not([multiple]):not([size]) {
374+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E");
370375
}/**
371376
* Change the inconsistent appearance in IE (opinionated).
372377
*/

‎test/import-sanitize-forms.expect.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,14 @@ textarea {
364364
select {
365365
-moz-appearance: none;
366366
-webkit-appearance: none;
367-
background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E") no-repeat right center / 1em;
367+
background: no-repeat right center / 1em;
368368
border-radius: 0;
369369
padding-right: 1em;
370+
}/**
371+
* Change the inconsistent appearance in all browsers (opinionated).
372+
*/
373+
select:not([multiple]):not([size]) {
374+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4'%3E%3Cpath d='M4 0h6L7 4'/%3E%3C/svg%3E");
370375
}/**
371376
* Change the inconsistent appearance in IE (opinionated).
372377
*/

0 commit comments

Comments
 (0)
Please sign in to comment.