Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent ignored files in out dir #10831

Merged
merged 5 commits into from Dec 18, 2019
Merged

Conversation

rajasekarm
Copy link
Member

@rajasekarm rajasekarm commented Dec 6, 2019

Q                       A
Fixed Issues? Fixes #6226
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

--ignore folder should not be present in out dir.

@nicolo-ribaudo nicolo-ribaudo added pkg: cli PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Dec 7, 2019
@JLHwung
Copy link
Contributor

JLHwung commented Dec 9, 2019

C.f. #10829 (comment)

but what if i try to copy the ignored files after this issue fixed?

I am afraid people could rely on this behaviour to copy ignored files. Since --copy-files is meant to copy files that will not be compiled and the ignored files meets the definition.

I propose to add an includeIgnoredFiles cli option so people can configure the behaviour.

@rajasekarm
Copy link
Member Author

That can be done, But I assume it should copy only the non supported format files and not the ignored one. Example css is non supported format, can be copied and required for the app to run. Test files are ignored and not copied and not required for the app to run.

@JLHwung
Copy link
Contributor

JLHwung commented Dec 12, 2019

@rajasekarm Given the behaviour has been existed since v7, I would prefer we add this behind a flag. And later we can change the defaults in v8, so that practically it will skip the ignore files when --copy-files is enabled.

@rajasekarm
Copy link
Member Author

Sure, I'll make the change. Thanks for your input @JLHwung.

@rajasekarm
Copy link
Member Author

@JLHwung Added the flag, I named it as includeIgnore.

@@ -161,6 +161,11 @@ commander.option(
"Delete the out directory before compilation.",
);

commander.option(
"--include-ignore",
"Include ignored files when compiling and copy to destination",
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we need to rephrase this help text?

@existentialism existentialism 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 Dec 17, 2019
Copy review.

Co-Authored-By: Brian Ng <bng412@gmail.com>
@@ -161,6 +161,11 @@ commander.option(
"Delete the out directory before compilation.",
);

commander.option(
"--include-ignore",
"Include ignored files when compiling and copying non-compilable files.",
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔I don't think ignored file will be compiled when --include-ignore is true, it is different than --include-dotfiles.

Personally I prefer --include-ignored than --include-ignore because ignore is a verb.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, we can drop the compiling bit.

Copy link
Member Author

Choose a reason for hiding this comment

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

@JLHwung , I'll make the the change for the flag. Is the below text ok for you? Just want to confirm before pushing the change.

Include ignored files and copying non-compilable files.

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like it is

Include ignored files when copying non-compilable files.

Copy link
Member Author

Choose a reason for hiding this comment

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

@JLHwung Done ✅

@existentialism existentialism merged commit 2b35909 into babel:master Dec 18, 2019
rajasekarm pushed a commit to rajasekarm/babel that referenced this pull request Dec 18, 2019
nicolo-ribaudo pushed a commit that referenced this pull request Dec 18, 2019
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 18, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2020
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: cli PR: New Feature 🚀 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

copy-files flag does not respect ignore block in .babelrc
4 participants