Skip to content

Commit 2f04d18

Browse files
committed
8.0.0
1 parent febf20f commit 2f04d18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4202
-690
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
2-
index.*.js
2+
/index.*
33
package-lock.json
44
*.log*
55
*.result.css

.rollup.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
import babel from 'rollup-plugin-babel';
22

33
export default {
4-
input: 'index.js',
4+
input: 'src/index.js',
55
output: [
6-
{ file: 'index.cjs.js', format: 'cjs' },
7-
{ file: 'index.es.js', format: 'es' }
6+
{ file: 'index.cjs.js', format: 'cjs', sourcemap: true, strict: false },
7+
{ file: 'index.esm.mjs', format: 'esm', sourcemap: true, strict: false }
88
],
99
plugins: [
1010
babel({
11+
plugins: [
12+
['@babel/plugin-syntax-import-meta']
13+
],
1114
presets: [
12-
['@babel/env', { modules: false, targets: { node: 6 } }]
15+
['@babel/preset-env', { modules: false, targets: { node: 8 } }]
1316
]
14-
})
17+
}),
18+
patchBabelPluginSyntaxImportMeta()
1519
]
1620
};
21+
22+
function patchBabelPluginSyntaxImportMeta () {
23+
return {
24+
name: 'patch-babel-plugin-syntax-import-meta',
25+
renderChunk (code) {
26+
const requireMatch = /new \(require\('u' \+ 'rl'\)\.URL\)/;
27+
28+
return code.replace(requireMatch, 'new url.URL');
29+
}
30+
};
31+
}

.tape.js

Lines changed: 79 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,83 @@
11
module.exports = {
2-
'postcss-normalize': {
3-
'basic': {
4-
message: 'supports basic usage'
5-
},
6-
'basic:last-2': {
7-
message: 'supports { browsers: "last 2 versions" }',
8-
options: {
9-
browsers: 'last 2 versions'
10-
}
11-
},
12-
'basic:last-1': {
13-
message: 'supports { browsers: "last 1 versions" }',
14-
options: {
15-
browsers: 'last 1 versions'
16-
}
17-
},
18-
'insertion-after': {
19-
message: 'support an insertion point (at the end of the file)'
20-
},
21-
'insertion-duplicate': {
22-
message: 'removes duplicate insertion points'
23-
},
24-
'option-force-import': {
25-
message: 'forces an import at the beginning of the file',
26-
options: {
27-
forceImport: true
28-
}
2+
/* Test Basic Usage */
3+
'basic-normalize': {
4+
message: 'supports @import-normalize usage'
5+
},
6+
'basic-sanitize': {
7+
message: 'supports @import-sanitize usage'
8+
},
9+
10+
/* Test @import Usage */
11+
'import-normalize': {
12+
message: 'supports @import "normalize" usage',
13+
expect: "normalize.expect.css"
14+
},
15+
'import-normalize-opinionated': {
16+
message: 'supports @import "normalize/opinionated" usage'
17+
},
18+
'import-sanitize': {
19+
message: 'supports @import "sanitize" usage',
20+
expect: "sanitize.expect.css"
21+
},
22+
'import-sanitize-forms': {
23+
message: 'supports @import "sanitize/forms" usage'
24+
},
25+
'import-sanitize-all': {
26+
message: 'supports @import "sanitize/*" + (forms + page + typography) usage'
27+
},
28+
29+
/* Test { browsers } Usage */
30+
'browsers-normalize': {
31+
message: 'supports { browsers: "last 2 * versions, not EdgeHTML" }',
32+
options: {
33+
browsers: 'last 2 chrome versions, edge >= 72, last 2 firefox versions, last 2 safari versions, last 1 ios versions, last 1 android versions'
2934
}
35+
},
36+
37+
/* Test { forceImport } Usage */
38+
'force-normalize': {
39+
message: 'supports { forceImport: true }',
40+
options: {
41+
forceImport: true
42+
}
43+
},
44+
'force-sanitize': {
45+
message: 'supports { forceImport: "sanitize" }',
46+
options: {
47+
forceImport: 'sanitize'
48+
}
49+
},
50+
'force-sanitize-all': {
51+
message: 'supports { forceImport: "sanitize/*" }',
52+
options: {
53+
forceImport: 'sanitize/*'
54+
}
55+
},
56+
57+
/* Test { allowDuplicates } Usage */
58+
'duplicates': {
59+
message: 'supports preventing duplicates'
60+
},
61+
'duplicates:allow': {
62+
message: 'supports allowing duplicates { allowDuplicates: true }',
63+
options: {
64+
allowDuplicates: true
65+
}
66+
},
67+
68+
/* Test PostCSS Import Usage */
69+
'postcss-import': {
70+
message: 'supports PostCSS Import Usage',
71+
source: 'import-normalize.css',
72+
expect: 'import-normalize.expect.css',
73+
plugin: (() => {
74+
const postcss = require('postcss');
75+
const postcssImport = require('postcss-import');
76+
const postcssNormalize = require('.');
77+
78+
const plugin = postcss([ postcssImport(postcssNormalize().postcssImport()) ]);
79+
80+
return plugin;
81+
})()
3082
}
3183
};

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
language: node_js
44

55
node_js:
6-
- 6
6+
- 8
77

88
install:
99
- npm install --ignore-scripts

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changes to PostCSS Normalize
22

3+
### 8.0.0 (June 3, 2019)
4+
5+
- Added: `sanitize.css` 10.0.0 (major)
6+
- Updated: `@csstools/normalize.css` to 10.1.0 (major)
7+
- Updated: `browserslist` to 4.5.6 (minor)
8+
- Updated: `postcss` to 7.0.16 (patch)
9+
- Updated: Node 8+ compatibility (major)
10+
311
### 7.0.1 (August 24, 2018)
412

513
- Use postcss-browser-comments v2.0.0 (major, but a patch for this project)

INSTALL.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,20 @@ module.exports = {
8989

9090
## Create React App
9191

92-
Create React App, starting from **v3.0.0**, [natively](https://facebook.github.io/create-react-app/docs/adding-css-reset) supports postcss-normalize. To start using it, simply add
92+
Starting from **v3.0.0**,
93+
[Create React App already includes postcss-normalize](https://facebook.github.io/create-react-app/docs/adding-css-reset).
94+
To start using it, use the `@import-normalize` rule:
9395

94-
```
96+
```pcss
9597
// index.css
9698
9799
@import-normalize;
98100
```
99101

100-
If you're using ***older versions*** of Create React App, follow these instructions:
102+
---
101103

102-
Add [React App Rewired] and [React App Rewire PostCSS] to your project:
104+
If you're using an ***older version*** of Create React App, add
105+
[React App Rewired] and [React App Rewire PostCSS] to your project:
103106

104107
```bash
105108
npm install react-app-rewired react-app-rewire-postcss --save-dev

0 commit comments

Comments
 (0)