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

Add -all option to 'yarn clean' #2176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add -all option to 'yarn clean' #2176

wants to merge 1 commit into from

Conversation

jeremywiebe
Copy link
Collaborator

Summary:

We've had instances where folks' local repo gets into a bad state. It's assumed that yarn clean will resolve this, but it hasn't in all cases because it doesn't delete node_modules.

This PR adds a --all option to yarn clean to demolish all node_modules folders in the local repo.

Issue: "none"

Test plan:

yarn
yarn clean
ls node_modules # still exists
yarn clean --all
find . -name node_modules -and -type d # no results!

@jeremywiebe jeremywiebe self-assigned this Jan 30, 2025
@jeremywiebe jeremywiebe marked this pull request as ready for review January 30, 2025 23:53
Copy link
Contributor

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (86d2184) and published it to npm. You
can install it using the tag PR2176.

Example:

yarn add @khanacademy/perseus@PR2176

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR2176

Copy link
Contributor

github-actions bot commented Jan 30, 2025

Size Change: 0 B

Total Size: 1.48 MB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 86.8 kB
packages/math-input/dist/es/index.js 77.6 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 43.5 kB
packages/perseus-editor/dist/es/index.js 688 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus-score/dist/es/index.js 113 kB
packages/perseus/dist/es/index.js 382 kB
packages/perseus/dist/es/strings.js 5.82 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.5 kB

compressed-size-action

@jeremywiebe jeremywiebe changed the title Add -all option for 'yarn clean' to help with node_modules issues Add -all option to 'yarn clean' Jan 31, 2025
CLEAN_ALL=false
while [[ $# -gt 0 ]]; do
case $1 in
-a|--all)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could probably make an argument for not having an option at all and just deleting all node_modules folder always.

What say you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant