Skip to content

Commit

Permalink
chore(package): rename
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefmikey committed Dec 28, 2024
1 parent 219a148 commit a1cd223
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -31,34 +31,34 @@ 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

Run in your project directory:

```bash
stale
depsweep
```

### Options
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -53,23 +53,23 @@
"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": [
"npm",
"cli",
"dependencies",
"unused",
"stale",
"depsweep",
"package.json",
"node"
],
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('getSourceFiles', () => {
});
});

describe('stale', () => {
describe('depsweep', () => {
it('exports required functions', () => {
expect(findClosestPackageJson).toBeDefined();
expect(getDependencies).toBeDefined();
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ async function main(): Promise<void> {

// Configure the CLI program
program
.name('stale')
.name('depsweep')
.usage('[options]')
.version('1.0.0')
.description(
Expand All @@ -821,7 +821,7 @@ async function main(): Promise<void> {
.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
Expand All @@ -847,7 +847,7 @@ async function main(): Promise<void> {
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),
Expand Down

0 comments on commit a1cd223

Please sign in to comment.