Skip to content

Add lerna clean command - #196

Merged
jamiebuilds merged 3 commits into
lerna:masterfrom
gigabo:clean-command
Jun 9, 2016
Merged

jamiebuilds merged 3 commits into
lerna:masterfrom
gigabo:clean-command

Conversation

@gigabo

@gigabo gigabo commented Jun 8, 2016

Copy link
Copy Markdown
Contributor

Removes the node_modules directory from all packages.

Closes #195.

Or would lerna nuke be better? 👹

Removes the `node_modules` directory from all packages.

Closes lerna#195.
@gigabo

gigabo commented Jun 8, 2016

Copy link
Copy Markdown
Contributor Author

Output looks like:
image

@jamiebuilds

Copy link
Copy Markdown
Contributor

Do you think its necessary to add a confirmation dialog before doing it?

@gigabo

gigabo commented Jun 8, 2016 •

Copy link
Copy Markdown
Contributor Author

Maybe not. But it is rm -rf...

@gigabo

gigabo commented Jun 9, 2016

Copy link
Copy Markdown
Contributor Author

Added support for --yes, which reduces output:

$ lerna clean --yes
Lerna v2.0.0-beta.16
All clean!

Happy to remove the prompt altogether if you prefer, too.

@jamiebuilds

Copy link
Copy Markdown
Contributor

@joscha

joscha commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

Why not a script in package.json that uses lerna exec -- rm -rf ./node_modules

@jamiebuilds

Copy link
Copy Markdown
Contributor

Why not a script in package.json that uses lerna exec -- rm -rf ./node_modules

Well everyone ends up doing exactly that, so why not just have it included for them?

@joscha

joscha commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

Sure, but then maybe it would be better to make this platform-independent with FileSystemUtilities.rimraf instead of calling out to the shell at all.

Comment thread src/commands/CleanCommand.js Outdated
this.packages.forEach(pkg => {
progressBar.tick(pkg.name);

ChildProcessUtilities.execSync("rm -rf " + pkg.nodeModulesLocation);

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.

FileSystemUtilities.rimraf can be used here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤘 Thanks, didn't see that.

@joscha

joscha commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

Nice work (8470e3d)!

@hzoo

hzoo commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

👍

@jamiebuilds
jamiebuilds merged commit 435461c into lerna:master Jun 9, 2016
gigabo added a commit to gigabo/react-server that referenced this pull request Jun 10, 2016
This picks up some patches that will help us out:

- lerna/lerna#181
- lerna/lerna#196
- lerna/lerna#198
- lerna/lerna#199
gigabo added a commit to redfin/react-server that referenced this pull request Jun 13, 2016
* Upgrade lerna-2.0.0-beta.18

This picks up some patches that will help us out:

- lerna/lerna#181
- lerna/lerna#196
- lerna/lerna#198
- lerna/lerna#199

* Use `lerna clean` for `npm run nuke`
davidalber pushed a commit to davidalber/react-server that referenced this pull request Jul 24, 2016
* Upgrade lerna-2.0.0-beta.18

This picks up some patches that will help us out:

- lerna/lerna#181
- lerna/lerna#196
- lerna/lerna#198
- lerna/lerna#199

* Use `lerna clean` for `npm run nuke`
@lock

lock Bot commented Dec 28, 2018

Copy link
Copy Markdown

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 28, 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.

4 participants