* 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>
* 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>
* 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
* 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
For some reason, it looks like that the rimraf call didn't properly delete
the folder:
EEXIST: file already exists, mkdir 'C:\Users\travis\build\babel\babel\packages\babel-node\test\tmp'
150 | process.chdir(__dirname);
151 | if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc);
> 152 | fs.mkdirSync(tmpLoc);
| ^
153 | process.chdir(tmpLoc);
154 | };
Lets try to reuse the existing folder rather than deleting and recreating it
* Add windows to travis
* Update
* Do not use sh file on windows
* Fix whitespace
* Unify command
* ./ doesn't work on windows
* Remove all ./ usages
* Run windows test before others
* fix: normalize filename when generating sources
sources should be URL.
* fix: replace normalized path to cwd
* chore: add nodePlatform task options
* fix: normalize preset-env filename output
* chore: replace normalized path to CWD on win32 platform
* limit transform-react-source to run on linux and darwin
* test: escapeRegExp on testcases
* test: add test for babel --filename on windows
* test: double babel-node/cli test timeout
* chore: workaround windows build does not stop
* chore: remove redundant condition
* refactor: rename `nodePlatform` to `os`
* Add sourcemap examples for identifiers in code generator.
* Generate sourcemaps with exact mappings for identifiers, even if leading/trailing tokens also use that location.
<!--
Before making a PR please make sure to read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md
For any issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR
-->
| Q | A <!--(yes/no) -->
| ------------------------ | ---
| Patch: Bug Fix? |
| Major: Breaking Change? |
| Minor: New Feature? | y
| Deprecations? |
| Spec Compliancy? |
| Tests Added/Pass? | y/y
| Fixed Tickets | #5616
| License | MIT
| Doc PR | <!-- if yes, add `[skip ci]` to your commit message to skip CI builds -->
| Dependency Changes |
<!-- Describe your changes below in as much detail as possible -->
Once merged I will make the corresponding documentation changes on the website (in a 7 branch)
| 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.
* 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
* Remove babel-node from babel-cli
* Use new Array instead of Array for V8 optimization
* Remove extraneous use strict clauses
* Require babel-node in babel-cli
* Remove babel-node from babel-cli
* Require babel-node in babel-cli
* Remove babel-node executable from babel-cli
* Clean up babel-node from package.json
* Add --keep-module-extension option to babel-cli
* Rename keep-module-extension option to keep-file-extension; Change option to preserve all file extensions
* Fix output directory if filename is given
* Add test for relative output path
* Add option to define output dir relative to input
* Add tests for --copy-files
* Test error handling for wrong arguments
* 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