Skip to content

Commit

Permalink
9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Apr 12, 2020
1 parent 7c11ae7 commit 9f094c7
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 85 deletions.
18 changes: 0 additions & 18 deletions .appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dist
node_modules
/index.*
package-lock.json
*.log*
*.result.css
Expand Down
37 changes: 13 additions & 24 deletions .rollup.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,28 @@
import babel from 'rollup-plugin-babel';
import pkg from './package.json'

export default {
input: 'src/index.js',
output: [
{ file: 'index.cjs.js', format: 'cjs', sourcemap: true, strict: false },
{ file: 'index.esm.mjs', format: 'esm', sourcemap: true, strict: false }
],
plugins: [
patchBabelPluginSyntaxImportMeta(),
babel({
plugins: [
['@babel/plugin-syntax-import-meta']
],
presets: [
['@babel/preset-env', { modules: false, targets: { node: 8 } }]
]
})
]
};
...pkg.rollup,
plugins: [patchBabelPluginSyntaxImportMeta(), ...pkg.rollup.plugins.map(plugin => require(plugin)())],
onwarn(warning, warn) {
if (warning.code !== 'UNRESOLVED_IMPORT') warn(warning)
}
}

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

const shouldTransformImportMeta = options.format === 'cjs' && currentUrlMatch.test(code);
const shouldTransformImportMeta = options.format === 'cjs' && currentUrlMatch.test(code)

if (shouldTransformImportMeta) {
const updatedCode = code.replace(currentUrlMatch, '$1const currentFilename = __filename;');
const updatedCode = code.replace(currentUrlMatch, '$1$2 = __filename;')

return updatedCode;
return updatedCode
}

return null;
return null
}
};
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ os:
- osx

node_js:
- 8
- 10

install:
- npm install --ignore-scripts
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changes to PostCSS Normalize

### 9.0.0 (April 12, 2020)

- Updated: `normalize.css` to support any version (major)
- Updated: `sanitize.css` to support any version (major)
- Updated: Node support to 10.0.0 (major).
- Removed: Unused `browserslist` dependency

### 8.0.1 (June 10, 2019)

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

### 3.0.0 (May 26, 2017)

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

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PostCSS Normalize [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]

[![NPM Version][npm-img]][npm-url]
[![Build Status][cli-img]][cli-url]
[![Support Chat][git-img]][git-url]
[<img alt="npm version" src="https://img.shields.io/npm/v/postcss-normalize.svg" height="20">][npm-url]
[<img alt="build status" src="https://img.shields.io/travis/csstools/postcss-normalize/master.svg" height="20">][cli-url]
[<img alt="support chat" src="https://img.shields.io/badge/support-chat-blue.svg" height="20">][git-url]

[PostCSS Normalize] lets you use the parts of [normalize.css] or [sanitize.css]
that you need from your [browserslist].
Expand Down
87 changes: 53 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,83 @@
{
"name": "postcss-normalize",
"version": "8.0.1",
"version": "9.0.0",
"description": "Use the parts of normalize.css or sanitize.css you need from your browserslist",
"author": "Jonathan Neal <[email protected]>",
"license": "CC0-1.0",
"repository": "csstools/postcss-normalize",
"homepage": "https://github.com/csstools/postcss-normalize#readme",
"bugs": "https://github.com/csstools/postcss-normalize/issues",
"main": "index.cjs.js",
"module": "index.esm.mjs",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.mjs",
"files": [
"index.cjs.js",
"index.cjs.js.map",
"index.esm.mjs",
"index.esm.mjs.map"
"dist"
],
"scripts": {
"build": "rollup --config .rollup.js --silent",
"prepublishOnly": "npm test",
"pretest:tape": "npm run build",
"test": "npm run test:js && npm run test:tape",
"test:js": "eslint src/{*,**/*}.js --cache --ignore-path .gitignore --quiet",
"test:tape": "postcss-tape"
"build": "npx rollup -c .rollup.js",
"build:watch": "npx rollup -c .rollup.js --watch",
"lint": "npx eslint --cache src",
"lint:fix": "npx eslint --cache --fix",
"pretest": "npm install && npm run build",
"test": "npm run lint && npm run tape",
"tape": "npx postcss-tape"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.0.0"
},
"dependencies": {
"@csstools/normalize.css": "^10.1.0",
"browserslist": "^4.6.2",
"postcss": "^7.0.17",
"@csstools/normalize.css": "*",
"postcss": "^7.0.27",
"postcss-browser-comments": "^3.0.0",
"sanitize.css": "^10.0.0"
"sanitize.css": "*"
},
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/preset-env": "^7.4.5",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"@babel/core": "^7.9.0",
"@babel/plugin-syntax-import-meta": "^7.8.3",
"@babel/preset-env": "^7.9.5",
"babel-eslint": "^10.1.0",
"eslint": "^6.8.0",
"postcss-import": "^12.0.1",
"postcss-tape": "^5.0.0",
"postcss-tape": "^5.0.2",
"pre-commit": "^1.2.2",
"rollup": "^1.14.6",
"rollup-plugin-babel": "^4.3.2"
"rollup": "^2.6.0",
"rollup-plugin-babel": "^4.4.0"
},
"babel": {
"plugins": [
"@babel/plugin-syntax-import-meta"
],
"presets": [
[
"@babel/env",
{
"targets": "maintained node versions"
}
]
]
},
"eslintConfig": {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2018,
"impliedStrict": true,
"sourceType": "module"
},
"root": true
"parser": "babel-eslint"
},
"rollup": {
"input": "src/index.js",
"plugins": [
"rollup-plugin-babel"
],
"output": [
{
"file": "dist/index.cjs.js",
"format": "cjs"
},
{
"file": "dist/index.esm.js",
"format": "esm"
}
]
},
"keywords": [
"postcss",
Expand Down
7 changes: 6 additions & 1 deletion test/force-sanitize-all.expect.css
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,14 @@ textarea {
select {
-moz-appearance: none;
-webkit-appearance: none;
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;
background: no-repeat right center / 1em;
border-radius: 0;
padding-right: 1em;
}/**
* Change the inconsistent appearance in all browsers (opinionated).
*/
select:not([multiple]):not([size]) {
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");
}/**
* Change the inconsistent appearance in IE (opinionated).
*/
Expand Down
2 changes: 2 additions & 0 deletions test/import-normalize.expect.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f094c7

Please sign in to comment.