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
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Sep 18, 2020
1 parent 17a2bbd commit 78a2695
Show file tree
Hide file tree
Showing 16 changed files with 258 additions and 224 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.*
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ os:
- osx

node_js:
- 14
- 12
- 10
- 12
- 14

jobs:
include:
- node_js: 8
- node_js: 14
os: windows
before_script: |
npm install postcss@7
npm install postcss@8
nvs add 12
nvs use 12
npm run pretest:tape
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

3. Add tests to your `.tape.js` file:
```js
module.exports = {
export default {
'basic': {
message: 'supports basic usage'
}
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 78a2695

Please sign in to comment.