vite-plugin-asset-manager 0.0.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/README.md +132 -0
- package/dist/client/assets/figtree-latin-ext-wght-normal-DCwSJGxG.woff2 +0 -0
- package/dist/client/assets/figtree-latin-wght-normal-D_ZTVpCC.woff2 +0 -0
- package/dist/client/assets/index-BGQcqNrG.js +144 -0
- package/dist/client/assets/index-u18B5UIt.css +1 -0
- package/dist/client/index.html +27 -0
- package/dist/index.cjs +1837 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +51 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +1796 -0
- package/dist/index.js.map +1 -0
- package/package.json +115 -0
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# vite-plugin-asset-manager
|
|
2
|
+
|
|
3
|
+
A visual asset management dashboard for Vite projects. Discover, browse, and manage all your media assets through a real-time web UI.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Asset Discovery** - Automatically scans and catalogs images, videos, audio, fonts, documents, and data files
|
|
12
|
+
- **Real-time Updates** - File changes reflected instantly via Server-Sent Events
|
|
13
|
+
- **Thumbnail Generation** - Sharp-powered thumbnails with dual-tier caching
|
|
14
|
+
- **Import Tracking** - See which files import each asset with click-to-open-in-editor
|
|
15
|
+
- **Duplicate Detection** - Content-based deduplication using MD5 hashing
|
|
16
|
+
- **Bulk Operations** - Multi-select for batch download (ZIP), copy paths, or delete
|
|
17
|
+
- **Keyboard Navigation** - Full keyboard support with vim-style bindings
|
|
18
|
+
- **Context Menu** - Right-click for quick actions (copy, reveal in Finder, delete, etc.)
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install vite-plugin-asset-manager -D
|
|
24
|
+
# or
|
|
25
|
+
pnpm add vite-plugin-asset-manager -D
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
// vite.config.ts
|
|
32
|
+
import { defineConfig } from 'vite'
|
|
33
|
+
import assetManager from 'vite-plugin-asset-manager'
|
|
34
|
+
|
|
35
|
+
export default defineConfig({
|
|
36
|
+
plugins: [assetManager()],
|
|
37
|
+
})
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Start your dev server and visit `/__asset_manager__/` or press `⌥⇧A` (Option+Shift+A) to toggle the floating panel.
|
|
41
|
+
|
|
42
|
+
## Configuration
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
assetManager({
|
|
46
|
+
base: '/__asset_manager__', // Dashboard URL path
|
|
47
|
+
include: ['src', 'public'], // Directories to scan
|
|
48
|
+
exclude: ['node_modules', '.git', 'dist'],
|
|
49
|
+
thumbnailSize: 200, // Thumbnail dimensions (px)
|
|
50
|
+
floatingIcon: true, // Show toggle button in host app
|
|
51
|
+
watch: true, // Enable real-time updates
|
|
52
|
+
launchEditor: 'code', // Editor for "Open in Editor" (code, cursor, webstorm, vim, etc.)
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Vite Framework Support
|
|
57
|
+
|
|
58
|
+
- [ ] Vanilla
|
|
59
|
+
- [ ] Vue
|
|
60
|
+
- [ ] React
|
|
61
|
+
- [ ] Preact
|
|
62
|
+
- [ ] Lit
|
|
63
|
+
- [ ] Svelte
|
|
64
|
+
- [ ] Solid
|
|
65
|
+
- [ ] Qwik
|
|
66
|
+
|
|
67
|
+
## Asset Types
|
|
68
|
+
|
|
69
|
+
| Type | Extensions |
|
|
70
|
+
|------|------------|
|
|
71
|
+
| Image | png, jpg, jpeg, gif, svg, webp, avif, ico, bmp, tiff, heic |
|
|
72
|
+
| Video | mp4, webm, ogg, mov, avi |
|
|
73
|
+
| Audio | mp3, wav, flac, aac |
|
|
74
|
+
| Document | pdf, doc, docx, xls, xlsx, ppt, pptx |
|
|
75
|
+
| Font | woff, woff2, ttf, otf, eot |
|
|
76
|
+
| Data | json, csv, xml, yml, yaml, toml |
|
|
77
|
+
| Text | md, txt |
|
|
78
|
+
|
|
79
|
+
## Keyboard Shortcuts
|
|
80
|
+
|
|
81
|
+
| Action | Shortcut |
|
|
82
|
+
|--------|----------|
|
|
83
|
+
| Navigate grid | `←` `↑` `→` `↓` or `j`/`k` |
|
|
84
|
+
| Focus search | `/` |
|
|
85
|
+
| Close preview | `Escape` |
|
|
86
|
+
| Toggle selection | `Space` |
|
|
87
|
+
| Open preview | `Enter` |
|
|
88
|
+
| Select all | `⌘A` / `Ctrl+A` |
|
|
89
|
+
| Copy paths | `⌘C` / `Ctrl+C` |
|
|
90
|
+
| Open in editor | `⌘O` / `Ctrl+O` |
|
|
91
|
+
| Reveal in Finder | `⌘⇧R` / `Ctrl+Shift+R` |
|
|
92
|
+
| Delete | `Delete` / `Backspace` |
|
|
93
|
+
|
|
94
|
+
## API Endpoints
|
|
95
|
+
|
|
96
|
+
The plugin exposes these endpoints at `{base}/api/`:
|
|
97
|
+
|
|
98
|
+
| Endpoint | Method | Description |
|
|
99
|
+
|----------|--------|-------------|
|
|
100
|
+
| `/assets` | GET | List all assets |
|
|
101
|
+
| `/assets/grouped` | GET | Assets grouped by directory |
|
|
102
|
+
| `/search?q=` | GET | Search by name/path |
|
|
103
|
+
| `/thumbnail?path=` | GET | Get image thumbnail |
|
|
104
|
+
| `/file?path=` | GET | Serve original file |
|
|
105
|
+
| `/stats` | GET | Asset statistics |
|
|
106
|
+
| `/importers?path=` | GET | Files importing the asset |
|
|
107
|
+
| `/duplicates?hash=` | GET | Assets with matching content hash |
|
|
108
|
+
| `/open-in-editor` | POST | Open file in editor |
|
|
109
|
+
| `/reveal-in-finder` | POST | Reveal in system file explorer |
|
|
110
|
+
| `/bulk-download` | POST | Download as ZIP |
|
|
111
|
+
| `/bulk-delete` | POST | Delete multiple assets |
|
|
112
|
+
| `/events` | GET | SSE stream for real-time updates |
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
pnpm install # Install dependencies
|
|
118
|
+
pnpm run build # Build UI + plugin
|
|
119
|
+
pnpm run dev # Watch mode
|
|
120
|
+
|
|
121
|
+
# Testing
|
|
122
|
+
pnpm run test # Run all tests
|
|
123
|
+
pnpm run test:watch # Watch mode
|
|
124
|
+
pnpm run test:coverage
|
|
125
|
+
|
|
126
|
+
# Playground
|
|
127
|
+
cd playground && pnpm run dev
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT
|
|
Binary file
|
|
Binary file
|