Merge branch 'master' into bump-plugins
# Conflicts: # package.json # yarn.lock
This commit is contained in:
commit
88cfe1b635
2
experimental/babel-preset-env/.gitignore
vendored
2
experimental/babel-preset-env/.gitignore
vendored
@ -1,6 +1,8 @@
|
||||
node_modules
|
||||
coverage
|
||||
lib
|
||||
test/tmp
|
||||
.DS_Store
|
||||
*.log
|
||||
.vscode
|
||||
.nyc_output
|
||||
|
||||
@ -13,8 +13,11 @@ node_js:
|
||||
- '0.12'
|
||||
- '0.10'
|
||||
env:
|
||||
- PKG_CMD="npm"
|
||||
- PKG_CMD="yarn"
|
||||
global:
|
||||
- BABEL_ENV=test
|
||||
matrix:
|
||||
- PKG_CMD="npm"
|
||||
- PKG_CMD="yarn"
|
||||
before_install:
|
||||
- nvm use $TRAVIS_NODE_VERSION
|
||||
- npm set loglevel error
|
||||
@ -24,7 +27,7 @@ install:
|
||||
- $PKG_CMD install
|
||||
script:
|
||||
- 'if [ -n "${LINT-}" ]; then $PKG_CMD run lint ; fi'
|
||||
- 'if [ -z "${LINT-}" ]; then $PKG_CMD run ci ; fi'
|
||||
- 'if [ -z "${LINT-}" ]; then $PKG_CMD run test-ci ; fi'
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
@ -35,3 +38,5 @@ matrix:
|
||||
include:
|
||||
- node_js: "node"
|
||||
env: LINT=true PKG_CMD="npm"
|
||||
|
||||
after_success: 'if [ -z "${LINT-}" ]; then npm run coverage-ci ; fi'
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
## Contributing
|
||||
# Contributing
|
||||
|
||||
### Adding a new plugin to support (when approved in the next ECMAScript version)
|
||||
## Adding a new plugin to support (when approved in the next ECMAScript version)
|
||||
|
||||
#### Update [`plugin-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js)
|
||||
### Update [`plugin-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js)
|
||||
|
||||
*Example:*
|
||||
|
||||
@ -27,7 +27,7 @@ And add them in this structure:
|
||||
},
|
||||
```
|
||||
|
||||
#### Update [`built-in-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js)
|
||||
### Update [`built-in-features.js`](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js)
|
||||
|
||||
*Example:*
|
||||
|
||||
@ -51,7 +51,7 @@ const es2017 = {
|
||||
}
|
||||
```
|
||||
|
||||
#### Update [`plugins.json`](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json)
|
||||
### Update [`plugins.json`](https://github.com/babel/babel-preset-env/blob/master/data/plugins.json)
|
||||
|
||||
Until `compat-table` is a standalone npm module for data we are using the git url
|
||||
|
||||
@ -59,7 +59,21 @@ Until `compat-table` is a standalone npm module for data we are using the git ur
|
||||
|
||||
So we update and then run `npm run build-data`. If there are no changes, then `plugins.json` will be the same.
|
||||
|
||||
### Writing Tests
|
||||
## Tests
|
||||
|
||||
### Running tests locally
|
||||
|
||||
```bash
|
||||
npm test
|
||||
```
|
||||
|
||||
### Checking code coverage locally
|
||||
|
||||
```bash
|
||||
npm run coverage
|
||||
```
|
||||
|
||||
### Writing tests
|
||||
|
||||
#### General
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# babel-preset-env [](https://www.npmjs.com/package/babel-preset-env) [](https://travis-ci.org/babel/babel-preset-env) [](https://www.npmjs.com/package/babel-preset-env)
|
||||
# babel-preset-env [](https://www.npmjs.com/package/babel-preset-env) [](https://travis-ci.org/babel/babel-preset-env) [](https://www.npmjs.com/package/babel-preset-env) [](https://codecov.io/github/babel/babel-preset-env)
|
||||
|
||||
> A Babel preset that can automatically determine the Babel plugins and polyfills you need based on your supported environments.
|
||||
|
||||
|
||||
4
experimental/babel-preset-env/codecov.yml
Normal file
4
experimental/babel-preset-env/codecov.yml
Normal file
@ -0,0 +1,4 @@
|
||||
coverage:
|
||||
parsers:
|
||||
javascript:
|
||||
enable_partials: yes
|
||||
@ -10,12 +10,15 @@
|
||||
"scripts": {
|
||||
"build": "rimraf lib && babel src -d lib",
|
||||
"build-data": "node ./scripts/build-data.js",
|
||||
"dev": "babel -w src -d lib",
|
||||
"lint": "eslint .",
|
||||
"fix": "eslint . --fix",
|
||||
"ci": "npm run test",
|
||||
"changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'",
|
||||
"test": "npm run build && mocha ./test --compilers js:babel-register -t 5000"
|
||||
"coverage": "BABEL_ENV=test nyc npm run test",
|
||||
"coverage-ci": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
|
||||
"dev": "babel -w src -d lib",
|
||||
"fix": "eslint . --fix",
|
||||
"lint": "eslint .",
|
||||
"test": "npm run build && npm run test-only",
|
||||
"test-ci": "nyc npm run test",
|
||||
"test-only": "mocha ./test --compilers js:babel-register -t 10000"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-plugin-check-es2015-constants": "^6.22.0",
|
||||
@ -54,10 +57,12 @@
|
||||
"babel-eslint": "^7.1.1",
|
||||
"babel-helper-fixtures": "^6.22.0",
|
||||
"babel-helper-plugin-test-runner": "^6.22.0",
|
||||
"babel-plugin-istanbul": "^3.1.2",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
||||
"babel-preset-es2015": "^6.22.0",
|
||||
"babel-register": "^6.23.0",
|
||||
"chai": "^3.5.0",
|
||||
"codecov": "^1.0.1",
|
||||
"compat-table": "kangax/compat-table#c38f039b8ea7fadf347d3e300fec3611645e31e9",
|
||||
"eslint": "^3.17.1",
|
||||
"eslint-config-babel": "^6.0.0",
|
||||
@ -65,6 +70,7 @@
|
||||
"fs-extra": "^2.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"mocha": "^3.2.0",
|
||||
"nyc": "^10.1.2",
|
||||
"rimraf": "^2.6.1"
|
||||
},
|
||||
"babel": {
|
||||
@ -78,6 +84,17 @@
|
||||
],
|
||||
"plugins": [
|
||||
"transform-flow-strip-types"
|
||||
]
|
||||
],
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": ["istanbul"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"include": ["src/*.js"],
|
||||
"instrument": false,
|
||||
"sourceMap": false
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user