Nicolò Ribaudo
114f6726a7
Pass URLs to import() rather than paths ( #11193 )
...
* Pass URLs to import() rather than paths
* Make tests pass
* (╯°□°)╯︵ ┻━┻
* (╯°□°)╯︵ ┻━┻ (╯°□°)╯︵ ┻━┻ (╯°□°)╯︵ ┻━┻
2020-03-03 19:54:01 +01:00
Huáng Jùnliàng
0b3dea8f54
Turn on no-fallthrough rule ( #11093 )
...
* chore: turn on no-fallthrough
* chore: fix no-fallthrough errors
2020-02-07 22:05:19 +01:00
Huáng Jùnliàng
fa975bf7cd
polish: throw human-friendly error when item-option pair is in… ( #10969 )
...
* polish: throw human-friendly error when item-option pair is incorrectly unwrapped
* add testcase for plugin
* fix: exclude false positive
* fix: validate should support plugin optionsSourceKind
* Revert "fix: validate should support plugin optionsSourceKind"
* fix: validate plugin object in assertNoUnwrappedItemOptionPairs
* fix flow error
* update test fixtures
* refactor: move to loadDescriptor catch clause
* chore: throw Error instead of builtin ReferenceError
* fix flow errors
* chore: add more test cases
2020-01-20 21:05:07 +01:00
Yordis Prieto
4c28f54152
Add babelrc.json support ( #10783 )
...
* Add babelrc.json support
* Add tests
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-01-10 23:41:42 +01:00
Nicolò Ribaudo
ae06baf22f
Add support for babel.config.mjs and .babelrc.mjs ( #10903 )
...
* Add support for babel.config.mjs and .babelrc.mjs
* Use path.extname
2020-01-10 23:14:29 +01:00
Nicolò Ribaudo
282f81bd67
Prepare @babel/core for asynchronicity ( #10507 )
...
* Prepare @babel/core for asynchronicity
* Include regenerator-runtime in standalone build
* Fix rollup build
2020-01-10 22:44:13 +01:00
Jaroslav Kubíček
26c0a32c7c
refactor: Improve error message in @babel/core when root config is not found ( #10778 )
2019-12-01 00:07:05 +01:00
Nicolò Ribaudo
bea1b0d0af
Add support for .cjs config files ( #10599 )
...
* Remove duplicate config loading logic and errors
* Add support for .cjs config files
* Add tests
* [tests] Fallback for fs.promises on node 6
2019-11-04 00:24:44 +01:00
Devon Govett
3a5e8a8dd4
Add support for babel.config.json ( #10501 )
...
* Add support for babel.config.json root config
* Throw if multiple configuration files are found
* Add tests
2019-10-29 19:37:50 +01:00
David J. Hamilton
fa5a40c8d5
assertNoDuplicates throw with more context ( #10419 )
...
When users see errors like
```
Duplicate plugin/preset detected.
If you'd like to use two separate instances of a plugin,
they need separate names, e.g.
plugins: [
['some-plugin', {}],
['some-plugin', {}, 'some unique name'],
]
```
It can be difficult to determine the source of the conflict, especially
in a larger build system.
This commit outputs what is known about the plugins that actually
conflict, which can be helpful for users to determine the root cause of
the conflict.
Partially addresses #9778
2019-10-02 16:45:03 +02:00
Huáng Jùnliàng
af04f40ee0
fix: pass optionLoc when validating plugin object ( #10402 )
2019-09-11 12:23:20 +02:00
Huáng Jùnliàng
8da9d8b4b8
feat(errors): validate preset when filename is absent ( #10181 )
...
* feat(errors): validate preset when filename is absent
Closes #10154
* fix: test overrides for filename compulsory
* docs: rewrite validate error message
per https://github.com/babel/babel/pull/10181#discussion_r301607986
* polish error message
2019-09-06 18:09:19 +02:00
Daniel Tschinder
4f0840ab88
Update dev dependencies and fix linting errors ( #10228 )
...
* chore: Uppate dev dependencies
* chore: Fix lint errors
* chore: Format options.json files
* chore: Fix stupid flow errors
* Update test262 whitelist
Seems test262-stream was updated and now these tests work.
2019-07-27 15:09:30 +02:00
Sebastian Johansson
595a349174
Fix incorrect usage of $o instead of %o in debug ( #10157 )
...
It would end up printing the literal "$o" instead of the directory name.
2019-07-03 16:04:31 +02:00
Min ho Kim
0bf0ae3410
Fix typos ( #10153 )
2019-07-03 15:51:48 +02:00
Divyam Bhasin
7942dc0f07
Fixed null error in plugin opts and added a test for it ( #9945 )
...
* Fixed null error in plugin opts and added a test for it
* Remove !opts and add opts === null check to avoid confusion with false and undefined cases
Co-Authored-By: divbhasin <divbest99@gmail.com>
2019-05-07 16:23:01 +02:00
Pablo Navarro
16e17c560b
Add missing space in error messages ( #9909 )
2019-04-29 19:52:13 +02:00
Daniel Tschinder
7943a48cc3
Update flow to 0.92.1 and fix related issues ( #9468 )
...
* Update flow to 0.92.1 and fix related issues
* Change isThenable check
2019-02-08 13:27:11 -08:00
Daniel Tschinder
4ca35ef8b9
Fix running flow on travis and update flow ( #9128 )
...
* Fix running flow on travis and update flow
- ensure bootstrap is run before running flow as we need some generated files for correctly doing typechecks
- ensure that we only ignore the build directory inside the babel folder as currently we ignore everything because travis checks out into ‘/home/travis/build/’
* Fix all flow errors
2018-12-05 12:30:30 -08:00
Kai Cataldo
806e133473
Export @babel/parser#tokTypes in @babel/core ( #8986 )
...
* Export @babel/parser in @babel/core
* Expose tokTypes instead of parser
2018-11-30 18:41:58 -08:00
Logan Smyth
20a9d71016
Normalize presets before merging config with others. ( #9034 )
2018-11-16 21:23:23 -08:00
Logan Smyth
c6d2f45cab
Resolve babel.config.js 'babelrcRoots' values relative to the config file. ( #8910 )
2018-11-05 08:51:27 -08:00
everdimension
e85faec47d
Fix message when plugin of a wrong type is passed ( #8950 )
2018-10-31 14:34:26 -05:00
Logan Smyth
bd0c62dc0c
Allow users to choose how the configuration root is selected. ( #8660 )
2018-09-15 13:03:46 -07:00
Logan Smyth
dd985c3be3
Verify 'sourceMap' with hasOwnProperty since it can be falsy.
2018-09-03 12:22:22 -07:00
Logan Smyth
2921f6cdb1
Pass missing caller metadata for .babelrc files. ( #8601 )
2018-09-01 15:46:38 -07:00
tsangint
e875fc7bc1
Update url in buildUnknownError tips ( #8544 )
2018-08-26 15:00:32 +02:00
Logan Smyth
8d6ed7e0aa
Expose an api.caller(...) handler for presets to access caller metadata.
2018-08-20 10:27:54 -07:00
Logan Smyth
8f4bae8ea4
Expose optional caller metadata to Babel ignore/only/test/include/exclude functions.
2018-08-20 10:27:54 -07:00
Logan Smyth
2c3c12fdf7
Enforce a limited set of cache key values for plugins/presets for future caching.
2018-08-20 10:12:19 -07:00
Logan Smyth
25d2f59018
Ensure that presets properly flatten their options.
2018-08-20 10:12:19 -07:00
Logan Smyth
3a399d1eb9
Cache individual programmatic descriptors along with the overall list. ( #8494 )
2018-08-20 10:08:21 -07:00
Logan Smyth
c2a2e24965
Take top-level config source into consideration when processing nested env/overrides. ( #8493 )
2018-08-19 21:46:09 -07:00
Logan Smyth
ca639b4262
Preserve 'false'-options for disabled plugins/presets so that callers can use that to toggle behavior. ( #8474 )
2018-08-19 16:22:27 -07:00
Logan Smyth
ffa8e6cbae
Allow babel-plugin/preset to be in package names outside the prefix, when used in a scope. ( #8473 )
2018-08-16 15:13:52 -07:00
wtgtybhertgeghgtwtg
4346a95b88
Perform check on each member of babelrcroots.
2018-07-24 16:57:24 -07:00
Logan Smyth
6d177ba4c5
Remove micromatch and use a simple pattern matching utility.
2018-07-16 09:57:14 -07:00
Logan Smyth
fd9ebf9e1d
Remove option-filtering options from the final options results. ( #8315 )
...
| Q | A <!--(Can use an emoji 👍 ) -->
| ------------------------ | ---
| Fixed Issues? | Fixes https://github.com/babel/babel-loader/issues/642
| Patch: Bug Fix? | Y
| Major: Breaking Change? | N
| Minor: New Feature? |
| Tests Added + Pass? | Yes
| Documentation PR Link | <!-- If only readme change, add `[skip ci]` to your commits -->
| Any Dependency Changes? |
| License | MIT
Since these were getting left in, things that loaded the config, and then passed in back to Babel would get `test` and such _twice_, which could lead to either bad configuration merging, or no configuration at all if the patterns were relative to different directories, as was the case in https://github.com/babel/babel-loader/issues/642 .
2018-07-13 07:01:11 -07:00
dnalborczyk
db1385fb82
upgrades eslint v5 (major), babel-eslint, eslint-plugin-flowtype, eslint-plugin-prettier ( #8259 )
...
* upgrade eslint v5 (major), babel-eslint (minor), eslint-plugin-flowtype (minor), eslint-plugin-prettier (patch)
* fix makefile: remove (default) .js file extension, remove non-existing glob pattern
* fix linting errors
* add '*.js' glob back to include babel.config.js for linting
2018-07-05 09:17:01 -05:00
Logan Smyth
add5f8d0fe
Allow @foo/babel-plugin as an unexpanded plugin name, and @foo as a shorthand for it.
2018-06-18 21:36:02 -07:00
Brian Ng
5895277b32
Bump prettier to v1.13.2
2018-06-03 07:54:39 -05:00
Brian Ng
f699f1bbbf
flow@0.73.0 ( #8032 )
2018-05-25 16:53:23 -05:00
Logan Smyth
53e4d74ebe
Treat all filenames as absolute paths. ( #8044 )
2018-05-24 20:56:19 -07:00
Logan Smyth
6f3093b557
Track the sync and async implementations in the same files.
2018-05-23 21:18:15 -07:00
Logan Smyth
ca1c98b255
Allow .overrides and .env inside presets.
2018-05-21 18:23:07 -07:00
Logan Smyth
69cca412eb
Make the filename option, as exposed to the plugins, consistently relative to the working directory ( #7956 )
...
| Q | A <!--(Can use an emoji 👍 ) -->
| ------------------------ | ---
| Fixed Issues? |
| Patch: Bug Fix? | Y
| Major: Breaking Change? | N
| Minor: New Feature? |
| Tests Added + Pass? | Yes
| Documentation PR | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes? |
| License | MIT
Currently the `opts.filename` value exposed to plugins is just whatever the user passed. While it _could_ be relative to the working directory, if Babel was passed an absolute URL, it'll be absolute.
This PR explicitly ensures the filename is a relative path based on the working directory. This also exposes an officially endorsed API for reading the working directory path.
2018-05-21 17:10:57 -07:00
Mike Nason
3bee37b14d
fix typo in error message ( #7995 )
2018-05-21 12:18:09 -07:00
Logan Smyth
98f0808a22
Ensure the the config file isn't re-processed when users load a partial config and then pass it back to Babel.
2018-05-11 17:49:12 -07:00
Logan Smyth
bdcfb697a6
Use 'babelrc' and 'babelrcRoots' from config file, if not specified.
2018-05-11 17:49:11 -07:00
Logan Smyth
0341d299c8
Validate different file types with different rules.
2018-05-11 16:51:43 -07:00