Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
ed625cb
Remove `String.fromCodePoint` shim (#279)
mathiasbynens Jan 10, 2017
5785f0c
Merge branch 'master' into 7.0
danez Jan 12, 2017
b72d4d4
[7.0] Remove node 0.10, 0.12 and 5 from Travis (#284)
chicoxyzzy Jan 12, 2017
8f7a19e
Update cross-env to 3.x
danez Jan 12, 2017
7a3e717
Update yarn.lock
danez Jan 12, 2017
00f03bb
Remove '*' as a plugin option (#301)
micopc Jan 16, 2017
c5462e1
Remove classConstructorCall plugin (#291)
existentialism Jan 16, 2017
bd00176
Revert "Temporary rollback for erroring on trailing comma with spread…
danez Jan 16, 2017
c424156
Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322)
koba04 Jan 27, 2017
e614032
Change location of ObjectTypeIndexer to match flow (#228)
danez Jan 27, 2017
0309a5b
Merge branch 'master' into 7.0
danez Jan 27, 2017
b0220bf
chore(package): update babel-plugin-istanbul to version 4.0.0 (#350)
greenkeeper[bot] Feb 9, 2017
0834cb5
chore(package): update ava to version 0.18.0 (#345)
greenkeeper[bot] Feb 9, 2017
56928dc
[7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349)
aweary Feb 9, 2017
cd3f149
Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#…
phpnode Feb 12, 2017
1cca700
Reintroduce Variance node (#333)
danez Feb 12, 2017
d88befd
Merge branch 'master' into 7.0
danez Feb 12, 2017
09c1f06
Fix test
danez Feb 12, 2017
d2ccc6a
Fix test
danez Feb 12, 2017
401733d
7.0.0-beta.0
hzoo Feb 15, 2017
50ffa49
Merge branch 'master' into 7.0
danez Feb 20, 2017
72a0f10
Merge branch '7.0-dev' into 7.0
danez Feb 20, 2017
e52962f
upgrade yarn.lock
danez Feb 20, 2017
a4bf244
7.0.0-beta.1
danez Feb 20, 2017
7bf553a
Merge branch 'master' into 7.0
danez Feb 20, 2017
fe2d2a9
7.0.0-beta.2
danez Feb 20, 2017
8d90dc0
[7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement…
hzoo Feb 28, 2017
5e0cce4
Merge branch 'master' into 7.0
hzoo Feb 28, 2017
575e0d5
update lock
hzoo Feb 28, 2017
e2cd624
7.0.0-beta.3
hzoo Feb 28, 2017
56a92cc
changelog [skip ci]
hzoo Feb 28, 2017
aec4bef
Don't parse class properties without initializers when classPropertie…
DrewML Jan 23, 2017
f1e2cca
Add back ranges property (#363)
hzoo Mar 1, 2017
fdb0b50
add ranges [skip ci]
hzoo Mar 1, 2017
c8c7168
Don't consume async when checking for async func decl (#377)
existentialism Mar 1, 2017
38cf191
7.0.0-beta.4
hzoo Mar 1, 2017
2766263
7.0-beta.3 changelog [skip ci]
hzoo Mar 1, 2017
265d2c1
Explain how to run only one test (#389) [skip ci]
aaronang Mar 2, 2017
05dd6d4
Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci]
lunaticmonk Mar 2, 2017
1165d7e
typo [skip ci]
hzoo Mar 2, 2017
962ce16
Add DoExpression to spec (#364)
oleksandr-kuzmenko Mar 3, 2017
0b7da50
Add estree test for correct order of directives
danez Mar 4, 2017
12abc20
Merge branch 'master' into 7.0
danez Mar 4, 2017
c749245
chore(package): update flow-bin to version 0.41.0 (#395)
greenkeeper[bot] Mar 5, 2017
5e0dc7a
add version badge [skip ci]
hzoo Mar 8, 2017
7a6d495
Throw error if new.target is used outside of a function (#402)
existentialism Mar 8, 2017
81056ee
Fix parsing of class properties (#351)
bakkot Mar 10, 2017
250cd65
Fix watch command (#403)
existentialism Mar 10, 2017
902f93d
Update yarn lock
danez Mar 10, 2017
35e7732
Fix watch command (#403)
existentialism Mar 10, 2017
ca652bd
Throw error if new.target is used outside of a function (#402)
existentialism Mar 8, 2017
c0a89f4
Upgrade flow to 0.41
danez Mar 10, 2017
68e8550
Merge branch 'master' into 7.0
danez Mar 10, 2017
4c88cfe
Disable failing tests (fixed in 7.0)
danez Mar 10, 2017
90f2b12
Merge branch 'master' into 7.0
danez Mar 10, 2017
4a813dc
Revert "Disable failing tests (fixed in 7.0)"
danez Mar 10, 2017
a538643
Changed Non-existent RestPattern to RestElement which is what is actu…
Jamesernator Mar 13, 2017
873bf28
Fix spec for ClassMethod: It doesn't have a function, it *is* a funct…
Mar 14, 2017
9690daa
Update codecov to 2.0 (#412)
danez Mar 15, 2017
82b7872
Optimize travis builds (#419)
danez Mar 19, 2017
0545173
Test runner: Detect extra property in 'actual' but not in 'expected'.…
Mar 19, 2017
0811438
Update flow (#422)
danez Mar 19, 2017
6a94d0e
7.0.0-beta.5
hzoo Mar 21, 2017
5f048b4
[7.0] Moved value field in spec from ObjectMember to ObjectProperty a…
Jamesernator Mar 21, 2017
fab343e
Add support for invalid escapes in tagged templates (#274)
bakkot Mar 21, 2017
2e467ef
Add support for invalid escapes in tagged templates (#274)
bakkot Mar 21, 2017
0f98279
Merge branch '7.0'
hzoo Mar 21, 2017
964105e
Improves error message when super is called outside of constructor (#…
arshabh Mar 21, 2017
ad1eb14
update lock [skip ci]
hzoo Mar 22, 2017
af5fdc2
7.0.0-beta.6
hzoo Mar 22, 2017
32eabf6
Fix push-pop logic in flow (#405)
danez Mar 22, 2017
9f7d908
remove babylon plugin for template revision since it's stage-4 (#426)
hzoo Mar 22, 2017
e4e1cb0
7.0.0-beta.7
hzoo Mar 22, 2017
a495d7f
Allow statics in flow interfaces (#427)
existentialism Mar 23, 2017
2f3123c
Fix CONTRIBUTING.md [skip ci] (#432)
oleksandr-kuzmenko Mar 24, 2017
4d18221
Use babel-register script when running babel smoke tests (#442)
existentialism Mar 30, 2017
213fdab
Add support for flow type spread (#418)
conartist6 Apr 3, 2017
786d73b
Update rollup-plugin-node-resolve to the latest version 🚀 (#445)
greenkeeper[bot] Apr 3, 2017
9222562
Update cross-env to the latest version 🚀 (#443)
greenkeeper[bot] Apr 3, 2017
22741a8
Fix number parser (#433)
oleksandr-kuzmenko Apr 3, 2017
14b7f50
Fix rest parameters with array and objects (#424)
existentialism Apr 3, 2017
cbf4203
Add extra.raw back to JSXText and JSXAttribute (#344)
rattrayalex Apr 4, 2017
bdfa924
Fix predicate attachment to match flow parser (#428)
existentialism Apr 4, 2017
c8ac8ab
Update yarn.lock
danez Apr 4, 2017
4147c01
7.0.0-beta.8
danez Apr 4, 2017
ed452b6
Update CONTRIBUTING.md
danez Apr 4, 2017
1c07efb
Use a .babelignore to skip compiling lib and fixtures. (#451)
loganfsmyth Apr 5, 2017
4bf18cc
Simplify `cd` commands (#452) [skip ci]
Apr 6, 2017
aef9e4f
Update flow-bin to the latest version 🚀 (#448)
greenkeeper[bot] Apr 7, 2017
344f070
Update ava to the latest version 🚀 (#450)
greenkeeper[bot] Apr 7, 2017
637119a
Fix typo in flow spread operator error [skip ci]
existentialism Apr 10, 2017
482b815
Update test baselines (#461)
Apr 10, 2017
17f2a20
Allow namespace exotic to be exported as default (#474)
existentialism Apr 19, 2017
2ef4366
Ensure locations in ObjectTypeAnnotations do not include semi or comm…
existentialism Apr 19, 2017
ad284d5
Convert each plugin to a function from a class to an overriding class…
Apr 21, 2017
5e15631
Type-check tokenizer/index.js (#460)
Apr 21, 2017
28ccd05
Update flow-bin to the latest version 🚀 (#468)
greenkeeper[bot] Apr 21, 2017
d1a5220
Add support for declare export + fixes (#224)
danez Apr 21, 2017
00d6db9
Fixed invalid number literal parsing (#473)
oleksandr-kuzmenko Apr 21, 2017
d975b91
Refresh property ordering in baselines (#454)
Apr 21, 2017
bc0719a
Ensure non pattern shorthand props are checked for reserved words (#479)
existentialism Apr 21, 2017
8601f2f
Add type declarations for AST nodes (#480)
Apr 21, 2017
2c1193b
Move plugin helpers out of Parser.prototype and into the plugin itsel…
Apr 23, 2017
c4fb3fe
Convert each file with parser methods to a class in an inheritance ch…
Apr 23, 2017
68967bf
Remove jsx context when parsing arrow functions (#475)
existentialism Apr 23, 2017
34acecc
Type-check CommentsParser and LocationParser (#484)
Apr 25, 2017
3199cee
Type-check node.js (#486)
Apr 25, 2017
7627c5a
Type-check UtilParser (#485)
Apr 25, 2017
47cade8
Type-check options.js and index.js (#490)
Apr 26, 2017
e1a0654
Type-check utils (#491)
Apr 27, 2017
d8ff631
Type-check LValParser (#487)
Apr 27, 2017
cd5bfb7
Type-check estree plugin (#494)
Apr 27, 2017
8288f7d
Type-check tokenizer/types.js (#493)
Apr 27, 2017
cccee00
Type-check JSX plugin (#496)
Apr 27, 2017
5ae165d
update changelog [skip ci]
hzoo Apr 27, 2017
e81b5f8
Type-check flow plugin (#495)
Apr 27, 2017
540ea0c
Merge branch 'master' into merge-upstream-7
rattrayalex Apr 30, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .babelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test/fixtures
lib
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
strip_root=true
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
51 changes: 23 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
sudo: false
language: node_js
node_js:
- "0.10"
- "0.12"
- "4"
- "5"
- "6"
- "7"

before_install:
# Rollup doesn't support node < 4.x. Switch to latest for build
- . $HOME/.nvm/nvm.sh
- nvm install stable && nvm use stable
env:
- JOB=test

before_script:
- 'if [ -n "${BABEL-}" ]; then make bootstrap-babel ; fi'
- 'if [ -n "${FLOWTESTS-}" ]; then make bootstrap-flow ; fi'
- 'BABEL_ENV=test npm run build'
# Switch back to node version currently being tested prior to test run
- 'nvm use $TRAVIS_NODE_VERSION;'
- 'if [ "$JOB" = "babel-test" ]; then make bootstrap-babel ; fi'
- 'if [ "$JOB" = "flow-test" ]; then make bootstrap-flow ; fi'
- 'if [ "$JOB" = "test" ]; then yarn run build; fi'

script:
- 'if [ -n "${LINT-}" ]; then npm run lint ; fi'
- 'if [ -n "${FLOW-}" ]; then npm run flow ; fi'
- 'if [ -n "${FLOWTESTS-}" ]; then make test-flow ; fi'
- 'if [ -n "${BABEL-}" ]; then make test-babel ; fi'
- 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${BABEL-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run test-ci ; fi'
- 'if [ "$JOB" = "test" ]; then yarn test-only; fi'
- 'if [ "$JOB" = "lint" ]; then yarn run lint && yarn run flow; fi'
- 'if [ "$JOB" = "flow-test" ]; then make test-flow; fi'
- 'if [ "$JOB" = "babel-test" ]; then make test-babel; fi'
- 'if [ "$JOB" = "test-coverage" ]; then yarn run test-coverage; fi'

matrix:
fast_finish: true
include:
- node_js: "node"
env: LINT=true
- node_js: "node"
env: FLOW=true
- node_js: "node"
env: BABEL=true
- node_js: "node"
env: FLOWTESTS=true
- node_js: "lts/*"
env: JOB=test-coverage
- node_js: "lts/*"
env: JOB=lint
- node_js: "lts/*"
env: JOB=babel-test
- node_js: "lts/*"
env: JOB=flow-test
allow_failures:
- node_js: "node"
env: FLOWTESTS=true
- node_js: "lts/*"
env: JOB=flow-test

after_success: 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run coverage ; fi'
after_success:
- 'if [ "$JOB" = "babel-test" ]; then bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json -F babel ; fi'
- 'if [ "$JOB" = "test-coverage" ]; then bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json -F babylon ; fi'

notifications:
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK
119 changes: 119 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,125 @@ _Note: Gaps between patch versions are faulty, broken or test releases._

See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog.

## v6.17.0 (2017-04-20)

### :bug: Bug Fix
* Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie)
* Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons)
* Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng)
* Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons)
* Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng)
* Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng)

## 7.0.0-beta.8 (2017-04-04)

### New Feature
* Add support for flow type spread (#418) (Conrad Buck)
* Allow statics in flow interfaces (#427) (Brian Ng)

### Bug Fix
* Fix predicate attachment to match flow parser (#428) (Brian Ng)
* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray)
* Fix rest parameters with array and objects (#424) (Brian Ng)
* Fix number parser (#433) (Alex Kuzmenko)

### Docs
* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko)

### Internal
* Use babel-register script when running babel smoke tests (#442) (Brian Ng)

## 7.0.0-beta.7 (2017-03-22)

### Spec Compliancy
* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu)

### Bug Fix

* Fix push-pop logic in flow (#405) (Daniel Tschinder)

## 7.0.0-beta.6 (2017-03-21)

### New Feature
* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons)

### Polish
* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal)

### Docs

* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning)

## 7.0.0-beta.5 (2017-03-21)

### Bug Fix
* Throw error if new.target is used outside of a function (#402) (Brian Ng)
* Fix parsing of class properties (#351) (Kevin Gibbons)

### Other
* Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy)
* Optimize travis builds (#419) (Daniel Tschinder)
* Update codecov to 2.0 (#412) (Daniel Tschinder)
* Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy)
* Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning)
* Upgrade flow to 0.41 (Daniel Tschinder)
* Fix watch command (#403) (Brian Ng)
* Update yarn lock (Daniel Tschinder)
* Fix watch command (#403) (Brian Ng)
* chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot])
* Add estree test for correct order of directives (Daniel Tschinder)
* Add DoExpression to spec (#364) (Alex Kuzmenko)
* Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde)
* Explain how to run only one test (#389) [skip ci] (Aaron Ang)

## 7.0.0-beta.4 (2017-03-01)

* Don't consume async when checking for async func decl (#377) (Brian Ng)
* add `ranges` option [skip ci] (Henry Zhu)
* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine)

## 7.0.0-beta.3 (2017-02-28)

- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384)
- Merge changes from 6.x

## 7.0.0-beta.2 (2017-02-20)

- estree: correctly change literals in all cases (#368) (Daniel Tschinder)

## 7.0.0-beta.1 (2017-02-20)

- Fix negative number literal typeannotations (#366) (Daniel Tschinder)
- Update contributing with more test info [skip ci] (#355) (Brian Ng)

## 7.0.0-beta.0 (2017-02-15)

- Reintroduce Variance node (#333) (Daniel Tschinder)
- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick)
- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail)
- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot])
- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot])
- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder)
- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi)
- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder)
- Remove classConstructorCall plugin (#291) (Brian Ng)
- Update yarn.lock (Daniel Tschinder)
- Update cross-env to 3.x (Daniel Tschinder)
- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov)
- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens)

## 6.16.1 (2017-02-23)

### :bug: Regression

- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375))

Need to modify Babel for this AST node change, so moving to 7.0.

- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376))

[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted.

## 6.16.0 (2017-02-23)

### :rocket: New Feature
Expand Down
56 changes: 41 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ contributing, please read the

## Setup local env

> Install yarn beforehand: https://yarnpkg.com/en/docs/install

To start developing on Babylon you only need to install its dependencies:

```bash
npm install
git clone https://github.com/babel/babylon
cd babylon
yarn
```

## Tests
Expand All @@ -19,25 +23,45 @@ npm install
To run a build, tests and perform lint/flow checks:

```bash
npm test
yarn test
```

If you only want to run the tests:

```bash
npm run test-only
yarn run test-only
```

Note, this does not actually run a build, so you may have to call `npm run build` after
Note, this does not actually run a build, so you may have to call `yarn run build` after
performing any changes.

### Running one test

To run only a single test, add `"only": true` to the `options.json` inside any test fixture folder (you may have to create the file if it doesn't exist).
For example, let's say we want to only run the test for the [`test/fixtures/comments/basic/shebang-import`](https://github.com/babel/babylon/tree/7.0/test/fixtures/comments/basic/shebang-import) fixture.

Add `"only": true` to its `options.json`:

```json
{
"sourceType": "module",
"only": true
}
```

Then, run the tests using the same command as before:

```bash
yarn run test-only
```

### Checking code coverage locally

To generate code coverage, be sure to set `BABEL_ENV=test` so that code is instrumented during
the rollup build.

```bash
BABEL_ENV=test npm run build && npm run test-ci
BABEL_ENV=test yarn run build && yarn run test-coverage
```

### Writing tests
Expand All @@ -61,19 +85,21 @@ you will want to link both repositories together. This can be done by doing the

```bash
cd babylon/
npm link
npm run build
yarn link
yarn run build
cd ../babel/
make bootstrap
npm link babylon
yarn link babylon
cd packages/babel-core/
npm link babylon
cd ../../packages/babel-template/
npm link babylon
cd ../../packages/babel-traverse/
npm link babylon
cd ../../packages/babel-generator/
npm link babylon
yarn link babylon
cd ../babel-template/
yarn link babylon
cd ../babel-traverse/
yarn link babylon
cd ../babel-generator/
yarn link babylon
cd ../babel-types/
yarn link babylon
cd ../..
make build
make test
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ clean: ; rm -rf ./build

bootstrap-babel: clean
mkdir ./build
git clone --depth=1 --branch=master https://github.com/babel/babel.git ./build/babel
git clone --depth=1 --branch=7.0 https://github.com/babel/babel.git ./build/babel
cd ./build/babel; \
make bootstrap
find ./build/babel/packages -type d -name 'babylon' -prune -exec rm -rf '{}' \; -exec ln -s '../../../../../' '{}' \;

test-babel:
BABEL_ENV=test npm run build
BABEL_ENV=test yarn run build
# in case babel ever switches to nyc: filter its config out of package.json
cd ./build/babel; \
jq "del(.nyc)" package.json > package.nonyc.json; \
mv -f package.nonyc.json package.json; \
../../node_modules/.bin/nyc --no-instrument --no-source-map --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts; \
mv .nyc_output ../../.nyc_output
../../node_modules/.bin/nyc --no-instrument --no-source-map --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --compilers js:babel-register; \

bootstrap-flow: clean
mkdir ./build
Expand Down
Loading