Skip to content

Commit f242e82

Browse files
committed
Merge branch 'master' into merge-upstream-7
2 parents aa070b3 + e81b5f8 commit f242e82

File tree

1,995 files changed

+52660
-17788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,995 files changed

+52660
-17788
lines changed

.babelignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test/fixtures
2+
lib

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
strip_root=true
1212
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
1313
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
14+
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore

.travis.yml

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,43 @@
11
sudo: false
22
language: node_js
33
node_js:
4-
- "0.10"
5-
- "0.12"
64
- "4"
7-
- "5"
85
- "6"
96
- "7"
107

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

1611
before_script:
17-
- 'if [ -n "${BABEL-}" ]; then make bootstrap-babel ; fi'
18-
- 'if [ -n "${FLOWTESTS-}" ]; then make bootstrap-flow ; fi'
19-
- 'BABEL_ENV=test npm run build'
20-
# Switch back to node version currently being tested prior to test run
21-
- 'nvm use $TRAVIS_NODE_VERSION;'
12+
- 'if [ "$JOB" = "babel-test" ]; then make bootstrap-babel ; fi'
13+
- 'if [ "$JOB" = "flow-test" ]; then make bootstrap-flow ; fi'
14+
- 'if [ "$JOB" = "test" ]; then yarn run build; fi'
2215

2316
script:
24-
- 'if [ -n "${LINT-}" ]; then npm run lint ; fi'
25-
- 'if [ -n "${FLOW-}" ]; then npm run flow ; fi'
26-
- 'if [ -n "${FLOWTESTS-}" ]; then make test-flow ; fi'
27-
- 'if [ -n "${BABEL-}" ]; then make test-babel ; fi'
28-
- 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${BABEL-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run test-ci ; fi'
17+
- 'if [ "$JOB" = "test" ]; then yarn test-only; fi'
18+
- 'if [ "$JOB" = "lint" ]; then yarn run lint && yarn run flow; fi'
19+
- 'if [ "$JOB" = "flow-test" ]; then make test-flow; fi'
20+
- 'if [ "$JOB" = "babel-test" ]; then make test-babel; fi'
21+
- 'if [ "$JOB" = "test-coverage" ]; then yarn run test-coverage; fi'
2922

3023
matrix:
3124
fast_finish: true
3225
include:
33-
- node_js: "node"
34-
env: LINT=true
35-
- node_js: "node"
36-
env: FLOW=true
37-
- node_js: "node"
38-
env: BABEL=true
39-
- node_js: "node"
40-
env: FLOWTESTS=true
26+
- node_js: "lts/*"
27+
env: JOB=test-coverage
28+
- node_js: "lts/*"
29+
env: JOB=lint
30+
- node_js: "lts/*"
31+
env: JOB=babel-test
32+
- node_js: "lts/*"
33+
env: JOB=flow-test
4134
allow_failures:
42-
- node_js: "node"
43-
env: FLOWTESTS=true
35+
- node_js: "lts/*"
36+
env: JOB=flow-test
4437

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

4742
notifications:
4843
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK

CHANGELOG.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,125 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
1515

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

18+
## v6.17.0 (2017-04-20)
19+
20+
### :bug: Bug Fix
21+
* Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie)
22+
* Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons)
23+
* Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng)
24+
* Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons)
25+
* Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng)
26+
* Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng)
27+
28+
## 7.0.0-beta.8 (2017-04-04)
29+
30+
### New Feature
31+
* Add support for flow type spread (#418) (Conrad Buck)
32+
* Allow statics in flow interfaces (#427) (Brian Ng)
33+
34+
### Bug Fix
35+
* Fix predicate attachment to match flow parser (#428) (Brian Ng)
36+
* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray)
37+
* Fix rest parameters with array and objects (#424) (Brian Ng)
38+
* Fix number parser (#433) (Alex Kuzmenko)
39+
40+
### Docs
41+
* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko)
42+
43+
### Internal
44+
* Use babel-register script when running babel smoke tests (#442) (Brian Ng)
45+
46+
## 7.0.0-beta.7 (2017-03-22)
47+
48+
### Spec Compliancy
49+
* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu)
50+
51+
### Bug Fix
52+
53+
* Fix push-pop logic in flow (#405) (Daniel Tschinder)
54+
55+
## 7.0.0-beta.6 (2017-03-21)
56+
57+
### New Feature
58+
* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons)
59+
60+
### Polish
61+
* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal)
62+
63+
### Docs
64+
65+
* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning)
66+
67+
## 7.0.0-beta.5 (2017-03-21)
68+
69+
### Bug Fix
70+
* Throw error if new.target is used outside of a function (#402) (Brian Ng)
71+
* Fix parsing of class properties (#351) (Kevin Gibbons)
72+
73+
### Other
74+
* Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy)
75+
* Optimize travis builds (#419) (Daniel Tschinder)
76+
* Update codecov to 2.0 (#412) (Daniel Tschinder)
77+
* Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy)
78+
* Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning)
79+
* Upgrade flow to 0.41 (Daniel Tschinder)
80+
* Fix watch command (#403) (Brian Ng)
81+
* Update yarn lock (Daniel Tschinder)
82+
* Fix watch command (#403) (Brian Ng)
83+
* chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot])
84+
* Add estree test for correct order of directives (Daniel Tschinder)
85+
* Add DoExpression to spec (#364) (Alex Kuzmenko)
86+
* Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde)
87+
* Explain how to run only one test (#389) [skip ci] (Aaron Ang)
88+
89+
## 7.0.0-beta.4 (2017-03-01)
90+
91+
* Don't consume async when checking for async func decl (#377) (Brian Ng)
92+
* add `ranges` option [skip ci] (Henry Zhu)
93+
* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine)
94+
95+
## 7.0.0-beta.3 (2017-02-28)
96+
97+
- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384)
98+
- Merge changes from 6.x
99+
100+
## 7.0.0-beta.2 (2017-02-20)
101+
102+
- estree: correctly change literals in all cases (#368) (Daniel Tschinder)
103+
104+
## 7.0.0-beta.1 (2017-02-20)
105+
106+
- Fix negative number literal typeannotations (#366) (Daniel Tschinder)
107+
- Update contributing with more test info [skip ci] (#355) (Brian Ng)
108+
109+
## 7.0.0-beta.0 (2017-02-15)
110+
111+
- Reintroduce Variance node (#333) (Daniel Tschinder)
112+
- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick)
113+
- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail)
114+
- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot])
115+
- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot])
116+
- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder)
117+
- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi)
118+
- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder)
119+
- Remove classConstructorCall plugin (#291) (Brian Ng)
120+
- Update yarn.lock (Daniel Tschinder)
121+
- Update cross-env to 3.x (Daniel Tschinder)
122+
- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov)
123+
- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens)
124+
125+
## 6.16.1 (2017-02-23)
126+
127+
### :bug: Regression
128+
129+
- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375))
130+
131+
Need to modify Babel for this AST node change, so moving to 7.0.
132+
133+
- 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))
134+
135+
[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted.
136+
18137
## 6.16.0 (2017-02-23)
19138

20139
### :rocket: New Feature

CONTRIBUTING.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ contributing, please read the
66

77
## Setup local env
88

9+
> Install yarn beforehand: https://yarnpkg.com/en/docs/install
10+
911
To start developing on Babylon you only need to install its dependencies:
1012

1113
```bash
12-
npm install
14+
git clone https://github.com/babel/babylon
15+
cd babylon
16+
yarn
1317
```
1418

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

2125
```bash
22-
npm test
26+
yarn test
2327
```
2428

2529
If you only want to run the tests:
2630

2731
```bash
28-
npm run test-only
32+
yarn run test-only
2933
```
3034

31-
Note, this does not actually run a build, so you may have to call `npm run build` after
35+
Note, this does not actually run a build, so you may have to call `yarn run build` after
3236
performing any changes.
3337

38+
### Running one test
39+
40+
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).
41+
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.
42+
43+
Add `"only": true` to its `options.json`:
44+
45+
```json
46+
{
47+
"sourceType": "module",
48+
"only": true
49+
}
50+
```
51+
52+
Then, run the tests using the same command as before:
53+
54+
```bash
55+
yarn run test-only
56+
```
57+
3458
### Checking code coverage locally
3559

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

