Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Support Node 10 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal authored Sep 18, 2020
1 parent 17a2bbd commit 99de157
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 240 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
node_modules
package-lock.json
.*
Expand All @@ -6,4 +7,3 @@ package-lock.json
!.travis.yml
*.log*
*.result.css
/index.*
16 changes: 2 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,9 @@ os:
- osx

node_js:
- 14
- 12
- 10

jobs:
include:
- node_js: 8
os: windows
before_script: |
npm install postcss@7
nvs add 12
nvs use 12
npm run pretest:tape
nvs use 8
script: npm run test:tape:7 -- --ci true
- 12
- 14

install:
- git config --global core.autocrlf false
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PostCSS Tape [<img src="http://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]
[![Gitter Chat][git-img]][git-url]
[<img alt="NPM Version" src="https://img.shields.io/npm/v/postcss-tape.svg" height="20">][npm-url]
[<img alt="Build Status" src="https://img.shields.io/travis/csstools/postcss-tape/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 Tape] lets you quickly test [PostCSS] plugins.

Expand All @@ -22,7 +22,7 @@

3. Add tests to your `.tape.js` file:
```js
module.exports = {
export default {
'basic': {
message: 'supports basic usage'
}
Expand Down Expand Up @@ -310,11 +310,8 @@ postcss-tape --fixtures path/to/tests
}
```

[npm-img]: https://img.shields.io/npm/v/postcss-tape.svg
[npm-url]: https://www.npmjs.com/package/postcss-tape
[cli-img]: https://img.shields.io/travis/csstools/postcss-tape/master.svg
[cli-url]: https://travis-ci.org/csstools/postcss-tape
[git-img]: https://img.shields.io/badge/chat-gitter-blue.svg
[git-url]: https://gitter.im/postcss/postcss

[PostCSS]: https://github.com/postcss/postcss
Expand Down
60 changes: 37 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "postcss-tape",
"version": "5.0.2",
"description": "Quickly test PostCSS plugins",
"version": "5.0.2",
"type": "commonjs",
"main": "./dist/index.js",
"bin": {
"postcss-tape": "./dist/index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/csstools/postcss-tape.git"
},
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
"license": "CC0-1.0",
"repository": "csstools/postcss-tape",
"homepage": "https://github.com/csstools/postcss-tape#readme",
"bugs": "https://github.com/csstools/postcss-tape/issues",
"main": "index.js",
"bin": {
"postcss-tape": "index.js"
},
"files": [
"index.js",
"index.js.map"
],
"license": "CC0-1.0",
"scripts": {
"build": "rollup --config --silent",
"prepublish": "npm test",
Expand All @@ -27,21 +27,19 @@
"test:tape:ci": "npm run test:tape:7 -- --ci true && npm run test:tape:8 -- --ci true"
},
"engines": {
"node": ">=8.0.0"
"node": "^10 || ^12 || ^14"
},
"peerDependencies": {
"postcss": "^7.0.0 || ^8.0.0"
"postcss": "^7 || ^8"
},
"devDependencies": {
"@babel/core": "^7.7.2",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.7.1",
"babel-eslint": "^10.0.3",
"eslint": "^6.6.0",
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"eslint": "^7.9.0",
"magic-string": "^0.25.7",
"postcss": "^8.0.5",
"rollup": "^2.27.1",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-terser": "^5.1.2"
"rollup-plugin-babel": "^4.4.0"
},
"eslintConfig": {
"env": {
Expand All @@ -50,13 +48,29 @@
"node": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2018,
"ecmaVersion": 12,
"impliedStrict": true,
"sourceType": "module"
},
"root": true
"root": true,
"rules": {
"semi": [
"error",
"never"
]
}
},
"prettier": {
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"printWidth": 360,
"quoteProps": "consistent",
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"useTabs": true
},
"keywords": [
"postcss",
Expand Down
36 changes: 22 additions & 14 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import babel from 'rollup-plugin-babel';
import { terser } from 'rollup-plugin-terser';
import babel from 'rollup-plugin-babel'
import MagicString from 'magic-string'

export default {
input: 'src/index.js',
output: { file: 'index.js', format: 'cjs', sourcemap: true, strict: false },
output: {
file: 'dist/index.js',
format: 'cjs',
sourcemap: true,
strict: true,
},
plugins: [
babel({
plugins: [ '@babel/syntax-dynamic-import' ],
presets: [ ['@babel/env', { targets: { node: 8 } }] ]
presets: [['@babel/env', { targets: { node: 10 } }]],
}),
terser(),
addHashBang()
]
};
addHashBang(),
],
}

function addHashBang () {
function addHashBang() {
return {
name: 'add-hash-bang',
renderChunk (code) {
return `#!/usr/bin/env node\n${code}`;
}
};
renderChunk(code) {
const str = new MagicString(code)
str.prepend(`#!/usr/bin/env node\n`)
return {
code: str.toString(),
map: str.generateMap({ hires: true }),
}
},
}
}
Loading

0 comments on commit 99de157

Please sign in to comment.