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

[clean] Support --include-filtered-dependencies flag #543

Merged
merged 1 commit into from
Jan 29, 2017

Conversation

roblg
Copy link
Contributor

@roblg roblg commented Jan 28, 2017

Sorry about the horkage in the CleanCommand test. I moved the existing tests into their own describe, which caused whitespace changes, which... you can see the results.

let curPkg = 1;
stub(FileSystemUtilities, "rimraf", (actualDir, callback) => {
const expectedDir = path.join(
testDir, "packages/package-" + curPkg, "node_modules"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if you used path.join here it'd fix the appveyor failures

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ I suspect it would. Good call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added path.join down around line 128. I also realized I oopsidentally checked in a describe.only, so I removed that too 😁

@roblg roblg force-pushed the clean-support-include-filtered branch from ffa4c69 to 8970c8f Compare January 28, 2017 04:30
Copy link
Contributor

@doug-wade doug-wade left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@evocateur evocateur left a comment

Choose a reason for hiding this comment

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

LGTM

import PromptUtilities from "../PromptUtilities";
import progressBar from "../progressBar";

export default class CleanCommand extends Command {
initialize(callback) {
this.packagesToClean = this.filteredPackages;
if (this.flags.includeFilteredDependencies) {
this.packagesToClean = PackageUtilities.addDependencies(this.packagesToClean, this.packageGraph);
Copy link
Member

Choose a reason for hiding this comment

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

I was about to ask why not just mutate this.filteredPackages in place, but then I realized this is a pattern used elsewhere and it makes it more readable to boot. 👓

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I mostly just blindly copied the pattern. I think if this were to be extended other commands in the future, it could make sense to pull the check up into Command.js, and modify the filteredPackages there, maybe? I haven't looked closely at that though.

@evocateur evocateur changed the title Fixes #540 - clean should support --include-filtered-dependencies [clean] Support --include-filtered-dependencies flag Jan 28, 2017
@evocateur
Copy link
Member

evocateur commented Jan 29, 2017 via email

@doug-wade doug-wade merged commit 63fa63b into lerna:master Jan 29, 2017
@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants