146 Commits

Author SHA1 Message Date
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
98aa72ca74
Use native Node.js functions when available (#12458) 2020-12-09 00:03:47 +01:00
Filipp Riabchun
2b13863680
Fix Node version check (#12382)
`process.version` always starts with `v`, so `parseInt(process.version)` always evaluates to `NaN`. See https://nodejs.org/api/process.html#process_process_version
2020-11-23 09:00:50 -05:00
Nicolò Ribaudo
b877726a89
Don't force chokidar@2 to be downloaded from registry.npmjs.org (#12182) 2020-10-16 00:30:20 +02:00
James Addison
94b5f92e39
Replace lodash 'defaults' usage with ES6 Spread initializer (#11797)
Co-authored-by: Corey Farrell <git@cfware.com>
2020-10-14 20:10:44 +02:00
Huáng Jùnliàng
769669f6f8
hack: use chokidar@2 only on node < 8 (#11560) 2020-10-05 18:24:27 +02:00
James Addison
3e55270135
Reduce dependency on lodash functions: includes, uniq, repeat, isinteger (#11790)
* Replace lodash 'includes' usage with Array.prototype.includes

* Replace lodash 'values' usage with Object.values

* Replace lodash 'uniq' usage with Array.from(new Set(...))

* Property safety: ensure that ignoreSuites/ignoreTasks are populated prior to access

* Property safety: ensure that blacklistTypes is populated prior to access

* Revert "Replace lodash 'values' usage with Object.values"

This reverts commit 9fd3679d6db03066daee09fad0050e5292a32aa1.

* Replace lodash 'repeat' usage with String.prototype.repeat

* Replace lodash 'isinteger' usage with Number.isInteger

* Remove explicit lodash dependency from babel-generator package

* Update packages/babel-helper-transform-fixture-test-runner/src/index.js

Co-authored-by: Brian Ng <bng412@gmail.com>

* Rely on optional chaining operator as sole boolean check

* Handle additional optional chaining operator simplification

* Update type signature

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-06 09:27:41 +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
Nicolò Ribaudo
698fe8ef50
Log after subsequent compilations in --watch mode (#11220) 2020-05-24 23:03:22 +02:00
Nicolò Ribaudo
92c6807ae8
[@babel/cli] Copy ignored files by default (#11063)
This commit restores the pre-7.8.0 behavior of the --copy-files option, by making
--copy-ignored default to true when --copy-files is enabled.
2020-01-30 13:01:04 +01:00
Raja Sekar
8415065d99 --copy-ignored flag added to CLI (#10887)
* prevent ignored files in out dir

* added includeIgnore cli option

* Help text change

* Update packages/babel-cli/src/babel/options.js

Copy review.

Co-Authored-By: Brian Ng <bng412@gmail.com>

* review comments

* throw error if copyIgnored is used without ignore flag

* check for ignored files

* duplicate pathToPattern fn in babel/cli

* change implementation

* removed ignore option from cliOption

* added test case with ignore in config

* added test case with ignore in config

* review

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-01-10 03:03:37 +01:00
Sebastian Silbermann
3af02f63de Add --out-file-extension option to babel-cli (#9144)
* Add --use-file-extension option to babel-cli

* refactor file extension logic

use existing methods from path module

* Rename use-file-extension -> out-file-extension

* add error message if bot keep- and out-file-extension is used

* add test for error when mixing --keep- and --out-file-extension

* poke travis
2020-01-10 03:02:52 +01:00
Huáng Jùnliàng
db3c31a8af fix: minified should not accept optional argument (#10923) 2019-12-25 19:13:23 +01:00
Raja Sekar
dbf3f91f1e Revert "Prevent ignored files in out dir (#10831)" (#10886)
This reverts commit 2b3590929b4eb955b0e8b287f9749b5af66cc1a0.
2019-12-18 11:17:35 +01:00
Raja Sekar
2b3590929b Prevent ignored files in out dir (#10831)
Co-Authored-By: Brian Ng <bng412@gmail.com>
2019-12-17 21:39:36 -06:00
Huáng Jùnliàng
c9a68984d6 babel --watch should have equivalent file selection logic with babel (#10283)
* fix(watcher): skip non-compilable file only when it is not included in filenames argument

* perf: disable globbing for watch
2019-12-05 08:28:52 +01:00
ZYSzys
1d1101eb7c Add missing flow type to babel-cli for consistency (#10692) 2019-11-13 17:39:19 +01:00
Huáng Jùnliàng
7633f09479 Babel should not silently remove unknown options after command… (#10698)
* chore: add test case

* chore: bump commander to 4.0.1

* fix: let commander.js throw on unknown options after args
2019-11-13 00:25:24 +01:00
Mohammad Ahmadi
8e5f2dc929 corrected the grammar of an option description (#10691)
* grammar correction of an option description

(missed in #10589)

* changed description to be consistent with others

Co-Authored-By: Huáng Jùnliàng <jlhwung@gmail.com>

* ran prettier
2019-11-11 12:39:36 +03:00
Mohammad Ahmadi
58a646be59 corrected the grammar of option descriptions (#10589)
* corrected the grammar of option descriptions

* added comment
2019-11-04 00:24:00 +01:00
Huáng Jùnliàng
a2b5437b01 chore: remove output-file-sync dependency (#10619) 2019-10-31 11:51:36 -07:00
Bogdan Chadkin
be0fcaaf49 Make dir for babel --out-file (#8622)
* Make dir for babel --out-file

Currently there's unexpected regression after upgrade from babel 6.
On creating file with any depth like dist/index.js the error about
not existing directory is thrown.

In this diff I modified babel-cli to create deep directory for out-file
command.

I also replaced `mkdirp` with more supported `make-dir` package which
also have official promise support.

* Fix test
2019-10-29 18:29:45 +01:00
彭驰
4e5ac1fd5c Fix #8326, add back --quiet option. (#10399)
* Fix issue #8326, quiet the @babel/cli with --quiet cli option.

* --quiet and --verbose options now conflict with each other.
2019-10-29 18:28:52 +01:00
Huáng Jùnliàng
53af9e8b7a fix: allow the process to exit naturally (#10400) 2019-09-11 12:24:44 +02:00
Huáng Jùnliàng
f08062b1de chore: fix ESLint errors (#10278) 2019-07-29 10:14:11 -05:00
Letladi Sebesho
4d12c8971b added flow to babel cli (#10244)
* added flow to babel cli

* added 'SourceMapGenerator' as a argument to 'fromObject'
2019-07-25 09:59:41 +02:00
cphamlet
116ca22def Minor typo for -f flag in cli (#9201) 2018-12-17 19:29:23 -08:00
Veaceslav Cotruta
2bf8dde782 Propagates the extensions overrides provided by CLI during files walk (#8668)
* Propagates the extensions overrides provided by CLI during files walk

* Adds tests for issue #7620, PR #8668
2018-11-29 18:57:27 -08:00
0xflotus
9d0dcedb2b fixed "source map" formatting in comment (#8878) [skip ci] 2018-10-20 00:51:46 +02:00
Logan Smyth
3b0f9a9f1e
Delete undefined options so we handle old core versions with new CLI versions. (#8728) 2018-09-19 08:56:40 -07: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
7273cf8fe5 Fix a linting error. 2018-09-07 16:09:25 -07:00
Aaron Ang
dad55ef1d6 Test babel-cli --source-maps and errors (#5377) 2018-09-07 15:30:24 -07:00
Logan Smyth
90bebe7186 Pass the caller.name option in Babel's own callers. 2018-08-20 10:27:54 -07:00
Jan Schmidle
cb51704745 Babel cli fix recursion in file mode (#8418)
* added test case

* remove unnessecary parameter

* check for type directory as well in readRecursive filter
2018-08-03 09:06:27 -07:00
John Buffington
236bd9309c remove emojis from cli output (#8243) (#8250) 2018-07-02 09:34:55 +02:00
Soumya Himanish Mohapatra
cb79473499 remove regression to support output of full directory hierarchy with --out-dir (#8189)
* remove regression to support output of full directory hierarchy with --out-dir

* add mkdirp to package.json
2018-06-18 21:19:46 -07:00
Logan Smyth
21b9b2e42d
Avoid a race condition in CLI directory creation. (#8082) 2018-05-30 10:35:08 -07:00
Logan Smyth
8ff675ad69 Refactor CLI to use promises/async fns. 2018-05-14 23:07:50 -07:00
Logan Smyth
41ca312545 Define a clear separation between Babel and CLI options. 2018-05-14 22:03:47 -07:00
Logan Smyth
df1afa3160 Fix watch bug with output-dir paths. (#7875) 2018-05-13 08:54:04 -05:00
Justin Ridgewell
2afe9404fe
Use Object Spread Syntax (#7777)
* Use Object Spread Syntax

* Nits
2018-04-23 21:44:27 -04:00
Logan Smyth
485e37fcb0 Support a babel.config.fs file in a 'root' directory. 2018-04-20 17:00:53 -07:00
Daniel Tschinder
f0d681a238 Remove obsolete max-len eslint rule and reformat some stuff to fit (#7602) 2018-03-20 08:51:47 -05:00
Logan Smyth
b5e6536f26
Remove the sourceMapTarget option from core and implement it in babel-cli. (#7500) 2018-03-09 14:14:25 -08:00
Raja Sekar
50b9fbb570 empty src dir error fix - fixes #7375 2018-03-05 17:46:38 -08:00
Logan Smyth
212058148c
Require users to pass a filename, or specify --no-babelrc when using CLI with stdin. (#7461) 2018-03-03 12:29:11 -08:00
Michał Pierzchała
cc6e739f15 Add a brief summary to CLI's build output (#7439)
* feat(babel-cli): add a brief summary to build output

* address feedback

* further adjustments

* Use quiet output as default, add --verbose

* fix tests

* remove verbose alias
2018-03-03 13:29:26 +01:00
Vojtěch Štěpančík
88a0f52230 Fix CLI compilation callback calling (#7366) 2018-02-12 08:10:35 -05:00
Tauyekel Kunzhol
2254ed45d2 [Bug fix] Reaching maximum calls stack when copying large number of non-js files in babel-cli (#7320)
Maximum call stack occurs when you try to copy large number of non-js files using `babel-cli@7.0.0-beta.38` or `babel-cli@7.0.0-beta.39`
2018-02-02 20:56:57 -08:00