Skip to content

Commit 7846964

Browse files
committed
build: switch to releasing untranspiled code in lib/ and transpiled code in es5/
1 parent d2e93fe commit 7846964

File tree

10 files changed

+926
-24
lines changed

10 files changed

+926
-24
lines changed

.babelrc

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
{
2-
"presets": ["es2015", "stage-1", "flow"],
3-
"plugins": ["transform-runtime"],
2+
"presets": [
3+
"flow"
4+
],
45
"env": {
56
"test": {
6-
"plugins": ["istanbul"]
7-
}
7+
"presets": [
8+
["env", {"node": "current"}]
9+
],
10+
"plugins": [
11+
"transform-runtime",
12+
"istanbul"
13+
]
14+
},
15+
"es5": {
16+
"presets": [
17+
["env", {"forceAllTransforms": true}]
18+
],
19+
"plugins": [
20+
"transform-runtime"
21+
]
22+
},
823
}
924
}

.flowconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[ignore]
22
<PROJECT_ROOT>/lib/.*
3-
<PROJECT_ROOT>/node_modules/.*/tests?/.*\.json
3+
<PROJECT_ROOT>/es5/.*
44

55
[include]
66
./src
@@ -12,4 +12,3 @@
1212
module.system=node
1313
esproposal.class_static_fields=enable
1414
esproposal.class_instance_fields=enable
15-

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ coverage
22
.nyc_output
33
node_modules
44
lib
5+
es5
56
.eslintcache

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ npm i
1919
## Tools used
2020

2121
* babel 6
22+
* babel-preset-env
2223
* mocha
2324
* chai
2425
* istanbul

TEMPLATE-README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
{{ description }}
99

10-
## Usage
10+
## Installation
1111

1212
```sh
1313
npm install --save {% if scope %}@{{ scope }}/{% endif %}{{ name }}
1414
```
15-

TEMPLATE-package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"url": "https://github.com/{{ organization }}/{{ name }}.git"
88
},
99
"author": "{{ author }}",
10+
"keywords": [],
1011
"bugs": {
1112
"url": "https://github.com/{{ organization }}/{{ name }}/issues"
1213
},

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"flow": "flow",
1111
"flow:coverage": "for file in src/**.js test/**.js; do echo $file; flow coverage $file; done",
1212
"flow:watch": "flow-watch -e js,js.flow,flowconfig --ignore lib/ --ignore node_modules/ --watch .flowconfig --watch src/ --watch test/",
13-
"build": "rimraf lib && babel src --out-dir lib && flow-copy-source -v src/ lib",
14-
"test": "NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
13+
"build": "rimraf lib && babel src --out-dir lib && flow-copy-source -v src/ lib && rimraf es5 && BABEL_ENV=es5 babel src --out-dir es5 && flow-copy-source -v src/ es5",
14+
"test": "NODE_ENV=production BABEL_ENV=es5 mocha $npm_package_config_mocha && NODE_ENV=production BABEL_ENV=test nyc --reporter=lcov --reporter=text mocha $npm_package_config_mocha",
1515
"test:watch": "mocha --watch $npm_package_config_mocha",
1616
"codecov": "nyc report --reporter=text-lcov > coverage.lcov; codecov",
1717
"commitmsg": "commitlint -e $GIT_PARAMS",
@@ -62,7 +62,7 @@
6262
"babel-eslint": "^7.1.1",
6363
"babel-plugin-istanbul": "^4.0.0",
6464
"babel-plugin-transform-runtime": "^6.23.0",
65-
"babel-preset-es2015": "^6.22.0",
65+
"babel-preset-env": "^1.7.0",
6666
"babel-preset-flow": "^6.23.0",
6767
"babel-preset-stage-1": "^6.22.0",
6868
"babel-register": "^6.23.0",

src/.eslintrc

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

test/.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"env": {
3-
"es6": true,
43
"mocha": true
54
}
65
}

0 commit comments

Comments
 (0)