Skip to content

Commit e6daec0

Browse files
authored
Revert "Merge upstream babylon/master (v7.0, incomplete)"
1 parent 08f4cdc commit e6daec0

2,095 files changed

Lines changed: 21078 additions & 54422 deletions

File tree

Some content is hidden

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

.babelignore

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

.flowconfig

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

.travis.yml

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

8-
env:
9-
- JOB=test
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
1015

1116
before_script:
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'
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;'
1522

1623
script:
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'
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'
2229

2330
matrix:
2431
fast_finish: true
2532
include:
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
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
3441
allow_failures:
35-
- node_js: "lts/*"
36-
env: JOB=flow-test
42+
- node_js: "node"
43+
env: FLOWTESTS=true
3744

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'
45+
after_success: 'if [ -z "${LINT-}" ] && [ -z "${FLOW-}" ] && [ -z "${FLOWTESTS-}" ]; then npm run coverage ; fi'
4146

4247
notifications:
4348
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK

CHANGELOG.md

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -15,125 +15,6 @@ _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-
13718
## 6.16.0 (2017-02-23)
13819

13920
### :rocket: New Feature

CONTRIBUTING.md

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

77
## Setup local env
88

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

1311
```bash
14-
git clone https://github.com/babel/babylon
15-
cd babylon
16-
yarn
12+
npm install
1713
```
1814

1915
## Tests
@@ -23,45 +19,25 @@ yarn
2319
To run a build, tests and perform lint/flow checks:
2420

2521
```bash
26-
yarn test
22+
npm test
2723
```
2824

2925
If you only want to run the tests:
3026

3127
```bash
32-
yarn run test-only
28+
npm run test-only
3329
```
3430

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

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-
5834
### Checking code coverage locally
5935

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

6339
```bash
64-
BABEL_ENV=test yarn run build && yarn run test-coverage
40+
BABEL_ENV=test npm run build && npm run test-ci
6541
```
6642

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

8662
```bash
8763
cd babylon/
88-
yarn link
89-
yarn run build
64+
npm link
65+
npm run build
9066
cd ../babel/
9167
make bootstrap
92-
yarn link babylon
68+
npm link babylon
9369
cd packages/babel-core/
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
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
10377
cd ../..
10478
make build
10579
make test

Makefile

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

99
bootstrap-babel: clean
1010
mkdir ./build
11-
git clone --depth=1 --branch=7.0 https://github.com/babel/babel.git ./build/babel
11+
git clone --depth=1 --branch=master 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 yarn run build
17+
BABEL_ENV=test npm 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 --reporter=json --report-dir ../../coverage node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --compilers js:babel-register; \
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
2324

2425
bootstrap-flow: clean
2526
mkdir ./build

0 commit comments

Comments
 (0)