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

Commit 78a2695

Browse files
committed
Support Node 10
1 parent 17a2bbd commit 78a2695

16 files changed

+258
-224
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dist
12
node_modules
23
package-lock.json
34
.*
@@ -6,4 +7,3 @@ package-lock.json
67
!.travis.yml
78
*.log*
89
*.result.css
9-
/index.*

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ os:
88
- osx
99

1010
node_js:
11-
- 14
12-
- 12
1311
- 10
12+
- 12
13+
- 14
1414

1515
jobs:
1616
include:
17-
- node_js: 8
17+
- node_js: 14
1818
os: windows
1919
before_script: |
20-
npm install postcss@7
20+
npm install postcss@8
2121
nvs add 12
2222
nvs use 12
2323
npm run pretest:tape

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
3. Add tests to your `.tape.js` file:
2424
```js
25-
module.exports = {
25+
export default {
2626
'basic': {
2727
message: 'supports basic usage'
2828
}

package.json

+37-23
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "postcss-tape",
3-
"version": "5.0.2",
43
"description": "Quickly test PostCSS plugins",
4+
"version": "5.0.2",
5+
"type": "commonjs",
6+
"main": "./dist/index.js",
7+
"bin": {
8+
"postcss-tape": "./dist/index.js"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/csstools/postcss-tape.git"
13+
},
514
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
6-
"license": "CC0-1.0",
7-
"repository": "csstools/postcss-tape",
815
"homepage": "https://github.com/csstools/postcss-tape#readme",
916
"bugs": "https://github.com/csstools/postcss-tape/issues",
10-
"main": "index.js",
11-
"bin": {
12-
"postcss-tape": "index.js"
13-
},
14-
"files": [
15-
"index.js",
16-
"index.js.map"
17-
],
17+
"license": "CC0-1.0",
1818
"scripts": {
1919
"build": "rollup --config --silent",
2020
"prepublish": "npm test",
@@ -27,21 +27,19 @@
2727
"test:tape:ci": "npm run test:tape:7 -- --ci true && npm run test:tape:8 -- --ci true"
2828
},
2929
"engines": {
30-
"node": ">=8.0.0"
30+
"node": "^10 || ^12 || ^14"
3131
},
3232
"peerDependencies": {
33-
"postcss": "^7.0.0 || ^8.0.0"
33+
"postcss": "^7 || ^8"
3434
},
3535
"devDependencies": {
36-
"@babel/core": "^7.7.2",
37-
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
38-
"@babel/preset-env": "^7.7.1",
39-
"babel-eslint": "^10.0.3",
40-
"eslint": "^6.6.0",
36+
"@babel/core": "^7.11.6",
37+
"@babel/preset-env": "^7.11.5",
38+
"eslint": "^7.9.0",
39+
"magic-string": "^0.25.7",
4140
"postcss": "^8.0.5",
4241
"rollup": "^2.27.1",
43-
"rollup-plugin-babel": "^4.3.3",
44-
"rollup-plugin-terser": "^5.1.2"
42+
"rollup-plugin-babel": "^4.4.0"
4543
},
4644
"eslintConfig": {
4745
"env": {
@@ -50,13 +48,29 @@
5048
"node": true
5149
},
5250
"extends": "eslint:recommended",
53-
"parser": "babel-eslint",
5451
"parserOptions": {
55-
"ecmaVersion": 2018,
52+
"ecmaVersion": 12,
5653
"impliedStrict": true,
5754
"sourceType": "module"
5855
},
59-
"root": true
56+
"root": true,
57+
"rules": {
58+
"semi": [
59+
"error",
60+
"never"
61+
]
62+
}
63+
},
64+
"prettier": {
65+
"arrowParens": "avoid",
66+
"bracketSpacing": true,
67+
"endOfLine": "lf",
68+
"printWidth": 360,
69+
"quoteProps": "consistent",
70+
"semi": false,
71+
"singleQuote": true,
72+
"trailingComma": "all",
73+
"useTabs": true
6074
},
6175
"keywords": [
6276
"postcss",

rollup.config.js

+22-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
1-
import babel from 'rollup-plugin-babel';
2-
import { terser } from 'rollup-plugin-terser';
1+
import babel from 'rollup-plugin-babel'
2+
import MagicString from 'magic-string'
33

44
export default {
55
input: 'src/index.js',
6-
output: { file: 'index.js', format: 'cjs', sourcemap: true, strict: false },
6+
output: {
7+
file: 'dist/index.js',
8+
format: 'cjs',
9+
sourcemap: true,
10+
strict: true,
11+
},
712
plugins: [
813
babel({
9-
plugins: [ '@babel/syntax-dynamic-import' ],
10-
presets: [ ['@babel/env', { targets: { node: 8 } }] ]
14+
presets: [['@babel/env', { targets: { node: 10 } }]],
1115
}),
12-
terser(),
13-
addHashBang()
14-
]
15-
};
16+
addHashBang(),
17+
],
18+
}
1619

17-
function addHashBang () {
20+
function addHashBang() {
1821
return {
1922
name: 'add-hash-bang',
20-
renderChunk (code) {
21-
return `#!/usr/bin/env node\n${code}`;
22-
}
23-
};
23+
renderChunk(code) {
24+
const str = new MagicString(code)
25+
str.prepend(`#!/usr/bin/env node\n`)
26+
return {
27+
code: str.toString(),
28+
map: str.generateMap({ hires: true }),
29+
}
30+
},
31+
}
2432
}

0 commit comments

Comments
 (0)