Skip to content

Commit b252aa0

Browse files
authored
Refactoring: Remove generated files, clean the repo and speed up CI (#63)
This basically removes generated files from git and improves some scripts/tests.
1 parent be3067b commit b252aa0

31 files changed

+298
-5093
lines changed

.babelignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.flowconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[include]
55

66
[libs]
7-
./scripts/babel-nodes.js
87

98
[lints]
109

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ package-lock.json
44
yarn-error.log
55
node_modules
66
/coverage
7-
/lib
7+
/dist
8+
9+
# Generated files
10+
/flow-typed/babel-nodes.js
11+
/src/lib

.prettierignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Dist files
2-
lib
2+
dist
33

44
# Generated files
5-
/scripts/babel-nodes.js
6-
/src/babel-types.js
7-
/src/visitors.generated.js
5+
/flow-typed/babel-nodes.js
6+
/src/lib
87

98
# Files handled by others
109
package.json

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.travis.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
language: node_js
22
node_js:
33
- "6"
4+
5+
before_script:
6+
- yarn global add codecov
7+
48
script:
5-
- yarn build
6-
- yarn test
9+
- yarn test --ci --runInBand --coverage
710
- yarn flow
811
- yarn lint
12+
13+
# Run tests for built version
14+
- cp -r src/__tests__ dist/__tests__
15+
- yarn test --ci --runInBand --testRegex dist/__tests__/.*(\\.test.js)$
16+
17+
# Send report to codecov
18+
- codecov

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Use Pug templates to write react components.
44

5-
[![npm version](https://img.shields.io/npm/v/babel-plugin-transform-react-pug.svg)](https://www.npmjs.com/package/babel-plugin-transform-react-pug) [![Build Status](https://travis-ci.org/pugjs/babel-plugin-transform-react-pug.svg?branch=master)](https://travis-ci.org/pugjs/babel-plugin-transform-react-pug)
5+
[![npm version](https://img.shields.io/npm/v/babel-plugin-transform-react-pug.svg?longCache)](https://www.npmjs.com/package/babel-plugin-transform-react-pug) [![Build Status](https://travis-ci.org/pugjs/babel-plugin-transform-react-pug.svg?branch=master)](https://travis-ci.org/pugjs/babel-plugin-transform-react-pug) [![Codecov](https://img.shields.io/codecov/c/github/pugjs/babel-plugin-transform-react-pug.svg?longCache)
6+
](https://codecov.io/gh/pugjs/babel-plugin-transform-react-pug)
67

78
`babel-plugin-transform-react-pug` is a plugin for babel which transpiles pug syntax within template literals to jsx.
89

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
"name": "babel-plugin-transform-react-pug",
33
"version": "6.0.1",
44
"description": "A plugin for transpiling pug templates to jsx",
5-
"main": "lib/index.js",
5+
"main": "dist/index.js",
66
"scripts": {
77
"precommit": "lint-staged",
8-
"prepublish": "npm run build",
9-
"build": "babel-node scripts/generate-babel-types && babel-node scripts/build-visitors && babel src --out-dir lib",
8+
"prepublish": "rm -rf ./dist && yarn build",
9+
"build": "babel-node scripts/generate.babel-types && babel-node scripts/generate.visitors && babel src --out-dir dist --ignore __tests__",
1010
"flow": "flow",
1111
"lint": "prettier --list-different **/*.js",
12-
"test": "jest --coverage",
13-
"watch": "jest --watch",
12+
"test": "jest",
1413
"format": "prettier --write **/*.js"
1514
},
1615
"files": [
17-
"lib/"
16+
"dist/"
1817
],
1918
"keywords": [
2019
"babel-plugin"
@@ -57,12 +56,17 @@
5756
"collectCoverageFrom": [
5857
"src/**/*.js",
5958
"!src/__tests__/*.js",
60-
"!src/babel-types.js"
59+
"!src/lib/*.js"
6160
],
6261
"snapshotSerializers": [
63-
"./scripts/filename-serializer.js"
62+
"./scripts/jest.filename-serializer.js"
6463
]
6564
},
65+
"prettier": {
66+
"bracketSpacing": false,
67+
"singleQuote": true,
68+
"trailingComma": "all"
69+
},
6670
"repository": {
6771
"type": "git",
6872
"url": "https://github.com/pugjs/babel-plugin-transform-react-pug.git"

0 commit comments

Comments
 (0)