diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96d28278e150..f90ac42c1212 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,107 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
+## 6.24.0 (2017-03-13)
+
+A quick release for 2 features:
+
+- Thanks to @rwjblue, there is now a `noInterop` option for our `es2015-modules` transform to remove the `interopRequireDefault` and `interopRequireWildcard` helpers.
+
+Input
+
+```js
+import foo from "foo";
+foo;
+```
+
+Regular Output
+
+```js
+var _foo = require("foo");
+var _foo2 = _interopRequireDefault(_foo);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+_foo2.default;
+```
+
+Output with option `noInterop`
+
+```js
+"use strict";
+var _foo = require("foo");
+(0, _foo.default)();
+```
+
+> This also helps [ember-cli migrate to Babel 6](https://github.com/ember-cli/ember-cli/pull/6828).
+
+- @izaakschroeder has added `dirname` to the preset constructor which presets can use to resolve things relative to files.
+
+Example usage of `fileContext.dirname` in a preset
+
+```js
+module.exports = function preset (context, options, fileContext) {
+ if (/resolve-addons-relative-to-file$/.test(fileContext.dirname)) {
+ return {
+ plugins: ['plugin-here'],
+ };
+ }
+ return {};
+};
+```
+
+> This will help out with reusing a [`browserslist` file for babel-preset-env](https://github.com/babel/babel-preset-env/issues/26) and for plugins like https://github.com/tleunen/babel-plugin-module-resolver.
+
+#### :rocket: New Feature
+* `babel-plugin-transform-es2015-modules-amd`, `babel-plugin-transform-es2015-modules-commonjs`
+ * [#5427](https://github.com/babel/babel/pull/5427) Backport `noInterop` flag for modules to 6.x. ([@rwjblue](https://github.com/rwjblue))
+* `babel-core`
+ * [#4834](https://github.com/babel/babel/pull/4834) Pass `dirname` as extra metadata to preset constructor. ([@izaakschroeder](https://github.com/izaakschroeder))
+
+#### :bug: Bug Fix
+* `babel-generator`
+ * [#5453](https://github.com/babel/babel/pull/5453) Keep parentheses for logical expression when in await expression. ([@aaronang](https://github.com/aaronang))
+ * [#5339](https://github.com/babel/babel/pull/5339) Wrap some generated do expressions in parens. ([@zjmiller](https://github.com/zjmiller))
+* `babel-generator`, `babel-plugin-transform-object-rest-spread`
+ * [#5322](https://github.com/babel/babel/pull/5322) Fix for-await printing. ([@danez](https://github.com/danez))
+
+#### :memo: Documentation
+
+* [#5449](https://github.com/babel/babel/pull/5449) Fixed broken links in README.md [skip-ci]. ([@sethbergman](https://github.com/sethbergman))
+* [#5409](https://github.com/babel/babel/pull/5409) Fix transform-object-rest-spread README. ([@existentialism](https://github.com/existentialism))
+* [#5379](https://github.com/babel/babel/pull/5379) Lint code snippets in READMEs. ([@xtuc](https://github.com/xtuc))
+* [#5334](https://github.com/babel/babel/pull/5334) Shorthand properties examples. ([@bhoule](https://github.com/bhoule))
+* [#5329](https://github.com/babel/babel/pull/5329) Update CONTRIBUTING.md with respect to coverage check [skip ci]. ([@zjmiller](https://github.com/zjmiller))
+
+#### :house: Internal
+* Other
+ * [#5338](https://github.com/babel/babel/pull/5338) Improve babel-generator's code coverage. ([@alxpy](https://github.com/alxpy))
+ * [#5336](https://github.com/babel/babel/pull/5336) Enable codecov partial coverage. ([@danez](https://github.com/danez))
+ * [#5350](https://github.com/babel/babel/pull/5350) Remove redundant NODE_ENV=test in Makefile. ([@aaronang](https://github.com/aaronang))
+ * [#5312](https://github.com/babel/babel/pull/5312) [skip ci] Add devEngines to package.json. ([@yavorsky](https://github.com/yavorsky))
+* `babel-cli`
+ * [#5342](https://github.com/babel/babel/pull/5342) Add test for passing arguments to babel-node (#5163). ([@outsideris](https://github.com/outsideris))
+* `babel-traverse`
+ * [#5296](https://github.com/babel/babel/pull/5296) Add test for reference paths. ([@jasonLaster](https://github.com/jasonLaster))
+
+#### Committers: 14
+- Aaron Ang ([aaronang](https://github.com/aaronang))
+- Alex Kuzmenko ([alxpy](https://github.com/alxpy))
+- Artem Gurzhii ([artemgurzhii](https://github.com/artemgurzhii))
+- Artem Yavorsky ([yavorsky](https://github.com/yavorsky))
+- Brendan Houle ([bhoule](https://github.com/bhoule))
+- Brian Ng ([existentialism](https://github.com/existentialism))
+- Daniel Tschinder ([danez](https://github.com/danez))
+- Izaak Schroeder ([izaakschroeder](https://github.com/izaakschroeder))
+- Jason Laster ([jasonLaster](https://github.com/jasonLaster))
+- JeongHoon Byun (aka Outsider) ([outsideris](https://github.com/outsideris))
+- Robert Jackson ([rwjblue](https://github.com/rwjblue))
+- Seth Bergman ([sethbergman](https://github.com/sethbergman))
+- Sven SAULEAU ([xtuc](https://github.com/xtuc))
+- Zachary Miller ([zjmiller](https://github.com/zjmiller))
+
+## 6.23.1 (2017-02-13)
+
+Regression: Revert https://github.com/babel/babel/pull/5306 since it made a backwards-incompatible change.
+
## 6.23.0 (2017-02-13)
#### :rocket: New Feature
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 086a0422661b..fa6650e420d7 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,7 +2,7 @@
----
-
+
Setup
|
Running linting/tests
@@ -27,7 +27,7 @@ Contributions are always welcome, no matter how large or small.
- 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): 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
+ - This repository's [`/doc`](https://github.com/babel/babel/tree/master/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](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).
@@ -47,7 +47,7 @@ You can check this with `node -v` and `npm -v`.
In addition, make sure that Yarn is installed.
Installation instructions can be found here: https://yarnpkg.com/en/docs/install.
-#### Setup
+### Setup
```sh
$ git clone https://github.com/babel/babel
@@ -77,7 +77,7 @@ If you wish to build a copy of Babel for distribution, then run:
$ make build-dist
```
-#### Running linting/tests
+### Running linting/tests
You can run lint via:
@@ -108,7 +108,7 @@ $ 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:
+To run tests for a specific package in [packages](https://github.com/babel/babel/tree/master/packages), you can use the `TEST_ONLY` environment variable:
```sh
$ TEST_ONLY=babel-cli make test
@@ -133,27 +133,27 @@ $ BABEL_ENV=cov make build
$ ./scripts/test-cov.sh
```
-#### Writing tests
+### Writing tests
-Most packages in [`/packages`](/packages) have a `test` folder, however some tests might be in other packages or in [`/packages/babel-core`](/packages/babel-core/test/fixtures).
+Most packages in [`/packages`](https://github.com/babel/babel/tree/master/packages) have a `test` folder, however some tests might be in other packages or in [`/packages/babel-core`](https://github.com/babel/babel/tree/master/packages/babel-core/test/fixtures).
-##### `babel-plugin-x`
+#### `babel-plugin-x`
All the Babel plugins (and other packages) that have a `/test/fixtures` are written in a similar way.
-For example, in [`babel-plugin-transform-exponentiation-operator/test`](/packages/babel-plugin-transform-exponentiation-operator/test):
+For example, in [`babel-plugin-transform-exponentiation-operator/test`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test):
-- There is an `index.js` file. It imports our [test helper](/packages/babel-helper-plugin-test-runner). (You don't have to worry about this).
-- There can be multiple folders under [`/fixtures`](/packages/babel-plugin-transform-exponentiation-operator/test/fixtures)
- - There is an [`options.json`](/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests.
+- There is an `index.js` file. It imports our [test helper](https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner). (You don't have to worry about this).
+- There can be multiple folders under [`/fixtures`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures)
+ - There is an [`options.json`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests.
- For this test, we only need the relevant plugin, so it's just `{ "plugins": ["transform-exponentiation-operator"] }`.
- If necessary, you can have an `options.json` with different options in each subfolder.
- In each subfolder, you can organize your directory structure by categories of tests. (Example: these folders can be named after the feature you are testing or can reference the issue number they fix)
- Generally, there are two kinds of tests for plugins
- - The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`actual.js`](packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/actual.js) file and an [`expected.js`](/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/expected.js) file.
+ - The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`actual.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/actual.js) file and an [`expected.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/expected.js) file.
- If you need to expect an error, you can ignore creating the `expected.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
- - The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.
+ - The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.
In an actual/expected test, you simply write out the code you want transformed in `actual.js`.
@@ -186,7 +186,7 @@ If you need to check for an error that is thrown you can add to the `options.jso
}
```
-##### Bootstrapping expected output
+#### Bootstrapping expected output
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.
@@ -202,7 +202,7 @@ For both `babel-plugin-x` and `babylon`, you can easily generate an `expected.js
- expected.json (will be generated if not created)
```
-#### Debugging code
+### Debugging code
A common approach to debugging JavaScript code is to walk through the code using the [Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/) debugger.
For illustration purposes, we are going to assume that we need to get a better understanding of [`Generator.generate()`](https://github.com/babel/babel/blob/b5246994b57f06af871be6a63dcc4c6fd41d94d6/packages/babel-generator/src/index.js#L32), which is responsible for generating code for a given AST.
@@ -239,9 +239,9 @@ The debugger starts at the first executed line of code, which is Mocha's first l
Click _Resume script execution_ to jump to the set breakpoint.
Note that the code shown in Chrome DevTools is compiled code and therefore differs.
-#### Internals
+## Internals
- AST spec ([babylon/ast/spec.md](https://github.com/babel/babylon/blob/master/ast/spec.md))
-- Versioning ([doc/design/versioning.md](./doc/design/versioning.md))
-- Monorepo ([doc/design/monorepo.md](./doc/design/monorepo.md))
-- Compiler environment support ([doc/design/compiler-environment-support.md](./doc/design/compiler-environment-support.md))
-- Compiler assumptions ([doc/design/compiler-assumptions.md](./doc/design/compiler-assumptions.md))
+- Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md)
+- Monorepo ([doc/design/monorepo.md](https://github.com/babel/babel/blob/master/doc/design/monorepo.md))
+- Compiler environment support ([doc/design/compiler-environment-support.md](https://github.com/babel/babel/blob/master/doc/design/compiler-environment-support.md))
+- Compiler assumptions ([doc/design/compiler-assumptions.md](https://github.com/babel/babel/blob/master/doc/design/compiler-assumptions.md))
diff --git a/Makefile b/Makefile
index 236aadb839d5..3f68e4cb0415 100644
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@ publish:
make test
# not using lerna independent mode atm, so only update packages that have changed since we use ^
# --only-explicit-updates
- ./node_modules/.bin/lerna publish --npm-tag=next --exact
+ ./node_modules/.bin/lerna publish --npm-tag=next --exact --skip-temp-tag
make clean
bootstrap:
diff --git a/README.md b/README.md
index b8fe9840efe5..367565bba1cd 100644
--- a/README.md
+++ b/README.md
@@ -137,27 +137,9 @@ After Babel 6, the default transforms were removed; if you don't specify any plu
The transformer[s] used in Babel are the independent pieces of code that transform specific things. For example: the [`es2015-arrow-functions`](/packages/babel-plugin-transform-es2015-arrow-functions) transform specifically changes arrow functions into a regular function. Presets are just simply an array of plugins that make it easier to run a whole a set of transforms without specifying each one manually.
-There are a few presets that we maintain officially.
-
-| Package | Version | Dependencies |
-|--------|-------|------------|
-| [`babel-preset-es2015`](/packages/babel-preset-es2015) | [![npm](https://img.shields.io/npm/v/babel-preset-es2015.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-es2015) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-es2015)](https://david-dm.org/babel/babel?path=packages/babel-preset-es2015) |
-| [`babel-preset-es2016`](/packages/babel-preset-es2016) | [![npm](https://img.shields.io/npm/v/babel-preset-es2016.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-es2016) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-es2016)](https://david-dm.org/babel/babel?path=packages/babel-preset-es2016) |
-| [`babel-preset-es2017`](/packages/babel-preset-es2017) | [![npm](https://img.shields.io/npm/v/babel-preset-es2017.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-es2017) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-es2017)](https://david-dm.org/babel/babel?path=packages/babel-preset-es2017) |
-| [`babel-preset-latest`](/packages/babel-preset-latest) | [![npm](https://img.shields.io/npm/v/babel-preset-latest.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-latest) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-latest)](https://david-dm.org/babel/babel?path=packages/babel-preset-latest) |
-| [`babel-preset-stage-0`](/packages/babel-preset-stage-0) | [![npm](https://img.shields.io/npm/v/babel-preset-stage-0.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-stage-0) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-stage-0)](https://david-dm.org/babel/babel?path=packages/babel-preset-stage-0) |
-| [`babel-preset-stage-1`](/packages/babel-preset-stage-1) | [![npm](https://img.shields.io/npm/v/babel-preset-stage-1.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-stage-1) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-stage-1)](https://david-dm.org/babel/babel?path=packages/babel-preset-stage-1) |
-| [`babel-preset-stage-2`](/packages/babel-preset-stage-2) | [![npm](https://img.shields.io/npm/v/babel-preset-stage-2.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-stage-2) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-stage-2)](https://david-dm.org/babel/babel?path=packages/babel-preset-stage-2) |
-| [`babel-preset-stage-3`](/packages/babel-preset-stage-3) | [![npm](https://img.shields.io/npm/v/babel-preset-stage-3.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-stage-3) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-stage-3)](https://david-dm.org/babel/babel?path=packages/babel-preset-stage-3) |
-| [`babel-preset-react`](/packages/babel-preset-react) | [![npm](https://img.shields.io/npm/v/babel-preset-react.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-react) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-preset-react)](https://david-dm.org/babel/babel?path=packages/babel-preset-react) |
-| [`babel-preset-env`](https://github.com/babel/babel-preset-env) | [![npm](https://img.shields.io/npm/v/babel-preset-env.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-env) | [![Dependency Status](https://david-dm.org/babel/babel-preset-env.svg)](https://david-dm.org/babel/babel-preset-env) |
-
-We maintain:
-
-- a preset for each yearly release of ECMAScript (Javascript) starting from ES6/ES2015.
-- a preset for react (JSX/Flow).
-- a preset for each [stage (0-3)](http://babeljs.io/docs/plugins/#stage-x-experimental-presets) of the [TC-39 Process](https://tc39.github.io/process-document/) for ECMAScript proposals.
-- a preset that can automatically determine plugins and polyfills you need based on your supported environments.
+| Package | Version | Dependencies | Description |
+|--------|-------|------------|---|
+| [`babel-preset-env`](https://github.com/babel/babel-preset-env) | [![npm](https://img.shields.io/npm/v/babel-preset-env.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-env) | [![Dependency Status](https://david-dm.org/babel/babel-preset-env.svg)](https://david-dm.org/babel/babel-preset-env) | automatically determines plugins and polyfills you need based on your supported environments |
> You can find community maintained presets on [npm](https://www.npmjs.com/search?q=babel-preset)
@@ -191,17 +173,17 @@ Babel | Daniel Tschinder | Logan Smyth | Henry Zhu |
### Members
-[![Andrew Levine](https://avatars.githubusercontent.com/u/5233399?s=64)](https://github.com/drewml) | [![Boopathi Rajaa](https://avatars.githubusercontent.com/u/294474?s=64)](https://github.com/boopathi) | [![Brian Ng](https://avatars.githubusercontent.com/u/56288?s=64)](https://github.com/existentialism) | [![Dan Harper](https://avatars.githubusercontent.com/u/510740?s=64)](https://github.com/danharper) | [![Diogo Franco](https://avatars.githubusercontent.com/u/73085?s=64)](https://github.com/kovensky) |
-|---|---|---|---|---|---|---|---|---|
-| Andrew Levine | Boopathi Rajaa | Brian Ng | Dan Harper | Diogo Franco |
-| [@drewml](https://github.com/drewml) | [@boopathi](https://github.com/boopathi) | [@existentialism](https://github.com/existentialism) | [@danharper](https://github.com/danharper) | [@kovensky](https://github.com/kovensky) |
-| [@drewml](https://twitter.com/drewml) | [@heisenbugger](https://twitter.com/heisenbugger) | [@existentialism](https://twitter.com/existentialism) | [@DanHarper7](https://twitter.com/DanHarper7) | [@kovnsk](https://twitter.com/kovnsk) |
+[![Andrew Levine](https://avatars.githubusercontent.com/u/5233399?s=64)](https://github.com/drewml) | [![Boopathi Rajaa](https://avatars.githubusercontent.com/u/294474?s=64)](https://github.com/boopathi) | [![Brian Ng](https://avatars.githubusercontent.com/u/56288?s=64)](https://github.com/existentialism) | [![Dan Harper](https://avatars.githubusercontent.com/u/510740?s=64)](https://github.com/danharper) | [![diogo franco](https://avatars.githubusercontent.com/u/73085?s=64)](https://github.com/kovensky) | [![Aaron Ang](https://avatars1.githubusercontent.com/u/7579804?s=64)](https://github.com/aaronang) | [![Artem Yavorsky](https://avatars2.githubusercontent.com/u/1521229?s=64)](https://github.com/yavorsky) |
+|---|---|---|---|---|---|---|---|---|---|---|
+| Andrew Levine | Boopathi Rajaa | Brian Ng | Dan Harper | Diogo Franco | Aaron Ang | Artem Yavorsky |
+| [@drewml](https://github.com/drewml) | [@boopathi](https://github.com/boopathi) | [@existentialism](https://github.com/existentialism) | [@danharper](https://github.com/danharper) | [@kovensky](https://github.com/kovensky) | [@aaronang](https://github.com/aaronang) | [@yavorsky](https://github.com/yavorsky) |
+| [@drewml](https://twitter.com/drewml) | [@heisenbugger](https://twitter.com/heisenbugger) | [@existentialism](https://twitter.com/existentialism) | [@DanHarper7](https://twitter.com/DanHarper7) | [@kovnsk](https://twitter.com/kovnsk) | [@_aaronang](https://twitter.com/_aaronang) | [@yavorsky_](https://twitter.com/yavorsky_) |
-[![Juriy Zaytsev](https://avatars.githubusercontent.com/u/383?s=64)](https://github.com/kangax) | [![Kai Cataldo](https://avatars.githubusercontent.com/u/7041728?s=64)](https://github.com/kaicataldo) | [![Moti Zilberman](https://avatars.githubusercontent.com/u/2246565?s=64)](https://github.com/motiz88) | [![Sven Sauleau](https://avatars3.githubusercontent.com/u/1493671?s=64)](https://github.com/xtuc) |
-|---|---|---|---|---|---|---|---|---|
-| Juriy Zaytsev | Kai Cataldo | Moti Zilberman | Sven Sauleau |
-| [@kangax](https://github.com/kangax) | [@kaicataldo](https://github.com/kaicataldo) | [@motiz88](https://github.com/motiz88) | [@xtuc](https://github.com/xtuc) |
-| [@kangax](https://twitter.com/kangax) | [@kai_cataldo](https://twitter.com/kai_cataldo) | [@motiz88](https://twitter.com/motiz88) | [@svensauleau](https://twitter.com/svensauleau) |
+[![Juriy Zaytsev](https://avatars.githubusercontent.com/u/383?s=64)](https://github.com/kangax) | [![Kai Cataldo](https://avatars.githubusercontent.com/u/7041728?s=64)](https://github.com/kaicataldo) | [![Moti Zilberman](https://avatars.githubusercontent.com/u/2246565?s=64)](https://github.com/motiz88) | [![Sven Sauleau](https://avatars3.githubusercontent.com/u/1493671?s=64)](https://github.com/xtuc) | [![Samuel Reed](https://avatars3.githubusercontent.com/u/1197375?s=64)](https://github.com/STRML) | [![Sergey Rubanov](https://avatars1.githubusercontent.com/u/1507086?s=64)](https://github.com/chicoxyzzy) |
+|---|---|---|---|---|---|---|---|---|---|---|
+| Juriy Zaytsev | Kai Cataldo | Moti Zilberman | Sven Sauleau | Samuel Reed | Sergey Rubanov |
+| [@kangax](https://github.com/kangax) | [@kaicataldo](https://github.com/kaicataldo) | [@motiz88](https://github.com/motiz88) | [@xtuc](https://github.com/xtuc) | [@STRML](https://github.com/STRML) | [@chicoxyzzy](https://github.com/chicoxyzzy) |
+| [@kangax](https://twitter.com/kangax) | [@kai_cataldo](https://twitter.com/kai_cataldo) | [@motiz88](https://twitter.com/motiz88) | [@svensauleau](https://twitter.com/svensauleau) | [@STRML_](https://twitter.com/STRML_) | [@chicoxyzzy](https://twitter.com/chicoxyzzy) |
### Non-Human Members
@@ -222,3 +204,4 @@ Amjad Masad | James Kyle | Jesse McCarthy | Sebastian McKenzie |
## License
[MIT](https://github.com/babel/babel/blob/master/LICENSE)
+
diff --git a/lerna.json b/lerna.json
index de8942ffe298..91036a0b369e 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,6 +1,6 @@
{
"lerna": "2.0.0-beta.38",
- "version": "independent",
+ "version": "7.0.0-alpha.2",
"changelog": {
"repo": "babel/babel",
"labels": {
diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json
index 87c8d483ac3b..81ca73d32b7a 100644
--- a/packages/babel-cli/package.json
+++ b/packages/babel-cli/package.json
@@ -1,6 +1,6 @@
{
"name": "babel-cli",
- "version": "7.0.0-alpha.1",
+ "version": "7.0.0-alpha.2",
"description": "Babel command line.",
"author": "Sebastian McKenzie ",
"homepage": "https://babeljs.io/",
@@ -16,8 +16,8 @@
"compiler"
],
"dependencies": {
- "babel-core": "7.0.0-alpha.1",
- "babel-register": "7.0.0-alpha.1",
+ "babel-core": "7.0.0-alpha.2",
+ "babel-register": "7.0.0-alpha.2",
"babel-polyfill": "7.0.0-alpha.1",
"commander": "^2.8.1",
"convert-source-map": "^1.1.0",
diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json
index 9e52e8894c3c..0c99b5938595 100644
--- a/packages/babel-core/package.json
+++ b/packages/babel-core/package.json
@@ -1,6 +1,6 @@
{
"name": "babel-core",
- "version": "7.0.0-alpha.1",
+ "version": "7.0.0-alpha.2",
"description": "Babel compiler core.",
"author": "Sebastian McKenzie ",
"homepage": "https://babeljs.io/",
@@ -31,7 +31,7 @@
"babel-helpers": "7.0.0-alpha.1",
"babel-messages": "7.0.0-alpha.1",
"babel-template": "7.0.0-alpha.1",
- "babel-register": "7.0.0-alpha.1",
+ "babel-register": "7.0.0-alpha.2",
"babel-traverse": "7.0.0-alpha.1",
"babel-types": "7.0.0-alpha.1",
"babylon": "7.0.0-beta.4",
@@ -41,12 +41,13 @@
"lodash": "^4.2.0",
"minimatch": "^3.0.2",
"private": "^0.1.6",
+ "resolve": "^1.3.2",
"slash": "^1.0.0",
"source-map": "^0.5.0"
},
"devDependencies": {
"babel-helper-fixtures": "7.0.0-alpha.1",
- "babel-helper-transform-fixture-test-runner": "7.0.0-alpha.1",
+ "babel-helper-transform-fixture-test-runner": "7.0.0-alpha.2",
"babel-polyfill": "7.0.0-alpha.1"
}
}
diff --git a/packages/babel-core/src/helpers/resolve.js b/packages/babel-core/src/helpers/resolve.js
index e8493ac8f599..f0c6b27f81ca 100644
--- a/packages/babel-core/src/helpers/resolve.js
+++ b/packages/babel-core/src/helpers/resolve.js
@@ -1,33 +1,8 @@
-import Module from "module";
-import path from "path";
-
-const relativeModules = {};
+import resolve from "resolve";
export default function (loc: string, relative: string = process.cwd()): ?string {
- // we're in the browser, probably
- if (typeof Module === "object") return null;
-
- let relativeMod = relativeModules[relative];
-
- if (!relativeMod) {
- relativeMod = new Module;
-
- // We need to define an id and filename on our "fake" relative` module so that
- // Node knows what "." means in the case of us trying to resolve a plugin
- // such as "./myPlugins/somePlugin.js". If we don't specify id and filename here,
- // Node presumes "." is process.cwd(), not our relative path.
- // Since this fake module is never "loaded", we don't have to worry about mutating
- // any global Node module cache state here.
- const filename = path.join(relative, ".babelrc");
- relativeMod.id = filename;
- relativeMod.filename = filename;
-
- relativeMod.paths = Module._nodeModulePaths(relative);
- relativeModules[relative] = relativeMod;
- }
-
try {
- return Module._resolveFilename(loc, relativeMod);
+ return resolve.sync(loc, { basedir: relative });
} catch (err) {
return null;
}
diff --git a/packages/babel-core/src/transformation/file/index.js b/packages/babel-core/src/transformation/file/index.js
index dad9ec5b138d..f11e75030324 100644
--- a/packages/babel-core/src/transformation/file/index.js
+++ b/packages/babel-core/src/transformation/file/index.js
@@ -45,7 +45,17 @@ export default class File extends Store {
super();
this.log = new Logger(this, opts.filename || "unknown");
- this.opts = this.initOptions(opts);
+
+ opts = this.initOptions(opts);
+
+ let passes = [];
+ if (opts.plugins) passes.push(opts.plugins);
+
+ // With "passPerPreset" enabled there may still be presets in the options.
+ if (opts.presets) passes = passes.concat(opts.presets.map((preset) => preset.plugins).filter(Boolean));
+
+ this.pluginPasses = passes;
+ this.opts = opts;
this.parserOpts = {
sourceType: this.opts.sourceType,
@@ -53,22 +63,12 @@ export default class File extends Store {
plugins: [],
};
- this.pluginVisitors = [];
- this.pluginPasses = [];
-
- // Plugins for top-level options.
- this.buildPluginsForOptions(this.opts);
-
- // If we are in the "pass per preset" mode, build
- // also plugins for each preset.
- if (this.opts.passPerPreset) {
- // All the "per preset" options are inherited from the main options.
- this.perPresetOpts = [];
- this.opts.presets.forEach((presetOpts) => {
- const perPresetOpts = Object.assign(Object.create(this.opts), presetOpts);
- this.perPresetOpts.push(perPresetOpts);
- this.buildPluginsForOptions(perPresetOpts);
- });
+ for (const pluginPairs of passes) {
+ for (const [ plugin ] of pluginPairs) {
+ if (plugin.manipulateOptions) {
+ plugin.manipulateOptions(opts, this.parserOpts, this);
+ }
+ }
}
this.metadata = {
@@ -100,8 +100,7 @@ export default class File extends Store {
static helpers: Array;
- pluginVisitors: Array