From a1cd223956712fc5013bfab785c307cd79af1646 Mon Sep 17 00:00:00 2001 From: Mikl Wolfe Date: Fri, 27 Dec 2024 22:15:28 -0700 Subject: [PATCH] chore(package): rename --- .github/workflows/publish.yml | 4 ++-- README.md | 36 +++++++++++++++++------------------ package.json | 12 ++++++------ src/__tests__/e2e.test.ts | 2 +- src/__tests__/unit.test.ts | 2 +- src/index.ts | 6 +++--- 6 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 84eb72c..647a0a7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -88,7 +88,7 @@ jobs: if: success() run: | echo "๐ŸŽ‰ Successfully published version ${{ steps.bump_version.outputs.new_version }}" - echo "- NPM package: https://www.npmjs.com/package/stale" + echo "- NPM package: https://www.npmjs.com/package/depsweep" echo "- GitHub release: https://github.com/${{ github.repository }}/releases/tag/v${{ steps.bump_version.outputs.new_version }}" - name: Rollback on failure @@ -98,7 +98,7 @@ jobs: # Unpublish from NPM if needed if [ "${{ steps.npm_publish.outcome }}" == "success" ]; then - npm unpublish stale@${{ steps.bump_version.outputs.new_version }} + npm unpublish depsweep@${{ steps.bump_version.outputs.new_version }} fi # Remove local tag diff --git a/README.md b/README.md index 04d9229..a7a5957 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# stale ๐Ÿงน +# depsweep ๐Ÿงน > Automated intelligent dependency cleanup for JavaScript/TypeScript projects -[![npm version](https://img.shields.io/npm/v/stale.svg)](https://www.npmjs.com/package/stale) -[![Downloads](https://img.shields.io/npm/dm/stale.svg)](https://www.npmjs.com/package/stale) -[![License](https://img.shields.io/npm/l/stale.svg)](https://github.com/chiefmikey/stale/blob/main/LICENSE) +[![npm version](https://img.shields.io/npm/v/depsweep.svg)](https://www.npmjs.com/package/depsweep) +[![Downloads](https://img.shields.io/npm/dm/depsweep.svg)](https://www.npmjs.com/package/depsweep) +[![License](https://img.shields.io/npm/l/depsweep.svg)](https://github.com/chiefmikey/depsweep/blob/main/LICENSE) Automatically detect and remove unused dependencies in your JavaScript and TypeScript projects with confidence. @@ -31,26 +31,26 @@ TypeScript projects with confidence. ```bash # Using npm -npm install -g stale +npm install -g depsweep # Using yarn -yarn global add stale +yarn global add depsweep # Using pnpm -pnpm add -g stale +pnpm add -g depsweep ``` ### One-off Usage ```bash # Using npx -npx stale +npx depsweep # Using yarn -yarn dlx stale +yarn dlx depsweep # Using pnpm -pnpm dlx stale +pnpm dlx depsweep ``` ## Usage @@ -58,7 +58,7 @@ pnpm dlx stale Run in your project directory: ```bash -stale +depsweep ``` ### Options @@ -77,28 +77,28 @@ Options: ```bash # Run with verbose output -stale --verbose +depsweep --verbose # Run in safe mode -stale --safe +depsweep --safe # Ignore specific directories or files -stale -i "test/**" "scripts/**" +depsweep -i "test/**" "scripts/**" # Preview changes without removing dependencies -stale --dry-run +depsweep --dry-run ``` ## How It Works -`stale` performs a comprehensive analysis of your project to identify and remove +`depsweep` performs a comprehensive analysis of your project to identify and remove unused dependencies: 1. **Deep Dependency Analysis**: Scans your codebase using AST parsing for accurate detection. This ensures that all import and require statements are correctly identified, even in complex scenarios. 2. **Smart Import Detection**: Handles various import patterns, including - dynamic imports. This allows `stale` to detect dependencies that are + dynamic imports. This allows `depsweep` to detect dependencies that are conditionally loaded or imported using non-standard methods. 3. **Configuration File Parsing**: Analyzes configuration files to find additional dependencies. This includes parsing JSON, YAML, and JavaScript @@ -110,7 +110,7 @@ unused dependencies: in safe mode. This feature ensures that essential development tools and libraries are not accidentally removed. 6. **Efficient Processing**: Leverages parallel processing for faster execution. - By processing files in parallel, `stale` can analyze large codebases more + By processing files in parallel, `depsweep` can analyze large codebases more quickly and efficiently. 7. **Memory Management**: Monitors and manages memory usage during analysis to prevent crashes. This ensures that the tool can handle large projects without diff --git a/package.json b/package.json index 7ac9742..c7bbf79 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "stale", + "name": "depsweep", "version": "0.0.0", "description": "CLI tool that identifies and removes unused dependencies", "main": "dist/index.js", @@ -53,15 +53,15 @@ "README.md" ], "bin": { - "stale": "dist/index.js" + "depsweep": "dist/index.js" }, - "homepage": "https://github.com/chiefmikey/stale", + "homepage": "https://github.com/chiefmikey/depsweep", "repository": { "type": "git", - "url": "https://github.com/chiefmikey/stale.git" + "url": "https://github.com/chiefmikey/depsweep.git" }, "bugs": { - "url": "https://github.com/chiefmikey/stale/issues" + "url": "https://github.com/chiefmikey/depsweep/issues" }, "license": "MIT", "keywords": [ @@ -69,7 +69,7 @@ "cli", "dependencies", "unused", - "stale", + "depsweep", "package.json", "node" ], diff --git a/src/__tests__/e2e.test.ts b/src/__tests__/e2e.test.ts index 3ce5233..0f3defa 100644 --- a/src/__tests__/e2e.test.ts +++ b/src/__tests__/e2e.test.ts @@ -21,7 +21,7 @@ describe('e2E Test', () => { encoding: 'utf8', }); - expect(output).toContain('Usage: stale [options]'); + expect(output).toContain('Usage: depsweep [options]'); expect(output).toContain('Options:'); expect(output).toContain('--help'); expect(output).toContain('--version'); diff --git a/src/__tests__/unit.test.ts b/src/__tests__/unit.test.ts index 808267a..042339a 100644 --- a/src/__tests__/unit.test.ts +++ b/src/__tests__/unit.test.ts @@ -64,7 +64,7 @@ describe('getSourceFiles', () => { }); }); -describe('stale', () => { +describe('depsweep', () => { it('exports required functions', () => { expect(findClosestPackageJson).toBeDefined(); expect(getDependencies).toBeDefined(); diff --git a/src/index.ts b/src/index.ts index f728426..6dca0c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -810,7 +810,7 @@ async function main(): Promise { // Configure the CLI program program - .name('stale') + .name('depsweep') .usage('[options]') .version('1.0.0') .description( @@ -821,7 +821,7 @@ async function main(): Promise { .option('--safe', 'prevent removing essential packages') .option('--dry-run', 'show what would be removed without making changes') .option('--no-progress', 'disable progress bar') - .addHelpText('after', '\nExample:\n $ stale --verbose'); + .addHelpText('after', '\nExample:\n $ depsweep --verbose'); program.exitOverride(() => { // Don't throw or exit - just let the help display @@ -847,7 +847,7 @@ async function main(): Promise { const projectDirectory = path.dirname(packageJsonPath); const context = await getPackageContext(packageJsonPath); - console.log(chalk.bold('\nStale Deps Analysis')); + console.log(chalk.bold('\ndepsweep Deps Analysis')); console.log( `Package.json found at: ${chalk.green( path.relative(process.cwd(), packageJsonPath),