3963
```bash
40-
BABEL_ENV=test npm run build && npm run test-ci
64+
BABEL_ENV=test yarn run build && yarn run test-coverage
4165
```
4266

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

6286
```bash
6387
cd babylon/
64-
npm link
65-
npm run build
88+
yarn link
89+
yarn run build
6690
cd ../babel/
6791
make bootstrap
68-
npm link babylon
92+
yarn link babylon
6993
cd packages/babel-core/
70-
npm link babylon
71-
cd ../../packages/babel-template/
72-
npm link babylon
73-
cd ../../packages/babel-traverse/
74-
npm link babylon
75-
cd ../../packages/babel-generator/
76-
npm link babylon
94+
yarn link babylon
95+
cd ../babel-template/
96+
yarn link babylon
97+
cd ../babel-traverse/
98+
yarn link babylon
99+
cd ../babel-generator/
100+
yarn link babylon
101+
cd ../babel-types/
102+
yarn link babylon
77103
cd ../..
78104
make build
79105
make test

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ clean: ; rm -rf ./build
88

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

1616
test-babel:
17-
BABEL_ENV=test npm run build
17+
BABEL_ENV=test yarn run build
1818
# in case babel ever switches to nyc: filter its config out of package.json
1919
cd ./build/babel; \
2020
jq "del(.nyc)" package.json > package.nonyc.json; \
2121
mv -f package.nonyc.json package.json; \
22-
../../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; \
23-
mv .nyc_output ../../.nyc_output
22+
../../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; \
2423

2524
bootstrap-flow: clean
2625
mkdir ./build

0 commit comments

Comments
 (0)