FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow using custom config in `babel-node --eval` by slatereax · Pull Request #16642 · babel/babel · GitHub

/ babel Public

Allow using custom config in babel-node --eval - #16642

Merged
nicolo-ribaudo merged 7 commits into
babel:mainfrom
slatereax:babel-node/fix-eval-custom-config
Jul 26, 2024
Merged

nicolo-ribaudo merged 7 commits into
babel:mainfrom
slatereax:babel-node/fix-eval-custom-config

Conversation

slatereax commented Jul 13, 2024
edited by JLHwung
Loading

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? Fixes #11877, fixes #16675
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Transform code for babel-node eval does not use the options that were passed in the cli flags. Also, replPlugin, which is used for code transformation, only allows var variables, although modern versions of node repl support let and const.

Based on the history of this file, it appears that this code was written in 2017 when node did not support any variables other than var, but there is no need for this check now. If anyone needs to use babel-node with node < 6.0.0, they can pass their configuration file through --config-file.

babel-bot commented Jul 13, 2024
edited
Loading

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57448

Comment thread packages/babel-node/src/_babel-node.ts Outdated
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
slatereax requested a review from JLHwung July 15, 2024 00:26
nicolo-ribaudo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: cli pkg: node and removed pkg: cli labels Jul 15, 2024

JLHwung left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks.

nicolo-ribaudo added PR: New Feature 🚀 A type of pull request used for our changelog categories and removed PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Jul 15, 2024
nicolo-ribaudo added this to the v7.25.0 milestone Jul 15, 2024

nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

nicolo-ribaudo added the PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release label Jul 17, 2024

JLHwung commented Jul 24, 2024

Copy link
Copy Markdown
Contributor

@slatereax
I realize that this PR does not add new tests, could you add two new tests to packages/babel-node/test/fixtures/cli ? One for #11877 and another one for #16675. You can check that folder to see how tests are constructed.

JLHwung self-requested a review July 24, 2024 20:49

Copy link
Copy Markdown
Member

@JLHwung I added two tests, please take a look!

JLHwung commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

@JLHwung I added two tests, please take a look!

Thanks, in #11877 we do load configs but they are not passed to the eval transform so the new tests are actually passing on the main branch. Can you add a simple plugin to manipulate the input source? So that we are sure the resolved config is applied.

Copy link
Copy Markdown
Member

Done!

nicolo-ribaudo changed the title Allow using custom config in babel-node eval and fix code transform Allow using custom config in babel-node --eval Jul 26, 2024
nicolo-ribaudo merged commit 0a26578 into babel:main Jul 26, 2024
github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 26, 2024
github-actions Bot locked as resolved and limited conversation to collaborators Oct 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: node PR: New Feature 🚀 A type of pull request used for our changelog categories PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release

Projects

None yet

4 participants


Back | FazBrowse Home | New Git URL