sanity-plugin-smart-asset-manager 1.0.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Code Journey
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,109 @@
1
+ # Sanity Plugin Smart Asset Manager
2
+
3
+ [![npm version](https://img.shields.io/npm/v/sanity-plugin-smart-asset-manager.svg?style=flat-square)](https://www.npmjs.com/package/sanity-plugin-smart-asset-manager)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
5
+
6
+ An advanced, premium asset management dashboard for Sanity Studio. Stop guessing which assets are bloating your projectโ€”take full control of your media library with smart analysis, bulk cleanup tools, and deep usage tracking.
7
+
8
+ ---
9
+
10
+ ## โœจ Features
11
+
12
+ ### ๐Ÿ” Advanced Filtering & Sorting
13
+
14
+ Easily navigate through your media library. Filter by **Images**, **Videos**, **Audio**, and other file types. Use the built-in size filters to find **Small (<100KB)**, **Medium (100KB-1MB)**, or **Large (>1MB)** files instantly.
15
+
16
+ ![All Assets Dashboard](src/assets/images/all-assets.png)
17
+
18
+ ### ๐Ÿ“Š Image Size Analyzer
19
+
20
+ Identify performance bottlenecks. The Analyzer tab lists your assets by weight and dimensions. You can sort by file size (Weight) to quickly find unoptimized images that are slowing down your site.
21
+
22
+ ![Size Analyzer](src/assets/images/size-analyzer.png)
23
+
24
+ ### ๐Ÿงน Unused Asset Detector & Bulk Cleanup
25
+
26
+ Keep your dataset lean and save on storage costs.
27
+
28
+ - **Smart Detection**: Automatically finds assets not referenced by any document.
29
+ - **Multi-Select**: Use checkboxes to select specific assets for deletion.
30
+ - **Bulk Delete**: Delete all or selected unused assets with a single click after a safety confirmation.
31
+
32
+ ![Unused Assets Cleanup](src/assets/images/unused-assets.png)
33
+
34
+ ### ๐Ÿ›ก๏ธ Duplicate Prevention
35
+
36
+ Stop uploading the same file twice. The plugin automatically checks for existing filenames during upload and warns you if a duplicate is detected, keeping your library clean and organized.
37
+
38
+ ### ๐Ÿ”— Deep Usage Tracking
39
+
40
+ Never delete a critical asset by mistake. Click any asset to see exactly which documents are referencing it. You can even click a document in the usage list to jump straight to the editor.
41
+
42
+ ![Usage Details](src/assets/images/details-popup.png)
43
+
44
+ ### โšก Batch Uploads
45
+
46
+ Upload multiple files at once. The plugin provides clear progress feedback and handles batch processing efficiently, with a smart 1-second delay after completion to ensure Sanity's backend has indexed your new files.
47
+
48
+ ---
49
+
50
+ ## ๐Ÿ“ฆ Installation
51
+
52
+ ```bash
53
+ npm install sanity-plugin-smart-asset-manager
54
+ # or
55
+ yarn add sanity-plugin-smart-asset-manager
56
+ # or
57
+ pnpm add sanity-plugin-smart-asset-manager
58
+ ```
59
+
60
+ ---
61
+
62
+ ## ๐Ÿ›  Usage
63
+
64
+ 1. Add the plugin to your `sanity.config.ts` (or `.js`):
65
+
66
+ ```typescript
67
+ import {defineConfig} from 'sanity'
68
+ import {smartAssetManager} from 'sanity-plugin-smart-asset-manager'
69
+
70
+ export default defineConfig({
71
+ // ...
72
+ plugins: [
73
+ smartAssetManager(),
74
+ // ...
75
+ ],
76
+ })
77
+ ```
78
+
79
+ 2. Open your Sanity Studio. You will see a new **Smart Asset Manager** tool in your navigation bar.
80
+
81
+ ---
82
+
83
+ ## ๐Ÿš€ Why This Plugin?
84
+
85
+ Sanity's default media library is great for selection, but maintenance can be challenging as libraries grow. **Smart Asset Manager** provides the power tools needed for:
86
+
87
+ - **Performance Optimization**: Find and replace heavy assets.
88
+ - **Cost Management**: Remove gigabytes of unused files.
89
+ - **Workflow Efficiency**: Batch upload and deep usage insights.
90
+
91
+ ---
92
+
93
+ ## ๐Ÿ› ๏ธ Development & Building
94
+
95
+ To build the plugin locally:
96
+
97
+ ```bash
98
+ npm run build
99
+ ```
100
+
101
+ The plugin uses `tsup` for lightning-fast ESM and CJS builds with declaration types.
102
+
103
+ ---
104
+
105
+ ## ๐Ÿ“„ License
106
+
107
+ [MIT](LICENSE) ยฉ [Code Journey](https://github.com/Code-Journey-77)
108
+
109
+ ---
@@ -0,0 +1,5 @@
1
+ import * as sanity from 'sanity';
2
+
3
+ declare const smartAssetManager: sanity.Plugin<void>;
4
+
5
+ export { smartAssetManager };
@@ -0,0 +1,5 @@
1
+ import * as sanity from 'sanity';
2
+
3
+ declare const smartAssetManager: sanity.Plugin<void>;
4
+
5
+ export { smartAssetManager };