Sosuke Suzuki
ad693cc0a0
Update prettier to 2.3.1 ( #13460 )
2021-06-14 17:33:58 +02:00
Nicolò Ribaudo
f85c6437c5
Pass assumptions set in presets to plugins ( #13321 )
2021-05-17 22:00:01 +02:00
Nicolò Ribaudo
9d620c2d42
[babel 8] Move ESLint parsing to a Worker ( #13199 )
2021-05-17 17:04:10 +02:00
Sosuke Suzuki
b2d9156cc6
Update to Prettier 2.3 ( #13288 )
2021-05-10 15:34:13 +02:00
Huáng Jùnliàng
28d7442aae
Parse async do expressions ( #13043 )
...
* parse async do expressions
* add test cases
* update test fixtures
* chore: add syntax-async-do-expressions
* generater support
* fix: do not transform async do expressions
* chore: add asyncDoExpressions to missing plugin helpers
* update ast types
* add more test cases
* throw when asyncDoExpressions is enabled but not doExpressions
* avoid add parentheses for async do expressions
* address review comments
* chore: update parser typings
2021-04-28 18:26:01 +02:00
Chris West
d0fcbfccdd
perf(core): check files before interacting with them ( #13090 )
...
* perf(core): check files before interacting with them
* refactor: inline fs.exists.sync -> nodeFs.existsSync
2021-04-28 00:41:18 +02:00
Huáng Jùnliàng
88da2e80ed
perf: avoid loadFullConfig when creating block hoist plugin ( #13223 )
...
* perf: avoid loadFullConfig when creating block hoist plugin
* address code review comments
2021-04-27 14:39:18 -04:00
Micha Reiser
adb5adac0c
fix: Don't load browserslist in block-hoist-plugin ( #13182 )
...
* fix: Don't load browserslist in block-hoist-plugin
* Remove test case
* Remove added new line
2021-04-21 09:20:17 -04:00
Bogdan Savluk
a647b9ea6b
Convert @babel/core to TypeScript ( #12929 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-03-30 19:51:35 +02:00
Bogdan Savluk
c8a91d9eef
Rename @babel/core files to .ts ( #12929 )
2021-03-30 19:51:35 +02:00
Nicolò Ribaudo
06eb3b73cb
Only resolve package.json when relative configs are enabled ( #13063 )
2021-03-28 12:04:42 +02:00
Nicolò Ribaudo
8e8954b470
[babel 8] Remove module-specific options from @babel/core ( #12724 )
2021-03-28 01:27:37 +01:00
Henry Zhu
6b39bafab6
Remove lodash deps ( #13057 )
...
* inline escapeRegExp instead of using any dep
* inline camelCase
* replace merge with object spread
* copy if array instead of using clone
* inline isRegExp
* review fixes!
* remove escape-string-regexp from package.json and in test
* add error for field defaults that are not primitives or empty arrays
* replace merge with object spread
* yarn
2021-03-27 17:59:34 +01:00
Nicolò Ribaudo
e68f2ce195
Correctly handle relative browserslistConfigFile paths ( #13031 )
...
* Correctly handle relative `browserslistConfigFile`
* Fix flow
2021-03-26 15:07:28 -04:00
Nicolò Ribaudo
b0d83daceb
Resolve .browserslistrc as a project-wide file ( #13028 )
2021-03-25 21:37:42 +01:00
Justin Ridgewell
327b4cec49
Remove lodash sortBy use ( #13021 )
2021-03-25 18:56:18 +01:00
Justin Ridgewell
73dcd06293
Remove some lodash/cloneDeep calls ( #13032 )
2021-03-25 18:01:19 +01:00
Nicolò Ribaudo
564ca6638f
Set rootMode: "root" in loadPartialConfig ( #13040 )
2021-03-23 20:11:10 +01:00
Huáng Jùnliàng
b784c81aeb
Do not bail on SHOW_CONFIG_FOR matches ( #12954 )
...
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
2021-03-23 20:02:07 +01:00
Nicolò Ribaudo
d04842a700
Avoid using CJS globals in internal source files ( #12963 )
...
* Lint against CJS globals in modules
* Use `import.meta.url` instead of `__filename` in `src` files
* Prepare fixtures runner for `import.meta.url`
* Use `import.meta.url` instead of `__filename` in `test/index` files
* Remove `__dirname` from remaining test files
dirname
* Avoid using `module` in `src` files
* Avoid using `require` in `src` files
* Avoid using `require` in `test` files
* Update `@types/node`
* Compile dynamic import in `@babel/node`
* Fix windows
* Use `@babel/plugin-proposal-dynamic-import` from npm
2021-03-05 19:55:36 +01:00
Nicolò Ribaudo
b17231e1af
[internal] Keep the .cjs extension when compiling source files ( #12820 )
...
* [internal] Keep the .cjs extension when compiling
* yarn
2021-02-25 18:03:05 +01:00
Nicolò Ribaudo
5861704361
Export function versions of createConfigItem ( #12852 )
2021-02-23 02:01:39 +01:00
Julian Grinblat
d1d6ee6dc2
Add cjs as a default extension ( #11498 )
2021-02-21 17:56:15 +01:00
Nicolò Ribaudo
6ef7b51a11
Implement assumptions defined in the babel/rfcs#5 RFC
...
- `mutableTemplateObject` and `ignoreToPrimitiveHint` (#12408 )
- `setClassMethods` (#12407 )
- `setComputedProperties` (#12490 )
- `ignoreFunctionLength` (#12491 )
- `noDocumentAll` (#12481 )
- `iterableIsArray` and `arrayLikeIsIterable` (#12489 )
- `pureGetters` (#12504 )
- `skipForOfIteratorClosing` (#12496 )
- `objectRestNoSymbols`, `setSpreadProperties` and `pureGetters` (#12505 )
- `noNewArrows` (#12613 , #12793 )
- `setPublicClassFields` and `privateFieldsAsProperties` (#12497 )
- `constantReexports` and `enumerableModuleMeta` (#12618 )
- `constantSuper`, `superIsCallableConstructor` and `noClassCalls` (#12726 )
Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Huáng Jùnliàng <JLHwung@users.noreply.github.com>
2021-02-21 17:09:45 +01:00
Nicolò Ribaudo
7965c15557
Add @babel/core support for the new assumptions option ( #12219 )
...
- Disallow setting assumptions to `false` in presets (#12498 )
2021-02-21 17:09:45 +01:00
Nicolò Ribaudo
cb404e4776
Add targets and browserslist* options to @babel/core ( #12189 )
2021-02-21 17:09:43 +01:00
Nicolò Ribaudo
31ca15ef58
Support .mjs plugins/presets and async factories ( #12266 )
2021-02-21 17:08:30 +01:00
Devon Govett
35c41148dd
Do not cache non-existent JS config files forever ( #12211 )
...
Missed a spot in #11906 . Currently if you don't have a JS config file and then add one to your project, it will not be picked up without restarting the process. Changing from caching forever to never caching when files don't exist fixes the issue.
2021-02-18 12:18:02 +01:00
Nicolò Ribaudo
e735266dee
Avoid importing .json files ( #12759 )
...
* Avoid importing `.json` files
* Use ESold in babel.config.json
* Use `import/extensions` eslint plugin
2021-02-05 23:34:36 +01:00
Nicolò Ribaudo
4f2d47500f
Don't use require() in ESM files ( #12728 )
...
* Update `yarn-plugin-conditions`
* Don't use `require()` in ESM files
2021-02-01 17:09:02 +01:00
Henry Zhu
464a02ffe1
[babel 8] Replace lodash/escapeRegExp with escape-string-regexp ( #12677 )
...
Co-authored-by: James Addison <jay@jp-hosting.net>
2021-01-23 22:21:34 +01:00
Nicolò Ribaudo
208acb1d6c
Use require.resolve instead of the resolve package ( #12439 )
2020-12-04 08:57:09 +01:00
Jason Miller
ddd868f838
Account for ConfigItem being generated by another copy of Babel ( #11734 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-11-10 15:02:46 +01:00
Nicolò Ribaudo
31396b286d
Make loadPartialConfig's options optional ( #12200 )
2020-10-16 15:46:49 +02:00
Sven Sauleau
af8e0facc1
Parse import-assertions ( #12139 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-10-14 21:18:16 +02:00
Huáng Jùnliàng
f697e7995d
Transform class static block ( #12143 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 21:16:24 +02:00
Huáng Jùnliàng
21d7ee2610
String import/export specifier ( #12091 )
...
* feat: parse moduleExportName
* feat: add validators
* Support string specifier name in commonjs transform
* Support string specifier name in export-ns-from
* test: add loose testcases
* test: add testcases for amd and umd
* feat: support systemjs
* test: update fixtures fixed in #12110
* add plugin name typings
* test: rename test layout
* feat: implement under moduleStringNames flag
* chore: add plugin syntax module string names
* feat: support ModuleExportName as ModuleExportName
* test: update test fixtures
* fix flow errors
* docs: update AST spec
* feat: support { "some imports" as "some exports" }
* feat: support { "some imports" as "some exports" } in systemjs
* test: add test on `import { "foo" }`
* Address review comments
* add moduleStringNames to missing plugin helpers
* Apply suggestions from code review
* update test fixtures
* Update packages/babel-parser/src/parser/error-message.js
* update test fixtures
Co-Authored-By: Kai Cataldo <kai@kaicataldo.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 20:01:37 +02:00
Nicolò Ribaudo
1b90d90fcc
Instantiate presets before plugins ( #11689 )
2020-10-14 19:59:02 +02:00
Devon Govett
ce7b170ab7
Return a list of files that were read from loadPartialConfig ( #11907 )
2020-10-14 19:59:02 +02:00
Tim Gates
1334bc99e0
docs: Fix simple typo, preprelease -> pre-release ( #12102 )
...
There is a small typo in packages/babel-core/src/transformation/file/file.js, packages/babel-plugin-transform-runtime/src/helpers.js.
Should read `pre-release` rather than `preprelease`.
2020-09-23 16:06:21 -04:00
Devon Govett
c29138fd72
Do not cache non-existent files forever ( #11906 )
2020-08-04 16:07:25 -04:00
Huáng Jùnliàng
164a93945d
add showConfig support ( #11588 )
...
* draft: showConfig support
* feat: pass through showConfig command options
* update test file
* refactor: add createLogger to makeChainWalker
* serializing dynamic plugin instance
* fix flow errors
* chore: add tests on extended config
* fix: do not print empty presets
* add more test cases
* add windows testcases
* address review comments
* throw error when showConfigPath does not exist
* print reason when showConfig is targetting an ignored file
* remove showConfig: boolean
* refactor: simplify environment flag name
* rename test fixtures
* fix: throw when SHOW_CONFIG_FOR is not a regular file
* cleanup test fixtures
* add test on only
* Update packages/babel-core/src/config/files/configuration.js
Co-authored-by: Brian Ng <bng412@gmail.com>
* address review comments
* update test fixtures
* feat: sort config items in ascending priority
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-30 09:24:19 -04:00
Vahagn Aharonian
b651a6f6ab
Enable logical assignment by default in @babel/parser ( #11860 ) ( #11869 )
2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
059e9124ff
Add decimal parsing support ( #11640 )
...
* docs: add DecimalLiteral to AST spec
* add decimal support
* fix: throw invalid decimal on start
* add DecimalLiteral type definitions
* update parser typings
* add generator support
* add syntax-decimal plugin
* Add syntax-decimal to babel-standalone
* add syntax-decimal to missing plugin helpers
* fix incorrect test macro
2020-07-29 16:43:15 -04:00
coderaiser
cf425a0bde
feature: babel-core: add cloneInputAst ( #10241 )
...
Co-authored-by: coderaiser <coderaiser@cloudcmd.io>
2020-07-29 16:40:02 -04:00
Huáng Jùnliàng
8f191ead92
chore: fix typo in codebase ( #11846 )
2020-07-16 16:01:20 -05:00
Wojciech Maj
1dd94e813e
Replace non-inclusive "whitelist" and "blacklist" terms with "allowlist" etc. ( #11758 )
2020-06-29 15:39:38 -04:00
Huáng Jùnliàng
601c824873
Refine babel core types ( #11544 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-06-21 22:04:12 +02:00
Bogdan Savluk
4108524856
Update prettier to v2 ( #11579 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-06-07 22:21:33 +02:00
Huáng Jùnliàng
6b7a6dccd2
fix: add new plugin names to missing plugin helpers ( #11643 )
2020-05-29 14:04:47 -04:00