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

feat: additional dirs for cleanDir command #656

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

Conversation

kubicodes
Copy link

πŸ”— #415

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add custom directory cleanup support to nuxi cleanup

This PR adds support for cleaning up custom directories via the --cleanDir argument in the nuxi cleanup command, as requested in #415.

Features

  • Added --cleanDir argument to specify additional directories to clean up
  • Supports comma-separated values for cleaning multiple directories in a single command
  • Paths are resolved relative to the project root
  • Maintains existing functionality for default Nuxt directories

Usage Examples

Single Directory

npx nuxi cleanup --cleanDir temp

Multiple Directories (comma-separated)

npx nuxi cleanup --cleanDir "temp,cache,build"

Mixed with Default Cleanup

The command will clean both the specified directories and the default Nuxt directories:

  • Custom directories (from --cleanDir)
  • buildDir
  • .output
  • dist
  • node_modules/.vite
  • node_modules/.cache

Implementation Details

  • Added cleanDir argument with type: 'string' to support comma-separated values
  • Enhanced cleanupNuxtDirs to handle custom directories alongside default ones
  • All paths are properly resolved relative to the project root
  • Whitespace in comma-separated values is automatically trimmed

@kubicodes kubicodes requested a review from danielroe as a code owner January 9, 2025 07:10
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@f116a97). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/utils/nuxt.ts 0.00% 14 Missing ⚠️
src/commands/cleanup.ts 0.00% 9 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##             main    #656   +/-   ##
======================================
  Coverage        ?   2.53%           
======================================
  Files           ?      56           
  Lines           ?    2838           
  Branches        ?      40           
======================================
  Hits            ?      72           
  Misses          ?    2729           
  Partials        ?      37           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Copy link

pkg-pr-new bot commented Jan 9, 2025

Open in Stackblitz β€’ nuxt-cli-playground

npm i https://pkg.pr.new/nuxi@656

commit: fec0b93

@danielroe
Copy link
Member

don't worry about the failing test - this is probably an issue with how I've set it up

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.

3 participants