Skip to content

Commit

Permalink
Merge branch 'master' into umd-resolve-imports
Browse files Browse the repository at this point in the history
* master: (38 commits)
  chore(package): update browserify to version 13.1.1 (babel#4762)
  Increase test coverage (babel#4742)
  Make getBinding ignore labels; add Scope#getLabel, Scope#registerLabel (babel#4758)
  Add variance node type and generate property variance annotations (babel#4697)
  Add make command to delete node_modules (babel#4748)
  fixes [skip ci]
  Support ObjectExpression in static path evaluation (babel#4746)
  Fix replacing for-of if inside label (babel#4736)
  Replace `path-exists` with `fs.existsSync` (babel#4731)
  Avoid unnecessary +0 in transform-es2015-parameters (babel#4738)
  [import()] Initial support for dynamic-import (babel#4699)
  Fix line endings on checkout
  Automatically generate missing expected.js fixtures (babel#4735)
  Fix few typos in issue/pr templates (babel#4739) [skip ci]
  contributing updates [skip ci]
  increase git depth [skip ci]
  Change usage of "suite"/"test" in unit-tests to "describe"/"it" (babel#4734)
  Run ESLint on test files, and fix lint errors in test files (babel#4732)
  Add .gitattributes forcing LF line endings (babel#4730)
  Update tests for changed error messages in Babylon (babel#4727)
  ...
  • Loading branch information
mstade committed Oct 28, 2016
2 parents cf02eca + 905efd1 commit c25c320
Show file tree
Hide file tree
Showing 155 changed files with 1,358 additions and 983 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Expand Up @@ -3,7 +3,6 @@ scripts
lib
packages/babel-runtime
packages/*/node_modules
packages/*/test
packages/*/dist
vendor
_babel.github.io
Expand Down
3 changes: 2 additions & 1 deletion .eslintrc
Expand Up @@ -4,6 +4,7 @@
"max-len": 0
},
"env": {
"node": true
"node": true,
"mocha": true
}
}
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text eol=lf
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Expand Up @@ -9,7 +9,7 @@ If you have a support request or question please submit them to one of this reso
* Also have a look at the Readme for more information on how to get support:
https://github.com/babel/babel/blob/master/README.md
Issues on github are only related to problems of babel itself and we cannot answer
Issues on GitHub are only related to problems of babel itself and we cannot answer
support questions here.
-->

Expand All @@ -22,7 +22,7 @@ support questions here.
var your => (code) => here;
```

### Babel Configuration (.bablerc, package.json, cli command)
### Babel Configuration (.babelrc, package.json, cli command)
<!--- If describing a bug, tell us what your babel configuration looks like -->

```js
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
@@ -1,5 +1,5 @@
<!---
Before making a PR please make sure to read our contributing guidlines
Before making a PR please make sure to read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md
-->

Expand Down
4 changes: 3 additions & 1 deletion .istanbul.yml
@@ -1,3 +1,5 @@
instrumentation:
root: .
excludes: "**/node_modules/**"
excludes:
- "**/node_modules/**"
- "scripts/*.js"
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,5 +1,5 @@
git:
depth: 1
depth: 10
sudo: false
language: node_js
cache:
Expand Down
14 changes: 7 additions & 7 deletions CHANGELOG.md
@@ -1,13 +1,13 @@
# Changelog

> **Tags:**
> - :boom: [Breaking Change]
> - :eyeglasses:[Spec Compliancy]
> - :rocket: [New Feature]
> - :bug: [Bug Fix]
> - :memo: [Documentation]
> - :house: [Internal]
> - :nail_care: [Polish]
> - :boom: [Breaking Change]
> - :eyeglasses: [Spec Compliancy]
> - :rocket: [New Feature]
> - :bug: [Bug Fix]
> - :memo: [Documentation]
> - :house: [Internal]
> - :nail_care: [Polish]

_Note: Gaps between patch versions are faulty, broken or test releases._

Expand Down
53 changes: 42 additions & 11 deletions CONTRIBUTING.md
Expand Up @@ -14,25 +14,33 @@

----


# Contributing

Contributions are always welcome, no matter how large or small. Before
contributing, please read our [code of conduct](https://github.com/babel/babel/blob/master/CODE_OF_CONDUCT.md).
> Before contributing, please read our [code of conduct](https://github.com/babel/babel/blob/master/CODE_OF_CONDUCT.md).
Contributions are always welcome, no matter how large or small.

## Not sure where to start?

- If you aren't just making a documentation change, you'll probably want to learn a bit about a few topics.
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): Our current [spec](https://github.com/babel/babel/tree/master/doc/ast) is a bit different from [ESTree](https://github.com/estree/estree).
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babylon/blob/master/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babylon#output).
- This repository's [`/doc`](/doc) directory for notes on Babel's internals
- Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook) - core plugins are written the same way as any other plugin!
- Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs or make your own plugin in the browser
- When you feel ready to finally jump into the babel source code a good start is to look out for issues which are labeled with `help wanted` and/or `beginner-friendly`.
- When you feel ready to finally jump into the babel source code a good start is to look out for issues which are labeled with [help-wanted](https://github.com/babel/babel/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) and/or [beginner-friendly](https://github.com/babel/babel/issues?q=is%3Aissue+is%3Aopen+label%3A%22beginner-friendly%22).

## Chat

> If you're stuck, feel free to check out the `#development` channel on our [slack](https://slack.babeljs.io).
Feel free to check out the `#discussion`/`#development` channels on our [slack](https://slack.babeljs.io). Some of us are always online to chat!

## Developing

**Note:** Versions `< 5.1.10` can't be built. Make sure you are on npm 3.
**Note:** Versions `< 5.1.10` can't be built.

Babel is built for node 0.10 and up but we develop using node 6. Make sure you are on npm 3.

You can check this with `node -v` and `npm -v`.

#### Setup

Expand Down Expand Up @@ -64,15 +72,38 @@ If you wish to build a copy of Babel for distribution, then run:
$ make build-dist
```

#### Running tests
#### Running linting/tests

You can run lint via:

```sh
# ~6 sec on a MacBook Pro (Mid 2015)
$ make lint
```

You can run eslint's autofix via:

You can run tests for all packages via:
```sh
$ make fix
```

You can run tests + lint for all packages (slow) via:

```sh
# ~46 sec on a MacBook Pro (Mid 2015)
$ make test
```

To run tests for a specific package, you can use the `TEST_ONLY` environment variable:
If you just want to run all tests:

```sh
# ~40 sec on a MacBook Pro (Mid 2015)
$ make test-only
```

Most likely you'll want to focus in on a specific issue.

To run tests for a specific package in [packages](/packages), you can use the `TEST_ONLY` environment variable:

```sh
$ TEST_ONLY=babel-cli make test
Expand Down Expand Up @@ -143,9 +174,9 @@ If you need to check for an error that is thrown you can add to the `options.jso
}
```

##### `babylon`
##### Bootstrapping expected output

For `babylon` specifically, you can easily generate an `expected.json` automatically by just providing the `actual.js` and running `make test-only` as you usually would.
For both `babel-plugin-x` and `babylon`, you can easily generate an `expected.js`/`expected.json` automatically by just providing `actual.js` and running the tests as you usually would.

```
// Example
Expand Down
13 changes: 11 additions & 2 deletions Makefile
Expand Up @@ -2,7 +2,7 @@ MAKEFLAGS = -j1

export NODE_ENV = test

.PHONY: build build-dist watch lint clean test-clean test-only test test-cov test-ci publish bootstrap
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-cov test-ci publish bootstrap

build: clean
./node_modules/.bin/gulp build
Expand All @@ -18,7 +18,10 @@ watch: clean
./node_modules/.bin/gulp watch

lint:
./node_modules/.bin/eslint packages/*/src
./node_modules/.bin/eslint packages/*/{src,test}/*.js

fix:
./node_modules/.bin/eslint packages/*/{src,test}/*.js --fix

clean: test-clean
rm -rf packages/*/lib
Expand All @@ -31,6 +34,11 @@ test-clean:
rm -rf packages/*/test/tmp
rm -rf packages/*/test-fixtures.json

clean-all:
rm -rf node_modules
rm -rf packages/*/node_modules
make clean

# without lint
test-only:
./scripts/test.sh
Expand Down Expand Up @@ -61,6 +69,7 @@ publish:
#./scripts/build-website.sh

bootstrap:
make clean-all
npm install
./node_modules/.bin/lerna bootstrap
make build
Expand Down
9 changes: 3 additions & 6 deletions README.md
Expand Up @@ -29,13 +29,9 @@ Bugs and feature requests can be posted at https://github.com/babel/babel/issues

> We've moved our issues from phabricator back to github issues!
> Former phabricator links are going to redirect to the corresponding Github issue, for example You can use http://phabricator.babeljs.io/T7567.
Former phabricator issue urls now automatically redirect to their corresponding Github issue:

```
https://phabricator.babeljs.io/T2168
mostly corresponds to
https://github.com/babel/babel/issues/2168
```
https://phabricator.babeljs.io/T2168 mostly corresponds to https://github.com/babel/babel/issues/2168.

## Want to report an issue with [babeljs.io](https://babeljs.io) (the website)?

Expand Down Expand Up @@ -209,6 +205,7 @@ These just enable the transform plugins to be able to parse certain features (th
| [`babel-plugin-syntax-flow`](/packages/babel-plugin-syntax-flow) | [![npm](https://img.shields.io/npm/v/babel-plugin-syntax-flow.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-syntax-flow) |
| [`babel-plugin-syntax-function-bind`](/packages/babel-plugin-syntax-function-bind) | [![npm](https://img.shields.io/npm/v/babel-plugin-syntax-function-bind.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-syntax-function-bind) |
| [`babel-plugin-syntax-function-sent`](/packages/babel-plugin-syntax-function-sent) | [![npm](https://img.shields.io/npm/v/babel-plugin-syntax-function-sent.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-syntax-function-sent) |
| [`babel-plugin-syntax-dynamic-import`](/packages/babel-plugin-syntax-dynamic-import) | [![npm](https://img.shields.io/npm/v/babel-plugin-syntax-dynamic-import.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-syntax-dynamic-import) |
| [`babel-plugin-syntax-jsx`](/packages/babel-plugin-syntax-jsx) | [![npm](https://img.shields.io/npm/v/babel-plugin-syntax-jsx.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-syntax-jsx) |
| [`babel-plugin-syntax-object-rest-spread`](/packages/babel-plugin-syntax-object-rest-spread) | [![npm](https://img.shields.io/npm/v/babel-plugin-syntax-object-rest-spread.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-syntax-object-rest-spread) |

Expand Down
9 changes: 2 additions & 7 deletions lib/parser.js
@@ -1,10 +1,5 @@
type BabelParserOptions = {
strictMode?: boolean;
looseModules?: boolean;
highlightCode?: boolean;
nonStandard?: boolean;
sourceFilename?: string;
sourceType?: "module" | "script";
filename?: string;
features?: Object;
plugins?: Object;
plugins?: Array<Object>;
};
11 changes: 7 additions & 4 deletions package.json
Expand Up @@ -3,7 +3,9 @@
"license": "MIT",
"scripts": {
"test": "make test",
"build": "make build"
"build": "make build",
"lint": "make lint",
"fix": "make fix"
},
"devDependencies": {
"async": "^1.5.0",
Expand All @@ -14,17 +16,18 @@
"babel-plugin-transform-runtime": "^6.3.13",
"babel-preset-es2015": "^6.13.2",
"babel-preset-stage-0": "^6.0.0",
"babel-register": "^6.14.0",
"babel-runtime": "^6.0.0",
"browserify": "^11.2.0",
"browserify": "^13.1.1",
"bundle-collapser": "^1.2.1",
"chai": "^2.2.0",
"chalk": "1.1.1",
"codecov.io": "^0.1.6",
"derequire": "^2.0.2",
"eslint": "^3.7.1",
"eslint-config-babel": "^1.0.1",
"eslint-config-babel": "^2.0.1",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-flow-vars": "^0.5.0",
"eslint-plugin-flowtype": "^2.20.0",
"flow-bin": "^0.33.0",
"gulp": "^3.9.0",
"gulp-babel": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-cli/bin/babel-doctor.js 100755 → 100644
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require("../lib/babel-doctor");
throw new Error("babel-doctor has been removed.");
5 changes: 0 additions & 5 deletions packages/babel-cli/package.json
Expand Up @@ -11,18 +11,13 @@
"babel-register": "^6.16.0",
"babel-polyfill": "^6.16.0",
"babel-runtime": "^6.9.0",
"bin-version-check": "^2.1.0",
"chalk": "1.1.1",
"commander": "^2.8.1",
"convert-source-map": "^1.1.0",
"fs-readdir-recursive": "^1.0.0",
"glob": "^5.0.5",
"lodash": "^4.2.0",
"log-symbols": "^1.0.2",
"output-file-sync": "^1.1.0",
"path-exists": "^1.0.0",
"path-is-absolute": "^1.0.0",
"request": "^2.65.0",
"slash": "^1.0.0",
"source-map": "^0.5.0",
"v8flags": "^2.0.10"
Expand Down

0 comments on commit c25c320

Please sign in to comment.