336 Commits

Author SHA1 Message Date
Mateusz Burzyński
4519f95a29 Fixed buildExternalHelpers tool for var and module output types (#6260) 2017-09-19 14:44:40 -04:00
Ajay Narain Mathur
3cdb7d7f0f added instanceOf plugin to preset es2015 (#6257)
* added instanceOf plugin to preset es2015

* fixed test cases
2017-09-17 17:33:42 -04:00
Logan Smyth
158e9fbfd7 Represent helpers as simple modules. 2017-09-12 22:15:16 -07:00
Sven SAULEAU
0c5fae2faa Make sure source type is module when parsing .mjs (#5700)
* feat: force source type module for mjs extension

* style: fix lint
2017-09-12 20:59:00 -07:00
Logan Smyth
1e750a945c Convert CommonJS to use new shared implementation. 2017-09-12 17:17:41 -07:00
Mateusz Burzyński
c47258d68c Annotating transformed classes with #__PURE__ comment (#6209) 2017-09-11 11:18:37 -04:00
Mateusz Burzyński
fffa604023 Fixed regenerator related fixtures 2017-08-16 10:02:33 +02:00
Henry Zhu
0f823beeb1 Newlines in fixtures (#6044)
* write newlines for fixtures

* rerun fixtures
2017-08-02 15:35:29 -04:00
chocolateboy
605adc922d allow PluginPass.file.addImport to create empty import statements (#6022)
* allow PluginPass.file.addImport to create empty import statements; fixes #6021

omitting addImport's second argument creates an import statement with an
empty `specifiers` array i.e. an empty import statement:

plugin:

    Program (path, { file }) {
        file.addImport('foo-bar/register')
    }

output:

    import "foo-bar/register";
2017-07-28 12:37:00 -04:00
Peeyush Kushwaha
4a35243118 Non string computed keys in object-rest-spread (#5757) 2017-07-25 09:46:52 -05:00
Justin Ridgewell
63204ae51e Remove maybePopFromStatements (#5945)
It prevented you from pushing into the `params` of a function.

```js
fnpath.pushContainer("params", t.identifier("memo"))
```
2017-07-18 14:55:33 -04:00
Brian Ng
58ec149c52 Fix some unneeded semis in test fixtures (#5892) 2017-06-27 22:15:10 -05:00
Daniel Tschinder
b3372a572d Remove whitespace generation (#5833)
* Remove whitespace generation and rely on default printing

Changes to printing:
* Add newline after last empty SwitchCase
* Add newlines around block comments if they are non-flow comments or contain newlines

* Fix a few more fixtures
2017-06-27 21:57:02 -05:00
Brian Ng
e4b35f680d
Run prettier 2017-06-27 12:15:00 -05:00
Henry Zhu
bd9e1860d0 for-of optimization on arrays/known functions that return arrays (#4747) 2017-06-26 16:47:39 -04:00
Peeyush Kushwaha
ee389384bc Update regenerator test relying on wrong semantics
Broken by fix to switch statements in block scoping
2017-05-25 13:51:13 +05:30
Steven Hargrove
d5aa6d3ff8 Fix for #4943 "Calling an async function with default parameter as function for arguments checking handled synchonous" (#5688)
* moved applying arguments inside new Promise handler block

* updated test fixture to reflect change

* corrected the apply to use correct scope and arguments

* added regression test for issue #4943, added async-to-generator/async-default-arguments test

* added regression test for issue #4943

* switched back to using arrow function, since now pointing to v7 release base branch

* simplified async-to-generator regression test for issue #4943, imrproved change to self/arguments refs by using arrow function on returned promise

* updated text fixtures

* removed es2015 preset usage from issue #4943 regression exec test

* added use strict to test fixture

* added use strict to test fixture

* added destructing transform to test options

* removed use strict from exec test

* added parameters & destructing transforms to test
2017-05-03 21:44:41 -07:00
Logan Smyth
d1d812edff Fix a regression from adding negation support in #5625. (#5641) 2017-04-17 18:13:37 -07:00
Logan Smyth
2b86d353d6 Restrict Babel's plugins/presets to a single target. (#5547) 2017-04-17 11:45:49 -07:00
Logan Smyth
c59e9f5f0e Merge pull request #5608 from loganfsmyth/config-cache
Cache configs based on mtime and allow .babelrc.js functions
2017-04-17 11:43:31 -07:00
Logan Smyth
1c078e5a76 Add tests for caching API and .babelrc.js functions. 2017-04-17 11:20:34 -07:00
Logan Smyth
ad250ef10a Merge pull request #5602 from loganfsmyth/option-manager-cleanup
Refactor OptionManager to be a short class with a bunch of pure helper functions.
2017-04-14 14:25:45 -07:00
Logan Smyth
d1c954b36f Allow negation of ignore and only patterns. (#5625) 2017-04-12 11:10:33 -07:00
Logan Smyth
d7e10a3adc Misc refactoring of OptionManager. 2017-04-10 10:01:01 -07:00
Logan Smyth
75847306fd Expose passes as a first-class output of OptionManager. 2017-04-10 10:01:01 -07:00
Logan Smyth
258e82ca13 Expose a function rather than a class from option-manager. 2017-04-10 10:01:01 -07:00
Logan Smyth
86fc4fbc4f Avoid using OptionManager statics 2017-04-10 10:01:01 -07:00
Andres Suarez
f0dc710a46 Remove unnecessary returns in asyncToGenerator helper (#5548)
* Remove unnecessary returns in asyncToGenerator helper

* Reuse "then" callbacks in asyncToGenerator helpher
2017-04-06 11:40:55 -04:00
Logan Smyth
d39400c9d5 Separate config/plugin loading from config processing. (#5563) 2017-04-04 14:48:48 -07:00
Logan Smyth
878a7c5fdb Add tests to test the plugin ordering. (#5571) 2017-03-31 18:52:58 -07:00
Henry Zhu
3d74dc044f fix ci 2017-03-27 17:26:39 -04:00
Henry Zhu
67253c5d27 babelrc false to relevant files 2017-03-27 17:19:02 -04:00
Kai Cataldo
1f2f63ccdf Fix: config lookup logic in babel-core (#5550)
This fixes a bug that was causing the config lookup to stop
when a package.json file was found even if it did not contain a
"babel" key.
2017-03-27 11:54:57 -07:00
Logan Smyth
3c63431c7e Move config loading helpers into config folder. 2017-03-17 00:03:59 -07:00
Logan Smyth
12a2124d16 Move the deeply nested option logic to a toplevel folder. 2017-03-17 00:03:58 -07:00
Logan Smyth
6c4810cea5 Move Plugin class to be part of config loading, independent of File. 2017-03-17 00:03:58 -07:00
Logan Smyth
bf13ed4da0 Limit where certain arguments are allowed in Babel config. 2017-03-17 00:03:58 -07:00
Logan Smyth
39c862c195 Make only/ignore relative to cwd/config file and move only/ignore checking all to core. (#5487)
* Make only/ignore relative to cwd/config file and move only/ignore checking all to core.
2017-03-16 23:22:43 -07:00
Logan Smyth
b6194a8533 Merge pull request #5467 from loganfsmyth/clean-options
Misc reorganizing and prep for ignore/only refactoring
2017-03-16 20:25:20 -07:00
Logan Smyth
dd1bc3b183 Resolve programmatic/CLI arguments from cwd, not file being compiled. (#5466) 2017-03-14 16:56:00 -07:00
Logan Smyth
bf4664b430 Invert the resolution order of config-chain to process higher-priority items first. 2017-03-14 13:39:57 -07:00
Logan Smyth
4f72232ca9 Move option parsing to babel-cli. 2017-03-13 11:06:46 -07:00
Logan Smyth
305165eda4 Remove Logger usage from options processing. 2017-03-09 16:13:38 -08:00
Kai Cataldo
d054cd0ea8 Add support for .babelrc.js files 2017-03-07 16:44:24 -05:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Daniel Tschinder
6d6cdf6baf [7.0] Allow presets to be objects (#5385)
* Allow presets to be objects

* Improve logic to detect preset format
2017-02-28 16:39:08 -05:00
Henry Zhu
d33d023594 Merge remote-tracking branch 'origin/master' into merge-master 2017-02-23 18:54:15 -05:00
Daniel Tschinder
87ca6150ae [7.0] Remove bc code from preset handling and preset-es2015 (#5128)
* Remove bc code from preset handling and preset-es2015

* Add more tests

* Only allow functions for presets

* Fix lint
2017-02-22 14:58:01 +01:00
Izaak Schroeder
8d9195f862 Pass dirname as extra metadata to preset constructor. (#4834)
* Pass `dirname` as extra metadata to preset constructor.

Sometimes a preset would like to know where it should resolve relative paths from (e.g. https://github.com/tleunen/babel-plugin-module-resolver) and this extra information makes that possible.

* Test for `dirname` passed into preset constructor

This adds a check for `dirname`’s existence and correctness to the
`resolve-addons-relative-to-file` test, and serves as a minimal example
of a path-aware preset.
2017-02-21 22:13:03 -05:00
Daniel Tschinder
6c03cb0783
Merge branch 'master' into merge-master
# Conflicts:
#	lerna.json
#	packages/babel-cli/package.json
#	packages/babel-core/package.json
#	packages/babel-generator/package.json
#	packages/babel-helper-builder-react-jsx/package.json
#	packages/babel-helper-function-name/package.json
#	packages/babel-helper-optimise-call-expression/package.json
#	packages/babel-helper-replace-supers/package.json
#	packages/babel-helper-transform-fixture-test-runner/package.json
#	packages/babel-helpers/package.json
#	packages/babel-plugin-transform-class-properties/package.json
#	packages/babel-plugin-transform-es2015-block-scoping/package.json
#	packages/babel-plugin-transform-es2015-classes/package.json
#	packages/babel-plugin-transform-es2015-modules-commonjs/package.json
#	packages/babel-plugin-transform-es2015-modules-systemjs/package.json
#	packages/babel-plugin-transform-es2015-modules-umd/package.json
#	packages/babel-plugin-transform-es2015-parameters/package.json
#	packages/babel-plugin-transform-react-jsx/package.json
#	packages/babel-register/package.json
#	packages/babel-template/package.json
#	packages/babel-traverse/package.json
#	packages/babel/package.json
2017-02-14 12:46:23 +01:00