Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 2 deletions .babelignore

This file was deleted.

1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
strip_root=true
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_comment= \\(.\\|\n\\)*\\$FlowIssue
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
51 changes: 28 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
sudo: false
language: node_js
node_js:
- "0.10"
- "0.12"
- "4"
- "5"
- "6"
- "7"

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

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

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

matrix:
fast_finish: true
include:
- 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
- node_js: "node"
env: LINT=true
- node_js: "node"
env: FLOW=true
- node_js: "node"
env: BABEL=true
- node_js: "node"
env: FLOWTESTS=true
allow_failures:
- node_js: "lts/*"
env: JOB=flow-test
- node_js: "node"
env: FLOWTESTS=true

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

notifications:
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK
119 changes: 0 additions & 119 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,125 +15,6 @@ _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: 15 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ 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
git clone https://github.com/babel/babylon
cd babylon
yarn
npm install
```

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

```bash
yarn test
npm test
```

If you only want to run the tests:

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

Note, this does not actually run a build, so you may have to call `yarn run build` after
Note, this does not actually run a build, so you may have to call `npm 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 yarn run build && yarn run test-coverage
BABEL_ENV=test npm run build && npm run test-ci
```

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

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

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

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