squeaky-clean 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +465 -0
- package/dist/cleaners/BaseCleaner.d.ts +57 -0
- package/dist/cleaners/BaseCleaner.d.ts.map +1 -0
- package/dist/cleaners/BaseCleaner.js +299 -0
- package/dist/cleaners/BaseCleaner.js.map +1 -0
- package/dist/cleaners/CleanerRegistry.d.ts +65 -0
- package/dist/cleaners/CleanerRegistry.d.ts.map +1 -0
- package/dist/cleaners/CleanerRegistry.js +112 -0
- package/dist/cleaners/CleanerRegistry.js.map +1 -0
- package/dist/cleaners/androidstudio.d.ts +16 -0
- package/dist/cleaners/androidstudio.d.ts.map +1 -0
- package/dist/cleaners/androidstudio.js +375 -0
- package/dist/cleaners/androidstudio.js.map +1 -0
- package/dist/cleaners/brew.d.ts +4 -0
- package/dist/cleaners/brew.d.ts.map +1 -0
- package/dist/cleaners/brew.js +197 -0
- package/dist/cleaners/brew.js.map +1 -0
- package/dist/cleaners/brewEnhanced.d.ts +18 -0
- package/dist/cleaners/brewEnhanced.d.ts.map +1 -0
- package/dist/cleaners/brewEnhanced.js +255 -0
- package/dist/cleaners/brewEnhanced.js.map +1 -0
- package/dist/cleaners/bun.d.ts +14 -0
- package/dist/cleaners/bun.d.ts.map +1 -0
- package/dist/cleaners/bun.js +207 -0
- package/dist/cleaners/bun.js.map +1 -0
- package/dist/cleaners/chrome.d.ts +14 -0
- package/dist/cleaners/chrome.d.ts.map +1 -0
- package/dist/cleaners/chrome.js +250 -0
- package/dist/cleaners/chrome.js.map +1 -0
- package/dist/cleaners/docker.d.ts +35 -0
- package/dist/cleaners/docker.d.ts.map +1 -0
- package/dist/cleaners/docker.js +285 -0
- package/dist/cleaners/docker.js.map +1 -0
- package/dist/cleaners/firefox.d.ts +15 -0
- package/dist/cleaners/firefox.d.ts.map +1 -0
- package/dist/cleaners/firefox.js +281 -0
- package/dist/cleaners/firefox.js.map +1 -0
- package/dist/cleaners/flutter.d.ts +18 -0
- package/dist/cleaners/flutter.d.ts.map +1 -0
- package/dist/cleaners/flutter.js +354 -0
- package/dist/cleaners/flutter.js.map +1 -0
- package/dist/cleaners/goBuild.d.ts +18 -0
- package/dist/cleaners/goBuild.d.ts.map +1 -0
- package/dist/cleaners/goBuild.js +196 -0
- package/dist/cleaners/goBuild.js.map +1 -0
- package/dist/cleaners/gradle.d.ts +14 -0
- package/dist/cleaners/gradle.d.ts.map +1 -0
- package/dist/cleaners/gradle.js +336 -0
- package/dist/cleaners/gradle.js.map +1 -0
- package/dist/cleaners/index.d.ts +51 -0
- package/dist/cleaners/index.d.ts.map +1 -0
- package/dist/cleaners/index.js +247 -0
- package/dist/cleaners/index.js.map +1 -0
- package/dist/cleaners/jetbrains.d.ts +18 -0
- package/dist/cleaners/jetbrains.d.ts.map +1 -0
- package/dist/cleaners/jetbrains.js +441 -0
- package/dist/cleaners/jetbrains.js.map +1 -0
- package/dist/cleaners/nix.d.ts +4 -0
- package/dist/cleaners/nix.d.ts.map +1 -0
- package/dist/cleaners/nix.js +227 -0
- package/dist/cleaners/nix.js.map +1 -0
- package/dist/cleaners/nodeGyp.d.ts +14 -0
- package/dist/cleaners/nodeGyp.d.ts.map +1 -0
- package/dist/cleaners/nodeGyp.js +157 -0
- package/dist/cleaners/nodeGyp.js.map +1 -0
- package/dist/cleaners/npm.d.ts +14 -0
- package/dist/cleaners/npm.d.ts.map +1 -0
- package/dist/cleaners/npm.js +198 -0
- package/dist/cleaners/npm.js.map +1 -0
- package/dist/cleaners/npmEnhanced.d.ts +19 -0
- package/dist/cleaners/npmEnhanced.d.ts.map +1 -0
- package/dist/cleaners/npmEnhanced.js +336 -0
- package/dist/cleaners/npmEnhanced.js.map +1 -0
- package/dist/cleaners/nx.d.ts +18 -0
- package/dist/cleaners/nx.d.ts.map +1 -0
- package/dist/cleaners/nx.js +308 -0
- package/dist/cleaners/nx.js.map +1 -0
- package/dist/cleaners/pip.d.ts +19 -0
- package/dist/cleaners/pip.d.ts.map +1 -0
- package/dist/cleaners/pip.js +334 -0
- package/dist/cleaners/pip.js.map +1 -0
- package/dist/cleaners/pnpm.d.ts +14 -0
- package/dist/cleaners/pnpm.d.ts.map +1 -0
- package/dist/cleaners/pnpm.js +209 -0
- package/dist/cleaners/pnpm.js.map +1 -0
- package/dist/cleaners/turbo.d.ts +18 -0
- package/dist/cleaners/turbo.d.ts.map +1 -0
- package/dist/cleaners/turbo.js +325 -0
- package/dist/cleaners/turbo.js.map +1 -0
- package/dist/cleaners/vite.d.ts +17 -0
- package/dist/cleaners/vite.d.ts.map +1 -0
- package/dist/cleaners/vite.js +274 -0
- package/dist/cleaners/vite.js.map +1 -0
- package/dist/cleaners/vscode.d.ts +14 -0
- package/dist/cleaners/vscode.d.ts.map +1 -0
- package/dist/cleaners/vscode.js +354 -0
- package/dist/cleaners/vscode.js.map +1 -0
- package/dist/cleaners/webpack.d.ts +17 -0
- package/dist/cleaners/webpack.d.ts.map +1 -0
- package/dist/cleaners/webpack.js +263 -0
- package/dist/cleaners/webpack.js.map +1 -0
- package/dist/cleaners/xcode.d.ts +14 -0
- package/dist/cleaners/xcode.d.ts.map +1 -0
- package/dist/cleaners/xcode.js +348 -0
- package/dist/cleaners/xcode.js.map +1 -0
- package/dist/cleaners/yarn.d.ts +16 -0
- package/dist/cleaners/yarn.d.ts.map +1 -0
- package/dist/cleaners/yarn.js +266 -0
- package/dist/cleaners/yarn.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +346 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auto.d.ts +8 -0
- package/dist/commands/auto.d.ts.map +1 -0
- package/dist/commands/auto.js +224 -0
- package/dist/commands/auto.js.map +1 -0
- package/dist/commands/categories.d.ts +8 -0
- package/dist/commands/categories.d.ts.map +1 -0
- package/dist/commands/categories.js +133 -0
- package/dist/commands/categories.js.map +1 -0
- package/dist/commands/clean.d.ts +3 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +149 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/config.d.ts +14 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +445 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/configDoctor.d.ts +26 -0
- package/dist/commands/configDoctor.d.ts.map +1 -0
- package/dist/commands/configDoctor.js +60 -0
- package/dist/commands/configDoctor.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +141 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/emojis.d.ts +2 -0
- package/dist/commands/emojis.d.ts.map +1 -0
- package/dist/commands/emojis.js +28 -0
- package/dist/commands/emojis.js.map +1 -0
- package/dist/commands/interactive.d.ts +3 -0
- package/dist/commands/interactive.d.ts.map +1 -0
- package/dist/commands/interactive.js +284 -0
- package/dist/commands/interactive.js.map +1 -0
- package/dist/commands/interactiveEnhanced.d.ts +4 -0
- package/dist/commands/interactiveEnhanced.d.ts.map +1 -0
- package/dist/commands/interactiveEnhanced.js +460 -0
- package/dist/commands/interactiveEnhanced.js.map +1 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +68 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/sizes.d.ts +2 -0
- package/dist/commands/sizes.d.ts.map +1 -0
- package/dist/commands/sizes.js +87 -0
- package/dist/commands/sizes.js.map +1 -0
- package/dist/config/index.d.ts +26 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +228 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loadConfig.d.ts +7 -0
- package/dist/config/loadConfig.d.ts.map +1 -0
- package/dist/config/loadConfig.js +103 -0
- package/dist/config/loadConfig.js.map +1 -0
- package/dist/config/migrateConfig.d.ts +56 -0
- package/dist/config/migrateConfig.d.ts.map +1 -0
- package/dist/config/migrateConfig.js +102 -0
- package/dist/config/migrateConfig.js.map +1 -0
- package/dist/plugins/discovery.d.ts +6 -0
- package/dist/plugins/discovery.d.ts.map +1 -0
- package/dist/plugins/discovery.js +64 -0
- package/dist/plugins/discovery.js.map +1 -0
- package/dist/profiles/index.d.ts +61 -0
- package/dist/profiles/index.d.ts.map +1 -0
- package/dist/profiles/index.js +361 -0
- package/dist/profiles/index.js.map +1 -0
- package/dist/types/index.d.ts +161 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/cli.d.ts +44 -0
- package/dist/utils/cli.d.ts.map +1 -0
- package/dist/utils/cli.js +407 -0
- package/dist/utils/cli.js.map +1 -0
- package/dist/utils/fs.d.ts +15 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +218 -0
- package/dist/utils/fs.js.map +1 -0
- package/package.json +122 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Squeaky Clean Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
# 🧼squeaky-clean✨
|
|
2
|
+
<div align="center">
|
|
3
|
+
|
|
4
|
+
**Easy cross-system development cache cleaner/manager with interactive configuration**
|
|
5
|
+
|
|
6
|
+
Essentially a *"universal cachectl"*—**smart** *(sort of)*, **safe** (at least, I *think* it is...), and **configurable** cache cleaner/manager CLI-tool with support for *most* common development tools. Dsigned for easy integration expansion with additional tools *(forks **encouraged!**)*.
|
|
7
|
+
|
|
8
|
+
[Features](#features) • [Installation](#installation) • [Usage](#usage) • [Configuration](#configuration) • [Supported Tools](#supported-tools) • [Contributing](#contributing)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
[](https://www.npmjs.com/package/squeaky-clean) [](https://nodejs.org) [](https://www.npmjs.com/package/squeaky-clean) [](https://opensource.org/licenses/MIT)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **🎯 Smart Detection**: Automatically detects installed development tools and their cache locations
|
|
21
|
+
- **🎨 Interactive Wizard**: Beautiful CLI interface with progress bars and colored output
|
|
22
|
+
- **🔧 Highly Configurable**: Choose exactly which caches to clean and when
|
|
23
|
+
- **📊 Size Analytics**: See how much space each cache is using before cleaning
|
|
24
|
+
- **🛡️ Safe by Default**: Dry-run mode to preview what will be cleaned (v0.1.0+ defaults to dry-run)
|
|
25
|
+
- **⚡ Performance**: Parallel cleaning operations for maximum speed
|
|
26
|
+
- **🔄 Auto-clean Mode**: Schedule automatic cache cleaning based on your preferences
|
|
27
|
+
- **📱 Cross-platform**: Works on macOS, Linux, and Windows
|
|
28
|
+
- **🔄 Config Migration**: Automatic migration from legacy to new configuration format
|
|
29
|
+
- **🔌 Plugin Support**: Discover and use community cleaners via npm packages
|
|
30
|
+
- **📋 JSON Output**: Machine-readable output for scripting and automation
|
|
31
|
+
|
|
32
|
+
## 📦 Installation
|
|
33
|
+
|
|
34
|
+
### Global Installation (Recommended)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g squeaky-clean
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or using other package managers:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Yarn
|
|
44
|
+
yarn global add squeaky-clean
|
|
45
|
+
|
|
46
|
+
# pnpm
|
|
47
|
+
pnpm add -g squeaky-clean
|
|
48
|
+
|
|
49
|
+
# Bun
|
|
50
|
+
bun add -g squeaky-clean
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Local Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install --save-dev squeaky-clean
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
### Interactive Mode (Recommended)
|
|
62
|
+
|
|
63
|
+
Start the interactive configuration wizard:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
squeaky interactive
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This will guide you through:
|
|
70
|
+
- Selecting which tools to clean
|
|
71
|
+
- Configuring cleaning preferences
|
|
72
|
+
- Setting up automatic cleaning schedules
|
|
73
|
+
|
|
74
|
+
### Command Line
|
|
75
|
+
|
|
76
|
+
#### Clean all caches
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
squeaky clean --all
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Clean specific cache types
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Clean only package manager caches
|
|
86
|
+
squeaky clean --types package-manager
|
|
87
|
+
|
|
88
|
+
# Clean multiple types
|
|
89
|
+
squeaky clean --types package-manager,build-tool
|
|
90
|
+
|
|
91
|
+
# Clean specific tools
|
|
92
|
+
squeaky clean npm yarn webpack
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Dry run mode (preview without cleaning)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
squeaky clean --all --dry-run
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Show cache sizes
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
squeaky sizes
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### List available caches
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
squeaky list
|
|
111
|
+
# With sizes inline
|
|
112
|
+
squeaky list --sizes
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### 🎯 Granular Cache Management
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# View detailed cache categories
|
|
119
|
+
squeaky categories --tool npm
|
|
120
|
+
squeaky categories --verbose # Show all tools with details
|
|
121
|
+
|
|
122
|
+
# Clean caches older than 7 days
|
|
123
|
+
squeaky clean --older-than 7d
|
|
124
|
+
|
|
125
|
+
# Clean caches larger than 100MB
|
|
126
|
+
squeaky clean --larger-than 100MB
|
|
127
|
+
|
|
128
|
+
# Clean only low priority caches (preserve critical/important)
|
|
129
|
+
squeaky clean --priority low
|
|
130
|
+
|
|
131
|
+
# Clean archived/experimental caches
|
|
132
|
+
squeaky clean --use-case archived
|
|
133
|
+
|
|
134
|
+
# Combine multiple criteria
|
|
135
|
+
squeaky clean --older-than 14d --priority low --larger-than 50MB
|
|
136
|
+
|
|
137
|
+
# Clean specific categories by ID
|
|
138
|
+
squeaky categories --tool npm # First, list categories to get IDs
|
|
139
|
+
squeaky clean --categories npm-logs,npm-metrics
|
|
140
|
+
|
|
141
|
+
# Use custom config file
|
|
142
|
+
squeaky clean --config my-config.json --dry-run
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Available Commands
|
|
146
|
+
|
|
147
|
+
| Command | Description | Aliases |
|
|
148
|
+
|---------|-------------|---------|
|
|
149
|
+
| `clean` | Clean development caches with granular control | - |
|
|
150
|
+
| `list` | List available caches and their status | `ls` |
|
|
151
|
+
| `sizes` | Show cache sizes without clearing | - |
|
|
152
|
+
| `categories` | Show detailed cache categories with usage patterns | `cats` |
|
|
153
|
+
| `config` | Manage configuration | - |
|
|
154
|
+
| `doctor` | Check system and diagnose issues | - |
|
|
155
|
+
| `auto` | Configure automatic cleaning | - |
|
|
156
|
+
| `interactive` | Start interactive configuration wizard | `i` |
|
|
157
|
+
|
|
158
|
+
### Command Options
|
|
159
|
+
|
|
160
|
+
#### `clean` Options
|
|
161
|
+
|
|
162
|
+
- `-a, --all` - Clean all configured caches
|
|
163
|
+
- `-t, --types <types>` - Comma-separated list of cache types
|
|
164
|
+
- `-e, --exclude <tools>` - Comma-separated list of tools to exclude
|
|
165
|
+
- `-d, --dry-run` - Show what would be cleaned without actually cleaning
|
|
166
|
+
- `-f, --force` - Skip confirmation prompts
|
|
167
|
+
- `-s, --sizes` - Show cache sizes before cleaning
|
|
168
|
+
|
|
169
|
+
**🎯 Granular Selection Options:**
|
|
170
|
+
- `--older-than <age>` - Clean caches older than specified age (e.g., `7d`, `2w`, `1m`)
|
|
171
|
+
- `--newer-than <age>` - Clean caches newer than specified age
|
|
172
|
+
- `--larger-than <size>` - Clean caches larger than specified size (e.g., `100MB`, `1GB`)
|
|
173
|
+
- `--smaller-than <size>` - Clean caches smaller than specified size
|
|
174
|
+
- `--use-case <case>` - Target specific use cases (`development`, `testing`, `production`, `experimental`, `archived`)
|
|
175
|
+
- `--priority <level>` - Clean only specified priority (`critical`, `important`, `normal`, `low`)
|
|
176
|
+
- `--categories <ids>` - Clean specific category IDs (comma-separated)
|
|
177
|
+
|
|
178
|
+
#### `categories` Options
|
|
179
|
+
|
|
180
|
+
- `-t, --tool <tool>` - Show categories for specific tool
|
|
181
|
+
- `--type <type>` - Filter by cache type
|
|
182
|
+
- `-v, --verbose` - Show detailed information
|
|
183
|
+
|
|
184
|
+
#### `list` Options
|
|
185
|
+
|
|
186
|
+
- `-s, --sizes` - Include cache sizes inline with the list
|
|
187
|
+
- `-t, --type <type>` - Filter by cache type
|
|
188
|
+
|
|
189
|
+
#### Global Options
|
|
190
|
+
|
|
191
|
+
- `-v, --verbose` - Enable verbose output
|
|
192
|
+
- `--no-color` - Disable colored output
|
|
193
|
+
- `--config <path>` - Use custom configuration file
|
|
194
|
+
- `--version` - Show version number
|
|
195
|
+
- `-h, --help` - Display help
|
|
196
|
+
|
|
197
|
+
## 🛠️ Supported Tools
|
|
198
|
+
|
|
199
|
+
### Package Managers
|
|
200
|
+
|
|
201
|
+
| Tool | Caches Cleaned |
|
|
202
|
+
|------|----------------|
|
|
203
|
+
| **npm** | `~/.npm`, `node_modules/.cache` |
|
|
204
|
+
| **Yarn** | `~/.yarn/cache`, `.yarn/cache` |
|
|
205
|
+
| **pnpm** | `~/.pnpm-store`, `~/.cache/pnpm` |
|
|
206
|
+
| **Bun** | `~/.bun/install/cache` |
|
|
207
|
+
| **pip** | `~/.cache/pip` |
|
|
208
|
+
| **Homebrew** | `brew --cache`, old versions |
|
|
209
|
+
| **Nix** | `/nix/store` garbage, old generations |
|
|
210
|
+
|
|
211
|
+
### Build Tools
|
|
212
|
+
|
|
213
|
+
| Tool | Caches Cleaned |
|
|
214
|
+
|------|----------------|
|
|
215
|
+
| **Webpack** | `.webpack-cache`, `node_modules/.cache/webpack` |
|
|
216
|
+
| **Vite** | `node_modules/.vite`, `.vite-cache` |
|
|
217
|
+
| **Nx** | `node_modules/.cache/nx`, `.nx/cache` |
|
|
218
|
+
| **Turbo** | `.turbo`, `node_modules/.cache/turbo` |
|
|
219
|
+
| **Flutter** | `~/.pub-cache`, `build/` |
|
|
220
|
+
|
|
221
|
+
### IDEs & Editors
|
|
222
|
+
|
|
223
|
+
| Tool | Caches Cleaned |
|
|
224
|
+
|------|----------------|
|
|
225
|
+
| **VS Code** | `~/.config/Code/Cache*`, Extensions cache |
|
|
226
|
+
| **Xcode** | `~/Library/Developer/Xcode/DerivedData` |
|
|
227
|
+
| **Android Studio** | `~/.android/cache`, Build cache |
|
|
228
|
+
| **JetBrains IDEs** | `~/.cache/JetBrains/*/caches` |
|
|
229
|
+
|
|
230
|
+
### Browsers (Development)
|
|
231
|
+
|
|
232
|
+
| Tool | Caches Cleaned |
|
|
233
|
+
|------|----------------|
|
|
234
|
+
| **Chrome** | Dev tools cache, Service workers |
|
|
235
|
+
| **Firefox** | Dev tools cache, Temporary files |
|
|
236
|
+
|
|
237
|
+
### System Tools
|
|
238
|
+
|
|
239
|
+
| Tool | Caches Cleaned |
|
|
240
|
+
|------|----------------|
|
|
241
|
+
| **Docker** | Unused containers, images, volumes |
|
|
242
|
+
| **Gradle** | `~/.gradle/caches`, `.gradle/` |
|
|
243
|
+
|
|
244
|
+
## ⚙️ Configuration
|
|
245
|
+
|
|
246
|
+
Squeaky Clean can be configured through:
|
|
247
|
+
|
|
248
|
+
1. **Interactive wizard**: `squeaky interactive`
|
|
249
|
+
2. **Configuration file**: `~/.squeaky-clean/config.json`
|
|
250
|
+
3. **Environment variables**: `SQUEAKY_*`
|
|
251
|
+
|
|
252
|
+
### Configuration Migration (v0.2.0+)
|
|
253
|
+
|
|
254
|
+
Squeaky Clean now supports automatic migration from legacy configuration format to the new schema:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Migrate your config automatically
|
|
258
|
+
squeaky config doctor
|
|
259
|
+
|
|
260
|
+
# Or use the doctor command
|
|
261
|
+
squeaky doctor --config
|
|
262
|
+
|
|
263
|
+
# Preview migration without changing files
|
|
264
|
+
squeaky config doctor --dry-run
|
|
265
|
+
|
|
266
|
+
# Migrate to a different file
|
|
267
|
+
squeaky config doctor --input old-config.json --output new-config.json
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Configuration File Examples
|
|
271
|
+
|
|
272
|
+
#### New Schema (v0.2.0+)
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"cleaners": {
|
|
276
|
+
"npm": { "enabled": true },
|
|
277
|
+
"yarn": { "enabled": true },
|
|
278
|
+
"webpack": { "enabled": false }
|
|
279
|
+
},
|
|
280
|
+
"scheduler": {
|
|
281
|
+
"enabled": true,
|
|
282
|
+
"interval": "weekly",
|
|
283
|
+
"thresholds": {
|
|
284
|
+
"size": "1GB",
|
|
285
|
+
"age": "30d"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"defaults": {
|
|
289
|
+
"verbose": false,
|
|
290
|
+
"colors": true,
|
|
291
|
+
"format": "text"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
#### Legacy Schema (still supported)
|
|
297
|
+
```json
|
|
298
|
+
{
|
|
299
|
+
"tools": {
|
|
300
|
+
"npm": { "enabled": true },
|
|
301
|
+
"yarn": { "enabled": true },
|
|
302
|
+
"webpack": { "enabled": false }
|
|
303
|
+
},
|
|
304
|
+
"auto": {
|
|
305
|
+
"enabled": true,
|
|
306
|
+
"schedule": "weekly",
|
|
307
|
+
"sizeThreshold": "1GB"
|
|
308
|
+
},
|
|
309
|
+
"output": {
|
|
310
|
+
"verbose": false,
|
|
311
|
+
"useColors": true
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Environment Variables
|
|
317
|
+
|
|
318
|
+
- `SQUEAKY_AUTO_CLEAN` - Enable automatic cleaning
|
|
319
|
+
- `SQUEAKY_DRY_RUN` - Always run in dry-run mode
|
|
320
|
+
- `SQUEAKY_VERBOSE` - Enable verbose output
|
|
321
|
+
- `SQUEAKY_NO_COLOR` - Disable colored output
|
|
322
|
+
|
|
323
|
+
## 🔄 Automatic Cleaning
|
|
324
|
+
|
|
325
|
+
Configure automatic cache cleaning based on:
|
|
326
|
+
|
|
327
|
+
- **Schedule**: Daily, weekly, or monthly
|
|
328
|
+
- **Size threshold**: Clean when caches exceed a certain size
|
|
329
|
+
- **Smart detection**: Clean only when tools haven't been used recently
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Configure automatic cleaning
|
|
333
|
+
squeaky auto
|
|
334
|
+
|
|
335
|
+
# Enable with weekly schedule
|
|
336
|
+
squeaky auto --enable --schedule weekly
|
|
337
|
+
|
|
338
|
+
# Set size threshold
|
|
339
|
+
squeaky auto --size-threshold 5GB
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## 🏗️ Architecture
|
|
343
|
+
|
|
344
|
+
Squeaky Clean is built with a modular architecture:
|
|
345
|
+
|
|
346
|
+
```
|
|
347
|
+
src/
|
|
348
|
+
├── cli.ts # CLI entry point
|
|
349
|
+
├── commands/ # Command implementations
|
|
350
|
+
│ ├── clean.ts # Main cleaning logic
|
|
351
|
+
│ ├── interactive.ts # Interactive wizard
|
|
352
|
+
│ ├── config.ts # Configuration management
|
|
353
|
+
│ └── ...
|
|
354
|
+
├── cleaners/ # Tool-specific cleaners
|
|
355
|
+
│ ├── npm.ts
|
|
356
|
+
│ ├── docker.ts
|
|
357
|
+
│ └── ...
|
|
358
|
+
├── config/ # Configuration system
|
|
359
|
+
├── utils/ # Utility functions
|
|
360
|
+
└── types/ # TypeScript definitions
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Each cleaner module implements the `CleanerModule` interface:
|
|
364
|
+
|
|
365
|
+
```typescript
|
|
366
|
+
interface CleanerModule {
|
|
367
|
+
name: string;
|
|
368
|
+
type: CacheType;
|
|
369
|
+
description: string;
|
|
370
|
+
getCacheInfo(): Promise<CacheInfo>;
|
|
371
|
+
clear(dryRun?: boolean): Promise<ClearResult>;
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
## 🧪 Development
|
|
376
|
+
|
|
377
|
+
### Prerequisites
|
|
378
|
+
|
|
379
|
+
- Node.js >= 16.0.0
|
|
380
|
+
- npm, yarn, pnpm, or bun
|
|
381
|
+
|
|
382
|
+
### Setup
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
# Clone the repository
|
|
386
|
+
git clone https://github.com/justinchen/squeaky-clean.git
|
|
387
|
+
cd squeaky-clean
|
|
388
|
+
|
|
389
|
+
# Install dependencies
|
|
390
|
+
npm install
|
|
391
|
+
|
|
392
|
+
# Build the project
|
|
393
|
+
npm run build
|
|
394
|
+
|
|
395
|
+
# Run in development mode
|
|
396
|
+
npm run dev
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Scripts
|
|
400
|
+
|
|
401
|
+
- `npm run build` - Build the TypeScript source
|
|
402
|
+
- `npm run dev` - Run in development mode with hot reload
|
|
403
|
+
- `npm test` - Run tests
|
|
404
|
+
- `npm run test:watch` - Run tests in watch mode
|
|
405
|
+
- `npm run test:coverage` - Generate test coverage report
|
|
406
|
+
- `npm run lint` - Lint the codebase
|
|
407
|
+
- `npm run format` - Format code with Prettier
|
|
408
|
+
|
|
409
|
+
### Testing
|
|
410
|
+
|
|
411
|
+
```bash
|
|
412
|
+
# Run all tests
|
|
413
|
+
npm test
|
|
414
|
+
|
|
415
|
+
# Run tests in watch mode
|
|
416
|
+
npm run test:watch
|
|
417
|
+
|
|
418
|
+
# Generate coverage report
|
|
419
|
+
npm run test:coverage
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
## 🤝 Contributing
|
|
423
|
+
|
|
424
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
425
|
+
|
|
426
|
+
1. Fork the repository
|
|
427
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
428
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
429
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
430
|
+
5. Open a Pull Request
|
|
431
|
+
|
|
432
|
+
### Adding a New Cleaner
|
|
433
|
+
|
|
434
|
+
To add support for a new tool:
|
|
435
|
+
|
|
436
|
+
1. Create a new cleaner module in `src/cleaners/`
|
|
437
|
+
2. Implement the `CleanerModule` interface
|
|
438
|
+
3. Register it in `src/cleaners/index.ts`
|
|
439
|
+
4. Add tests in `src/__tests__/cleaners/`
|
|
440
|
+
5. Update the README with the new tool
|
|
441
|
+
|
|
442
|
+
## 📝 License
|
|
443
|
+
|
|
444
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
445
|
+
|
|
446
|
+
## 🙏 Acknowledgments
|
|
447
|
+
|
|
448
|
+
**Built with**:
|
|
449
|
+
- *[Commander.js](https://github.com/tj/commander.js)* for CLI parsing
|
|
450
|
+
- *[Chalk](https://github.com/chalk/chalk)* for puuurrrtty terminal output
|
|
451
|
+
- *[Inquirer.js](https://github.com/SBoudrias/Inquirer.js)* for interactive prompts
|
|
452
|
+
- *[Ora](https://github.com/sindresorhus/ora)* for elegant terminal spinners
|
|
453
|
+
|
|
454
|
+
## 📮 Support
|
|
455
|
+
|
|
456
|
+
- 🐛 [Report bugs](https://github.com/chendrizzy/squeaky-clean/issues)
|
|
457
|
+
- 💡 [Request features](https://github.com/chendrizzy/squeaky-clean/issues)
|
|
458
|
+
- 📖 [Read the docs](https://github.com/chendrizzy/squeaky-clean#readme)
|
|
459
|
+
- ⭐ Star the project on GitHub!
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
<div align="center">
|
|
464
|
+
Made with ❤️ by and for developers
|
|
465
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CleanerModule, CacheInfo, CacheCategory, ClearResult, CacheType, CacheSelectionCriteria } from "../types";
|
|
2
|
+
export declare abstract class BaseCleaner implements CleanerModule {
|
|
3
|
+
abstract name: string;
|
|
4
|
+
abstract type: CacheType;
|
|
5
|
+
abstract description: string;
|
|
6
|
+
abstract isAvailable(): Promise<boolean>;
|
|
7
|
+
abstract getCacheInfo(): Promise<CacheInfo>;
|
|
8
|
+
/**
|
|
9
|
+
* Get detailed cache categories with metadata
|
|
10
|
+
*/
|
|
11
|
+
getCacheCategories(): Promise<CacheCategory[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Check if a path is protected
|
|
14
|
+
*/
|
|
15
|
+
protected isProtectedPath(path: string, protectedPaths?: string[]): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Filter paths to exclude protected ones
|
|
18
|
+
*/
|
|
19
|
+
protected filterProtectedPaths(paths: string[], protectedPaths?: string[]): string[];
|
|
20
|
+
/**
|
|
21
|
+
* Clear cache with selection criteria
|
|
22
|
+
*/
|
|
23
|
+
clear(dryRun?: boolean, criteria?: CacheSelectionCriteria, _cacheInfo?: CacheInfo, protectedPaths?: string[]): Promise<ClearResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Clear specific categories
|
|
26
|
+
*/
|
|
27
|
+
clearByCategory(categoryIds: string[], dryRun?: boolean, _cacheInfo?: CacheInfo, protectedPaths?: string[]): Promise<ClearResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Filter categories based on criteria
|
|
30
|
+
*/
|
|
31
|
+
protected filterCategories(categories: CacheCategory[], criteria?: CacheSelectionCriteria): CacheCategory[];
|
|
32
|
+
/**
|
|
33
|
+
* Get directory size in bytes
|
|
34
|
+
*/
|
|
35
|
+
protected getDirectorySize(path: string): Promise<number>;
|
|
36
|
+
/**
|
|
37
|
+
* Clear a specific path
|
|
38
|
+
*/
|
|
39
|
+
protected clearPath(path: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Detect if a path has been recently used
|
|
42
|
+
*/
|
|
43
|
+
protected isRecentlyUsed(path: string, days?: number): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Detect if a path is project-specific
|
|
46
|
+
*/
|
|
47
|
+
protected isProjectSpecific(path: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Get cache priority based on path and usage
|
|
50
|
+
*/
|
|
51
|
+
protected getCachePriority(path: string): "critical" | "important" | "normal" | "low";
|
|
52
|
+
/**
|
|
53
|
+
* Detect use case based on path patterns
|
|
54
|
+
*/
|
|
55
|
+
protected detectUseCase(path: string): "development" | "testing" | "production" | "experimental" | "archived";
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=BaseCleaner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseCleaner.d.ts","sourceRoot":"","sources":["../../src/cleaners/BaseCleaner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,aAAa,EACb,WAAW,EACX,SAAS,EACT,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAWlB,8BAAsB,WAAY,YAAW,aAAa;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IACxC,QAAQ,CAAC,YAAY,IAAI,OAAO,CAAC,SAAS,CAAC;IAE3C;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IA6BpD;;OAEG;IACH,SAAS,CAAC,eAAe,CACvB,IAAI,EAAE,MAAM,EACZ,cAAc,GAAE,MAAM,EAAO,GAC5B,OAAO;IA+BV;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,cAAc,GAAE,MAAM,EAAO,GAC5B,MAAM,EAAE;IAeX;;OAEG;IACG,KAAK,CACT,MAAM,CAAC,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,sBAAsB,EACjC,UAAU,CAAC,EAAE,SAAS,EACtB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,WAAW,CAAC;IA2CvB;;OAEG;IACG,eAAe,CACnB,WAAW,EAAE,MAAM,EAAE,EACrB,MAAM,CAAC,EAAE,OAAO,EAChB,UAAU,CAAC,EAAE,SAAS,EACtB,cAAc,CAAC,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,WAAW,CAAC;IA4CvB;;OAEG;IACH,SAAS,CAAC,gBAAgB,CACxB,UAAU,EAAE,aAAa,EAAE,EAC3B,QAAQ,CAAC,EAAE,sBAAsB,GAChC,aAAa,EAAE;IAmDlB;;OAEG;cACa,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAe/D;;OAEG;cACa,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAetD;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,GAAG,OAAO;IAajE;;OAEG;IACH,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAelD;;OAEG;IACH,SAAS,CAAC,gBAAgB,CACxB,IAAI,EAAE,MAAM,GACX,UAAU,GAAG,WAAW,GAAG,QAAQ,GAAG,KAAK;IAc9C;;OAEG;IACH,SAAS,CAAC,aAAa,CACrB,IAAI,EAAE,MAAM,GACX,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,UAAU;CAO1E"}
|