@mediaproc/cli 0.5.0 ā 0.5.2
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 +191 -72
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/delete.d.ts +7 -0
- package/dist/commands/delete.d.ts.map +1 -0
- package/dist/commands/delete.js +248 -0
- package/dist/commands/delete.js.map +1 -0
- package/dist/commands/update.d.ts +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +181 -86
- package/dist/commands/update.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,52 +1,16 @@
|
|
|
1
1
|
# MediaProc
|
|
2
2
|
|
|
3
|
-
> ⨠**v0.3.0 Released!** - Config System + Auto-Init + Enhanced Plugin Management
|
|
4
|
-
|
|
5
3
|
Universal media processing CLI with an extensible plugin architecture. One tool to process all your media - images, videos, audio, documents, and more.
|
|
6
4
|
|
|
7
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.npmjs.com/package/@mediaproc/cli)
|
|
8
7
|
[](https://nodejs.org/)
|
|
9
8
|
[](https://www.typescriptlang.org/)
|
|
10
|
-
[](https://github.com/0xshariq/mediaproc)
|
|
11
10
|
[](CONTRIBUTING.md)
|
|
12
11
|
|
|
13
12
|
---
|
|
14
13
|
|
|
15
|
-
## š What's New in v0.3.0
|
|
16
|
-
|
|
17
|
-
**Major improvements to configuration and plugin management:**
|
|
18
|
-
|
|
19
|
-
### šļø Configuration System
|
|
20
|
-
- **Global Config**: Configuration now lives in `~/.mediaproc/config.json` (not project-specific)
|
|
21
|
-
- **Auto-initialization**: Config is automatically created on first run
|
|
22
|
-
- **Plugin Tracking**: System now tracks installed and loaded plugins separately
|
|
23
|
-
- **Better State Management**: No more manual package.json scanning
|
|
24
|
-
|
|
25
|
-
### š§ Enhanced Commands
|
|
26
|
-
- **`mediaproc init`**: Initialize or reset configuration with `--reset` flag
|
|
27
|
-
- **`mediaproc config show`**: Beautiful display of config with plugin status
|
|
28
|
-
- **`mediaproc config path`**: Quickly find your config file location
|
|
29
|
-
- **`mediaproc config get <key>`**: Get specific config values
|
|
30
|
-
|
|
31
|
-
### šÆ Improved Plugin Management
|
|
32
|
-
- **Smart Detection**: System automatically detects plugin installation/loading status
|
|
33
|
-
- **Config Integration**: Add/remove commands update config state automatically
|
|
34
|
-
- **Status Indicators**: Universal commands show plugin status (loaded/installed/not installed)
|
|
35
|
-
- **Cleaner Architecture**: Removed redundant plugin discovery logic
|
|
36
|
-
|
|
37
|
-
### š Bug Fixes
|
|
38
|
-
- Fixed unused variable warnings in plugin-manager
|
|
39
|
-
- Improved plugin prefix detection
|
|
40
|
-
- Better error handling in config operations
|
|
41
|
-
- Cleaner import statements
|
|
42
|
-
|
|
43
|
-
### š Breaking Changes
|
|
44
|
-
- Config file moved from `./mediaproc.config.json` to `~/.mediaproc/config.json`
|
|
45
|
-
- Run `mediaproc init` to create new config structure
|
|
46
|
-
- Old project-level configs need manual migration (or just reinstall plugins)
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
14
|
## š Table of Contents
|
|
51
15
|
|
|
52
16
|
- [The Problem](#-the-problem)
|
|
@@ -164,25 +128,42 @@ mediaproc document compress input.pdf --quality high
|
|
|
164
128
|
|
|
165
129
|
## š Current Status
|
|
166
130
|
|
|
167
|
-
**Version**: 0.2
|
|
131
|
+
**Version**: 0.5.2 (Beta - Production Ready!)
|
|
168
132
|
**Status**: ā
Image plugin with 49 commands + Universal CLI commands
|
|
169
133
|
**Next Release**: Video & Audio plugins (Q1 2026)
|
|
170
134
|
**Expected v1.0**: Q2 2026
|
|
171
135
|
|
|
172
136
|
### Plugin Management
|
|
173
137
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- `mediaproc
|
|
177
|
-
- `mediaproc
|
|
178
|
-
- `mediaproc
|
|
179
|
-
- `mediaproc
|
|
138
|
+
MediaProc provides comprehensive plugin lifecycle management:
|
|
139
|
+
|
|
140
|
+
- `mediaproc list` - List all installed plugins with versions
|
|
141
|
+
- `mediaproc add <plugin>` - Install plugins from npm registry
|
|
142
|
+
- `mediaproc remove <plugin>` - Safely uninstall plugins
|
|
143
|
+
- `mediaproc delete <plugin>` - Delete plugins (alias for remove)
|
|
144
|
+
- `mediaproc update [plugin]` - Update plugin(s) to latest versions
|
|
145
|
+
- Without plugin name: updates all installed plugins
|
|
146
|
+
- With plugin name: updates specific plugin
|
|
147
|
+
- Shows version changes and update summary
|
|
148
|
+
- `mediaproc validate [plugin]` - Validate plugin installation and integrity
|
|
149
|
+
- Check plugin structure and dependencies
|
|
150
|
+
- Verify command registrations
|
|
151
|
+
- Detect issues before execution
|
|
180
152
|
|
|
181
153
|
### Universal Commands (Work Without Plugins)
|
|
182
154
|
|
|
155
|
+
Core CLI commands available immediately after installation:
|
|
156
|
+
|
|
157
|
+
**Media Operations:**
|
|
183
158
|
- `mediaproc convert <input> <output>` - Auto-detect and convert any media file
|
|
184
|
-
- `mediaproc info <file>` -
|
|
185
|
-
- `mediaproc optimize <file>` -
|
|
159
|
+
- `mediaproc info <file>` - Display comprehensive file information
|
|
160
|
+
- `mediaproc optimize <file>` - Analyze and suggest optimization strategies
|
|
161
|
+
|
|
162
|
+
**Help & Configuration:**
|
|
163
|
+
- `mediaproc help [command]` - Show help for commands
|
|
164
|
+
- `mediaproc init` - Initialize configuration file
|
|
165
|
+
- `mediaproc config` - Manage configuration settings
|
|
166
|
+
- `mediaproc run <command>` - Execute plugin commands
|
|
186
167
|
|
|
187
168
|
### Image Processing (@mediaproc/image)
|
|
188
169
|
|
|
@@ -376,6 +357,15 @@ mediaproc-image resize photo.jpg -w 1920
|
|
|
376
357
|
- `mediaproc list` - List all plugins (built-in and installed)
|
|
377
358
|
- `mediaproc add <plugin>` - Install add-on plugins from npm
|
|
378
359
|
- `mediaproc remove <plugin>` - Uninstall add-on plugins
|
|
360
|
+
- `mediaproc delete <plugin>` - Delete/uninstall plugins (alias: uninstall)
|
|
361
|
+
- `--global` - Delete globally installed plugin
|
|
362
|
+
- `--local` - Delete locally installed plugin
|
|
363
|
+
- `--yes` - Skip confirmation prompt
|
|
364
|
+
- `--verbose` - Show detailed output
|
|
365
|
+
- `mediaproc update [plugin]` - Update plugin(s) to latest version
|
|
366
|
+
- `--version <version>` - Update to specific version
|
|
367
|
+
- `--global` - Update globally installed plugins
|
|
368
|
+
- `--verbose` - Show detailed output
|
|
379
369
|
- `mediaproc plugins` - Show available plugins
|
|
380
370
|
- `mediaproc init` - Initialize configuration
|
|
381
371
|
- `mediaproc config` - Manage settings
|
|
@@ -418,35 +408,25 @@ mediaproc-image resize photo.jpg -w 1920
|
|
|
418
408
|
- `vignette` - Darken edges for artistic focus
|
|
419
409
|
- `pixelate` - Retro pixel art effect (custom pixel size)
|
|
420
410
|
|
|
421
|
-
**Advanced Operations** (
|
|
411
|
+
**Advanced Operations** (6 commands)
|
|
422
412
|
|
|
423
|
-
- `composite` - Layer images with blend modes
|
|
424
|
-
- `extract` - Extract color channels
|
|
425
|
-
- `border` - Add decorative frames
|
|
413
|
+
- `composite` - Layer images with blend modes
|
|
414
|
+
- `extract` - Extract color channels or regions
|
|
415
|
+
- `border` - Add decorative frames
|
|
426
416
|
- `clahe` - Contrast-limited adaptive histogram equalization
|
|
427
|
-
- `convolve` - Apply custom convolution kernels
|
|
428
|
-
|
|
429
|
-
**Smart/AI Operations** (6 commands)
|
|
430
|
-
|
|
431
|
-
- `smart-crop` - Intelligent content-aware cropping (attention/entropy)
|
|
432
|
-
- `auto-enhance` - Automatic color and contrast enhancement
|
|
433
|
-
- `palette` - Extract dominant color palettes (2-256 colors)
|
|
434
|
-
- `dominant-color` - Quick dominant color extraction
|
|
435
|
-
- `grid` - Combine images into collage layouts
|
|
436
|
-
- `batch` - Process multiple images at once with any operation
|
|
417
|
+
- `convolve` - Apply custom convolution kernels
|
|
418
|
+
- `text` - Add text overlays with styling
|
|
437
419
|
|
|
438
|
-
**Utility** (
|
|
420
|
+
**Utility & Metadata** (8 commands)
|
|
439
421
|
|
|
440
|
-
- `convert` - Format conversion
|
|
441
|
-
- `optimize` -
|
|
442
|
-
- `compress` - Advanced compression
|
|
443
|
-
- `watermark` - Add watermarks with positioning
|
|
444
|
-
- `info` - Display
|
|
445
|
-
- `
|
|
446
|
-
- `
|
|
447
|
-
- `
|
|
448
|
-
- `mirror` - Create mirror/kaleidoscope effects
|
|
449
|
-
- `metadata` - View, export, or remove EXIF data
|
|
422
|
+
- `convert` - Format conversion
|
|
423
|
+
- `optimize` - Smart size optimization
|
|
424
|
+
- `compress` - Advanced compression control
|
|
425
|
+
- `watermark` - Add watermarks with positioning
|
|
426
|
+
- `info` - Display image metadata
|
|
427
|
+
- `metadata` - Manage EXIF/IPTC data
|
|
428
|
+
- `thumbnail` - Generate optimized thumbnails
|
|
429
|
+
- `stats` - Technical image statistics
|
|
450
430
|
|
|
451
431
|
**Format Support:**
|
|
452
432
|
|
|
@@ -584,6 +564,10 @@ mediaproc add video # Video processing
|
|
|
584
564
|
mediaproc add audio # Audio processing
|
|
585
565
|
mediaproc add document # PDF processing
|
|
586
566
|
|
|
567
|
+
# Update plugins to latest version
|
|
568
|
+
mediaproc update # Update all plugins
|
|
569
|
+
mediaproc update image # Update specific plugin
|
|
570
|
+
|
|
587
571
|
# View all plugins (built-in + installed)
|
|
588
572
|
mediaproc list
|
|
589
573
|
|
|
@@ -680,6 +664,141 @@ mediaproc list
|
|
|
680
664
|
mediaproc image resize photo.jpg -w 800
|
|
681
665
|
```
|
|
682
666
|
|
|
667
|
+
### Updating Plugins
|
|
668
|
+
|
|
669
|
+
Keep plugins up-to-date for latest features and bug fixes:
|
|
670
|
+
|
|
671
|
+
```bash
|
|
672
|
+
# Update all installed plugins
|
|
673
|
+
mediaproc update
|
|
674
|
+
|
|
675
|
+
# Update specific plugin
|
|
676
|
+
mediaproc update image
|
|
677
|
+
mediaproc update video
|
|
678
|
+
|
|
679
|
+
# Update with scope control
|
|
680
|
+
mediaproc update --global # Global plugins only
|
|
681
|
+
mediaproc update image --local # Local plugin only
|
|
682
|
+
|
|
683
|
+
# Verbose output
|
|
684
|
+
mediaproc update --verbose
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
See full documentation for version control and advanced options.
|
|
688
|
+
- Example: `mediaproc-custom-filter`
|
|
689
|
+
- Full name required: `mediaproc update mediaproc-custom-filter`
|
|
690
|
+
|
|
691
|
+
3. **Third-Party Plugins** - ā THIRD-PARTY
|
|
692
|
+
- Any other npm package
|
|
693
|
+
- Full package name: `mediaproc update @company/plugin-name`
|
|
694
|
+
|
|
695
|
+
**What the update command does:**
|
|
696
|
+
|
|
697
|
+
1. **Detects Plugin Type**: Identifies official, community, or third-party plugins
|
|
698
|
+
2. **Detects Installation Scope**: Automatically determines if plugins are installed globally or locally
|
|
699
|
+
3. **Fetches Latest Versions**: Checks npm registry for the newest versions (or specific version)
|
|
700
|
+
4. **Updates Dependencies**: Uses the appropriate package manager (npm, pnpm, yarn, bun, deno)
|
|
701
|
+
5. **Shows Changes**: Displays version changes (old ā new)
|
|
702
|
+
6. **Auto-Reload**: Plugins are automatically available after update
|
|
703
|
+
|
|
704
|
+
**Examples:**
|
|
705
|
+
|
|
706
|
+
```bash
|
|
707
|
+
# Update all plugins (recommended)
|
|
708
|
+
$ mediaproc update
|
|
709
|
+
ā Updating all MediaProc plugins...
|
|
710
|
+
ā All MediaProc plugins updated successfully
|
|
711
|
+
|
|
712
|
+
# Update official plugin to latest
|
|
713
|
+
$ mediaproc update image
|
|
714
|
+
ā Detecting plugin type for image...
|
|
715
|
+
ā image ā
OFFICIAL updated successfully (1.2.0 ā 1.2.2)
|
|
716
|
+
|
|
717
|
+
# Update to specific version
|
|
718
|
+
$ mediaproc update image --version 1.2.1
|
|
719
|
+
ā image ā
OFFICIAL updated successfully (1.2.0 ā 1.2.1)
|
|
720
|
+
|
|
721
|
+
# Update community plugin
|
|
722
|
+
$ mediaproc update mediaproc-custom-filter
|
|
723
|
+
ā mediaproc-custom-filter ā COMMUNITY updated successfully
|
|
724
|
+
|
|
725
|
+
# Update with verbose output
|
|
726
|
+
$ mediaproc update image --verbose
|
|
727
|
+
ā¹ Package manager: pnpm
|
|
728
|
+
ā¹ Plugin type: ā
OFFICIAL
|
|
729
|
+
ā¹ Package name: @mediaproc/image
|
|
730
|
+
ā¹ Current version: 1.2.0
|
|
731
|
+
ā¹ Running: pnpm add @mediaproc/image
|
|
732
|
+
ā image ā
OFFICIAL updated successfully (1.2.0 ā 1.2.2)
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
**š Full Guide:** See [Plugin Terminology Guide](docs/plugin-terminology.md) for detailed explanations.
|
|
736
|
+
|
|
737
|
+
---
|
|
738
|
+
|
|
739
|
+
### Deleting Plugins
|
|
740
|
+
|
|
741
|
+
Remove plugins you no longer need to free up disk space:
|
|
742
|
+
|
|
743
|
+
```bash
|
|
744
|
+
# Delete a plugin (auto-detects installation scope)
|
|
745
|
+
mediaproc delete image
|
|
746
|
+
mediaproc delete video
|
|
747
|
+
|
|
748
|
+
# Delete specific scope
|
|
749
|
+
mediaproc delete image --global # Delete globally installed
|
|
750
|
+
mediaproc delete image --local # Delete locally installed
|
|
751
|
+
|
|
752
|
+
# Skip confirmation prompt
|
|
753
|
+
mediaproc delete image --yes # No confirmation
|
|
754
|
+
|
|
755
|
+
# Verbose output
|
|
756
|
+
mediaproc delete image --verbose # Show detailed information
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
**Plugin Type Detection:**
|
|
760
|
+
|
|
761
|
+
The delete command automatically detects and handles three types of plugins:
|
|
762
|
+
|
|
763
|
+
1. **Official Plugins** (`@mediaproc/*`) - ā
OFFICIAL
|
|
764
|
+
```bash
|
|
765
|
+
mediaproc delete image # Short name
|
|
766
|
+
mediaproc delete @mediaproc/image # Full name
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
2. **Community Plugins** (`mediaproc-*`) - ā COMMUNITY
|
|
770
|
+
```bash
|
|
771
|
+
mediaproc delete mediaproc-custom-filter # Full name required
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
3. **Third-Party Plugins** - ā THIRD-PARTY
|
|
775
|
+
```bash
|
|
776
|
+
mediaproc delete @company/plugin-name # Full package name
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
**What the delete command does:**
|
|
780
|
+
|
|
781
|
+
1. **Detects Plugin Type**: Identifies official, community, or third-party plugins
|
|
782
|
+
2. **Detects Installation Scope**: Automatically determines if plugin is installed globally or locally
|
|
783
|
+
3. **Confirms Deletion**: Shows confirmation prompt (skip with `--yes`)
|
|
784
|
+
4. **Uninstalls Package**: Uses the appropriate package manager (npm, pnpm, yarn, bun)
|
|
785
|
+
5. **Shows Status**: Displays deletion status with plugin type badge
|
|
786
|
+
6. **Frees Memory**: Removes all plugin files from disk
|
|
787
|
+
|
|
788
|
+
**Examples:**
|
|
789
|
+
|
|
790
|
+
```bash
|
|
791
|
+
# Delete a plugin
|
|
792
|
+
mediaproc delete image
|
|
793
|
+
mediaproc delete video --global
|
|
794
|
+
|
|
795
|
+
# Skip confirmation
|
|
796
|
+
mediaproc delete image --yes
|
|
797
|
+
|
|
798
|
+
# Alias: uninstall
|
|
799
|
+
mediaproc uninstall image
|
|
800
|
+
```
|
|
801
|
+
|
|
683
802
|
**š Full Guide:** See [Plugin Terminology Guide](docs/plugin-terminology.md) for detailed explanations.
|
|
684
803
|
|
|
685
804
|
---
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AA6CA,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAkCzC"}
|
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,7 @@ import { fileURLToPath } from 'url';
|
|
|
7
7
|
import { PluginManager } from './plugin-manager.js';
|
|
8
8
|
import { addCommand } from './commands/add.js';
|
|
9
9
|
import { removeCommand } from './commands/remove.js';
|
|
10
|
+
import { deleteCommand } from './commands/delete.js';
|
|
10
11
|
import { listCommand } from './commands/list.js';
|
|
11
12
|
import { pluginsCommand } from './commands/plugins.js';
|
|
12
13
|
import { helpCommand } from './commands/help.js';
|
|
@@ -45,6 +46,7 @@ export async function cli() {
|
|
|
45
46
|
// Plugin management commands
|
|
46
47
|
addCommand(program, pluginManager);
|
|
47
48
|
removeCommand(program, pluginManager);
|
|
49
|
+
deleteCommand(program, pluginManager);
|
|
48
50
|
listCommand(program, pluginManager);
|
|
49
51
|
pluginsCommand(program, pluginManager);
|
|
50
52
|
updateCommand(program);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAA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G,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/commands/delete.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAoIlD;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,GAAG,IAAI,CA0IlF"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
/**
|
|
5
|
+
* Detect plugin type and return full package name
|
|
6
|
+
*/
|
|
7
|
+
function detectPluginInfo(plugin, pluginManager) {
|
|
8
|
+
// Official plugin (@mediaproc/*)
|
|
9
|
+
if (plugin.startsWith('@mediaproc/')) {
|
|
10
|
+
return {
|
|
11
|
+
name: plugin,
|
|
12
|
+
type: 'official',
|
|
13
|
+
displayName: plugin.replace('@mediaproc/', ''),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// Community plugin (mediaproc-*)
|
|
17
|
+
if (plugin.startsWith('mediaproc-')) {
|
|
18
|
+
return {
|
|
19
|
+
name: plugin,
|
|
20
|
+
type: 'community',
|
|
21
|
+
displayName: plugin,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// Check if it's a short name for official plugin using plugin manager
|
|
25
|
+
if (!plugin.includes('/') && !plugin.includes('-')) {
|
|
26
|
+
const fullName = `${pluginManager.getPluginPrefix()}${plugin}`;
|
|
27
|
+
return {
|
|
28
|
+
name: fullName,
|
|
29
|
+
type: 'official',
|
|
30
|
+
displayName: plugin,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// Third-party plugin (any other package)
|
|
34
|
+
return {
|
|
35
|
+
name: plugin,
|
|
36
|
+
type: 'third-party',
|
|
37
|
+
displayName: plugin,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get plugin type badge for display
|
|
42
|
+
*/
|
|
43
|
+
function getPluginTypeBadge(type) {
|
|
44
|
+
switch (type) {
|
|
45
|
+
case 'official':
|
|
46
|
+
return chalk.blue('ā
OFFICIAL');
|
|
47
|
+
case 'community':
|
|
48
|
+
return chalk.green('ā COMMUNITY');
|
|
49
|
+
case 'third-party':
|
|
50
|
+
return chalk.yellow('ā THIRD-PARTY');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Detect which package manager is being used
|
|
55
|
+
*/
|
|
56
|
+
function detectPackageManager() {
|
|
57
|
+
try {
|
|
58
|
+
execSync('bun --version', { stdio: 'ignore' });
|
|
59
|
+
return 'bun';
|
|
60
|
+
}
|
|
61
|
+
catch { }
|
|
62
|
+
try {
|
|
63
|
+
execSync('pnpm --version', { stdio: 'ignore' });
|
|
64
|
+
return 'pnpm';
|
|
65
|
+
}
|
|
66
|
+
catch { }
|
|
67
|
+
try {
|
|
68
|
+
execSync('yarn --version', { stdio: 'ignore' });
|
|
69
|
+
return 'yarn';
|
|
70
|
+
}
|
|
71
|
+
catch { }
|
|
72
|
+
try {
|
|
73
|
+
execSync('deno --version', { stdio: 'ignore' });
|
|
74
|
+
return 'deno';
|
|
75
|
+
}
|
|
76
|
+
catch { }
|
|
77
|
+
return 'npm';
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Check if plugin is installed
|
|
81
|
+
*/
|
|
82
|
+
function isPluginInstalled(packageName, isGlobal) {
|
|
83
|
+
try {
|
|
84
|
+
const packageManager = detectPackageManager();
|
|
85
|
+
let cmd;
|
|
86
|
+
if (packageManager === 'npm') {
|
|
87
|
+
cmd = isGlobal
|
|
88
|
+
? `npm list -g ${packageName} --depth=0`
|
|
89
|
+
: `npm list ${packageName} --depth=0`;
|
|
90
|
+
}
|
|
91
|
+
else if (packageManager === 'pnpm') {
|
|
92
|
+
cmd = isGlobal
|
|
93
|
+
? `pnpm list -g ${packageName} --depth=0`
|
|
94
|
+
: `pnpm list ${packageName} --depth=0`;
|
|
95
|
+
}
|
|
96
|
+
else if (packageManager === 'yarn') {
|
|
97
|
+
cmd = isGlobal
|
|
98
|
+
? `yarn global list --pattern ${packageName}`
|
|
99
|
+
: `yarn list --pattern ${packageName}`;
|
|
100
|
+
}
|
|
101
|
+
else if (packageManager === 'bun') {
|
|
102
|
+
cmd = isGlobal
|
|
103
|
+
? `bun pm ls -g | grep ${packageName}`
|
|
104
|
+
: `bun pm ls | grep ${packageName}`;
|
|
105
|
+
}
|
|
106
|
+
else if (packageManager === 'deno') {
|
|
107
|
+
// Deno doesn't have traditional global/local installs
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
execSync(cmd, { stdio: 'ignore' });
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Delete/remove a plugin
|
|
122
|
+
*/
|
|
123
|
+
export function deleteCommand(program, pluginManager) {
|
|
124
|
+
program
|
|
125
|
+
.command('delete <plugin>')
|
|
126
|
+
.alias('uninstall')
|
|
127
|
+
.description('Delete/uninstall a plugin')
|
|
128
|
+
.option('-g, --global', 'Delete plugin globally')
|
|
129
|
+
.option('-l, --local', 'Delete plugin locally')
|
|
130
|
+
.option('--verbose', 'Show detailed output')
|
|
131
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
132
|
+
.action(async (plugin, options) => {
|
|
133
|
+
const spinner = ora('Starting deletion...').start();
|
|
134
|
+
try {
|
|
135
|
+
const pluginInfo = detectPluginInfo(plugin, pluginManager);
|
|
136
|
+
const packageManager = detectPackageManager();
|
|
137
|
+
if (options.verbose) {
|
|
138
|
+
spinner.info(chalk.dim(`Package manager: ${packageManager}`));
|
|
139
|
+
}
|
|
140
|
+
spinner.text = `Detecting plugin type for ${chalk.cyan(pluginInfo.displayName)}...`;
|
|
141
|
+
// Verify plugin type using plugin manager
|
|
142
|
+
const isOfficial = pluginManager.isOfficialPlugin(pluginInfo.name);
|
|
143
|
+
if (options.verbose) {
|
|
144
|
+
spinner.info(chalk.dim(`Plugin type: ${getPluginTypeBadge(pluginInfo.type)}`));
|
|
145
|
+
spinner.info(chalk.dim(`Package name: ${pluginInfo.name}`));
|
|
146
|
+
spinner.info(chalk.dim(`Official plugin: ${isOfficial ? 'Yes' : 'No'}`));
|
|
147
|
+
}
|
|
148
|
+
// Determine installation scope
|
|
149
|
+
let isGlobal = false;
|
|
150
|
+
if (options.global) {
|
|
151
|
+
isGlobal = true;
|
|
152
|
+
}
|
|
153
|
+
else if (options.local) {
|
|
154
|
+
isGlobal = false;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
// Auto-detect installation scope
|
|
158
|
+
spinner.text = 'Detecting installation scope...';
|
|
159
|
+
const installedGlobally = isPluginInstalled(pluginInfo.name, true);
|
|
160
|
+
const installedLocally = isPluginInstalled(pluginInfo.name, false);
|
|
161
|
+
if (installedGlobally && installedLocally) {
|
|
162
|
+
spinner.fail(chalk.yellow('ā Plugin found in both global and local scope'));
|
|
163
|
+
console.log(chalk.dim('Please specify:'));
|
|
164
|
+
console.log(chalk.white(' mediaproc delete ' + plugin + ' --global') + chalk.dim(' # Delete globally'));
|
|
165
|
+
console.log(chalk.white(' mediaproc delete ' + plugin + ' --local') + chalk.dim(' # Delete locally'));
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
else if (installedGlobally) {
|
|
169
|
+
isGlobal = true;
|
|
170
|
+
}
|
|
171
|
+
else if (installedLocally) {
|
|
172
|
+
isGlobal = false;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
spinner.fail(chalk.red(`ā Plugin ${chalk.cyan(pluginInfo.displayName)} is not installed`));
|
|
176
|
+
console.log(chalk.dim('\nCheck installed plugins: ') + chalk.white('mediaproc list'));
|
|
177
|
+
process.exit(1);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const scope = isGlobal ? 'globally' : 'locally';
|
|
181
|
+
spinner.succeed(chalk.green(`ā Found ${pluginInfo.displayName} ${getPluginTypeBadge(pluginInfo.type)} installed ${scope}`));
|
|
182
|
+
// Confirmation (unless --yes flag is provided)
|
|
183
|
+
if (!options.yes) {
|
|
184
|
+
console.log(chalk.yellow('\nā You are about to delete:'));
|
|
185
|
+
console.log(chalk.white(` Plugin: ${pluginInfo.name} ${getPluginTypeBadge(pluginInfo.type)}`));
|
|
186
|
+
console.log(chalk.white(` Scope: ${scope}`));
|
|
187
|
+
console.log(chalk.dim('\nPress Ctrl+C to cancel, or run with --yes to skip confirmation\n'));
|
|
188
|
+
// Wait 2 seconds for user to cancel
|
|
189
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
190
|
+
}
|
|
191
|
+
spinner.start(`Deleting ${chalk.cyan(pluginInfo.displayName)} ${getPluginTypeBadge(pluginInfo.type)} (${scope})...`);
|
|
192
|
+
// Build the delete command
|
|
193
|
+
let deleteCmd;
|
|
194
|
+
if (packageManager === 'npm') {
|
|
195
|
+
deleteCmd = isGlobal
|
|
196
|
+
? `npm uninstall -g ${pluginInfo.name}`
|
|
197
|
+
: `npm uninstall ${pluginInfo.name}`;
|
|
198
|
+
}
|
|
199
|
+
else if (packageManager === 'pnpm') {
|
|
200
|
+
deleteCmd = isGlobal
|
|
201
|
+
? `pnpm remove -g ${pluginInfo.name}`
|
|
202
|
+
: `pnpm remove ${pluginInfo.name}`;
|
|
203
|
+
}
|
|
204
|
+
else if (packageManager === 'yarn') {
|
|
205
|
+
deleteCmd = isGlobal
|
|
206
|
+
? `yarn global remove ${pluginInfo.name}`
|
|
207
|
+
: `yarn remove ${pluginInfo.name}`;
|
|
208
|
+
}
|
|
209
|
+
else if (packageManager === 'bun') {
|
|
210
|
+
deleteCmd = isGlobal
|
|
211
|
+
? `bun remove -g ${pluginInfo.name}`
|
|
212
|
+
: `bun remove ${pluginInfo.name}`;
|
|
213
|
+
}
|
|
214
|
+
else if (packageManager === 'deno') {
|
|
215
|
+
spinner.fail(chalk.red('Deno package management is not supported for plugin deletion'));
|
|
216
|
+
process.exit(1);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
throw new Error('Unknown package manager');
|
|
220
|
+
}
|
|
221
|
+
if (options.verbose) {
|
|
222
|
+
spinner.info(chalk.dim(`Running: ${deleteCmd}`));
|
|
223
|
+
}
|
|
224
|
+
// Execute the delete command
|
|
225
|
+
execSync(deleteCmd, {
|
|
226
|
+
stdio: options.verbose ? 'inherit' : 'ignore',
|
|
227
|
+
cwd: isGlobal ? undefined : process.cwd()
|
|
228
|
+
});
|
|
229
|
+
// Unload plugin from memory if it was loaded
|
|
230
|
+
if (pluginManager.getLoadedPlugins().includes(pluginInfo.name)) {
|
|
231
|
+
pluginManager.unloadPlugin(pluginInfo.name);
|
|
232
|
+
if (options.verbose) {
|
|
233
|
+
spinner.info(chalk.dim(`Unloaded ${pluginInfo.name} from memory`));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
spinner.succeed(chalk.green(`ā ${pluginInfo.displayName} ${getPluginTypeBadge(pluginInfo.type)} deleted successfully (${scope})`));
|
|
237
|
+
console.log(chalk.dim('\nš” View remaining plugins: ') + chalk.white('mediaproc list'));
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
spinner.fail(chalk.red('Failed to delete plugin'));
|
|
241
|
+
if (error instanceof Error) {
|
|
242
|
+
console.error(chalk.red(`Error: ${error.message}`));
|
|
243
|
+
}
|
|
244
|
+
process.exit(1);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
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,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6HzC;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqIpD"}
|
package/dist/commands/update.js
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
|
+
/**
|
|
5
|
+
* Detect plugin type and return full package name
|
|
6
|
+
*/
|
|
7
|
+
function detectPluginInfo(plugin) {
|
|
8
|
+
// Official plugin (@mediaproc/*)
|
|
9
|
+
if (plugin.startsWith('@mediaproc/')) {
|
|
10
|
+
return {
|
|
11
|
+
name: plugin,
|
|
12
|
+
type: 'official',
|
|
13
|
+
displayName: plugin.replace('@mediaproc/', ''),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// Community plugin (mediaproc-*)
|
|
17
|
+
if (plugin.startsWith('mediaproc-')) {
|
|
18
|
+
return {
|
|
19
|
+
name: plugin,
|
|
20
|
+
type: 'community',
|
|
21
|
+
displayName: plugin,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// Check if it's a short name for official plugin
|
|
25
|
+
if (!plugin.includes('/') && !plugin.includes('-')) {
|
|
26
|
+
return {
|
|
27
|
+
name: `@mediaproc/${plugin}`,
|
|
28
|
+
type: 'official',
|
|
29
|
+
displayName: plugin,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// Third-party plugin (any other package)
|
|
33
|
+
return {
|
|
34
|
+
name: plugin,
|
|
35
|
+
type: 'third-party',
|
|
36
|
+
displayName: plugin,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get plugin type badge for display
|
|
41
|
+
*/
|
|
42
|
+
function getPluginTypeBadge(type) {
|
|
43
|
+
switch (type) {
|
|
44
|
+
case 'official':
|
|
45
|
+
return chalk.blue('ā
OFFICIAL');
|
|
46
|
+
case 'community':
|
|
47
|
+
return chalk.green('ā COMMUNITY');
|
|
48
|
+
case 'third-party':
|
|
49
|
+
return chalk.yellow('ā THIRD-PARTY');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
4
52
|
/**
|
|
5
53
|
* Detect which package manager is being used
|
|
6
54
|
*/
|
|
@@ -23,107 +71,154 @@ function detectPackageManager() {
|
|
|
23
71
|
return 'npm';
|
|
24
72
|
}
|
|
25
73
|
/**
|
|
26
|
-
*
|
|
74
|
+
* Get current installed version of a package
|
|
75
|
+
*/
|
|
76
|
+
function getInstalledVersion(packageName, isGlobal) {
|
|
77
|
+
try {
|
|
78
|
+
const packageManager = detectPackageManager();
|
|
79
|
+
let cmd;
|
|
80
|
+
if (packageManager === 'npm') {
|
|
81
|
+
cmd = isGlobal
|
|
82
|
+
? `npm list -g ${packageName} --depth=0 --json`
|
|
83
|
+
: `npm list ${packageName} --depth=0 --json`;
|
|
84
|
+
}
|
|
85
|
+
else if (packageManager === 'pnpm') {
|
|
86
|
+
cmd = isGlobal
|
|
87
|
+
? `pnpm list -g ${packageName} --depth=0 --json`
|
|
88
|
+
: `pnpm list ${packageName} --depth=0 --json`;
|
|
89
|
+
}
|
|
90
|
+
else if (packageManager === 'yarn') {
|
|
91
|
+
cmd = isGlobal
|
|
92
|
+
? `yarn global list --pattern ${packageName} --json`
|
|
93
|
+
: `yarn list --pattern ${packageName} --json`;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const output = execSync(cmd, { encoding: 'utf-8', stdio: 'pipe' });
|
|
99
|
+
const data = JSON.parse(output);
|
|
100
|
+
if (data.dependencies && data.dependencies[packageName]) {
|
|
101
|
+
return data.dependencies[packageName].version;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Update a plugin to the latest version or specific version
|
|
27
111
|
*/
|
|
28
112
|
export function updateCommand(program) {
|
|
29
113
|
program
|
|
30
|
-
.command('update
|
|
31
|
-
.description('Update
|
|
114
|
+
.command('update [plugin]')
|
|
115
|
+
.description('Update plugin(s) to the latest or specific version')
|
|
32
116
|
.option('-g, --global', 'Update plugin globally')
|
|
117
|
+
.option('-v, --version <version>', 'Update to specific version (e.g., 1.2.3, latest)')
|
|
118
|
+
.option('--verbose', 'Show detailed output')
|
|
33
119
|
.action(async (plugin, options) => {
|
|
34
|
-
const spinner = ora('
|
|
35
|
-
try {
|
|
36
|
-
// Ensure plugin name starts with @mediaproc/
|
|
37
|
-
const pluginName = plugin.startsWith('@mediaproc/')
|
|
38
|
-
? plugin
|
|
39
|
-
: `@mediaproc/${plugin}`;
|
|
40
|
-
// Detect package manager
|
|
41
|
-
const packageManager = detectPackageManager();
|
|
42
|
-
const isGlobal = options.global;
|
|
43
|
-
spinner.text = `Updating ${chalk.cyan(pluginName)} using ${chalk.blue(packageManager)}...`;
|
|
44
|
-
// Build the update command based on package manager
|
|
45
|
-
let updateCmd;
|
|
46
|
-
if (packageManager === 'npm') {
|
|
47
|
-
updateCmd = isGlobal
|
|
48
|
-
? `npm update -g ${pluginName}`
|
|
49
|
-
: `npm update ${pluginName}`;
|
|
50
|
-
}
|
|
51
|
-
else if (packageManager === 'pnpm') {
|
|
52
|
-
updateCmd = isGlobal
|
|
53
|
-
? `pnpm update -g ${pluginName}`
|
|
54
|
-
: `pnpm update ${pluginName}`;
|
|
55
|
-
}
|
|
56
|
-
else if (packageManager === 'yarn') {
|
|
57
|
-
updateCmd = isGlobal
|
|
58
|
-
? `yarn global upgrade ${pluginName}`
|
|
59
|
-
: `yarn upgrade ${pluginName}`;
|
|
60
|
-
}
|
|
61
|
-
else if (packageManager === 'bun') {
|
|
62
|
-
updateCmd = isGlobal
|
|
63
|
-
? `bun update -g ${pluginName}`
|
|
64
|
-
: `bun update ${pluginName}`;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
throw new Error('Unknown package manager');
|
|
68
|
-
}
|
|
69
|
-
// Execute the update command
|
|
70
|
-
execSync(updateCmd, { stdio: 'inherit' });
|
|
71
|
-
spinner.succeed(chalk.green(`ā ${pluginName} updated successfully`));
|
|
72
|
-
console.log(chalk.dim('\nRestart your terminal or run a command to use the updated version.'));
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
spinner.fail(chalk.red('Failed to update plugin'));
|
|
76
|
-
if (error instanceof Error) {
|
|
77
|
-
console.error(chalk.red(error.message));
|
|
78
|
-
}
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
// Update all plugins command
|
|
83
|
-
program
|
|
84
|
-
.command('update-all')
|
|
85
|
-
.description('Update all installed @mediaproc plugins to the latest version')
|
|
86
|
-
.option('-g, --global', 'Update plugins globally')
|
|
87
|
-
.action(async (options) => {
|
|
88
|
-
const spinner = ora('Finding installed plugins...').start();
|
|
120
|
+
const spinner = ora('Starting update...').start();
|
|
89
121
|
try {
|
|
90
122
|
const packageManager = detectPackageManager();
|
|
91
123
|
const isGlobal = options.global;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (packageManager === 'npm') {
|
|
96
|
-
updateCmd = isGlobal
|
|
97
|
-
? 'npm update -g $(npm list -g --depth=0 --parseable | xargs -n1 basename | grep "^@mediaproc")'
|
|
98
|
-
: 'npm update';
|
|
99
|
-
}
|
|
100
|
-
else if (packageManager === 'pnpm') {
|
|
101
|
-
updateCmd = isGlobal
|
|
102
|
-
? 'pnpm update -g "@mediaproc/*"'
|
|
103
|
-
: 'pnpm update "@mediaproc/*"';
|
|
104
|
-
}
|
|
105
|
-
else if (packageManager === 'yarn') {
|
|
106
|
-
updateCmd = isGlobal
|
|
107
|
-
? 'yarn global upgrade "@mediaproc/*"'
|
|
108
|
-
: 'yarn upgrade "@mediaproc/*"';
|
|
124
|
+
const targetVersion = options.version || 'latest';
|
|
125
|
+
if (options.verbose) {
|
|
126
|
+
spinner.info(chalk.dim(`Package manager: ${packageManager}`));
|
|
109
127
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
128
|
+
// Update specific plugin
|
|
129
|
+
if (plugin) {
|
|
130
|
+
const pluginInfo = detectPluginInfo(plugin);
|
|
131
|
+
spinner.text = `Detecting plugin type for ${chalk.cyan(pluginInfo.displayName)}...`;
|
|
132
|
+
if (options.verbose) {
|
|
133
|
+
spinner.info(chalk.dim(`Plugin type: ${getPluginTypeBadge(pluginInfo.type)}`));
|
|
134
|
+
spinner.info(chalk.dim(`Package name: ${pluginInfo.name}`));
|
|
135
|
+
}
|
|
136
|
+
// Get current version
|
|
137
|
+
const currentVersion = getInstalledVersion(pluginInfo.name, isGlobal || false);
|
|
138
|
+
if (currentVersion && options.verbose) {
|
|
139
|
+
spinner.info(chalk.dim(`Current version: ${currentVersion}`));
|
|
140
|
+
}
|
|
141
|
+
spinner.text = `Updating ${chalk.cyan(pluginInfo.displayName)} ${getPluginTypeBadge(pluginInfo.type)}...`;
|
|
142
|
+
// Build the update command
|
|
143
|
+
const versionSpec = targetVersion === 'latest' ? pluginInfo.name : `${pluginInfo.name}@${targetVersion}`;
|
|
144
|
+
let updateCmd;
|
|
145
|
+
if (packageManager === 'npm') {
|
|
146
|
+
updateCmd = isGlobal
|
|
147
|
+
? `npm install -g ${versionSpec}`
|
|
148
|
+
: `npm install ${versionSpec}`;
|
|
149
|
+
}
|
|
150
|
+
else if (packageManager === 'pnpm') {
|
|
151
|
+
updateCmd = isGlobal
|
|
152
|
+
? `pnpm add -g ${versionSpec}`
|
|
153
|
+
: `pnpm add ${versionSpec}`;
|
|
154
|
+
}
|
|
155
|
+
else if (packageManager === 'yarn') {
|
|
156
|
+
updateCmd = isGlobal
|
|
157
|
+
? `yarn global add ${versionSpec}`
|
|
158
|
+
: `yarn add ${versionSpec}`;
|
|
159
|
+
}
|
|
160
|
+
else if (packageManager === 'bun') {
|
|
161
|
+
updateCmd = isGlobal
|
|
162
|
+
? `bun add -g ${versionSpec}`
|
|
163
|
+
: `bun add ${versionSpec}`;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
throw new Error('Unknown package manager');
|
|
167
|
+
}
|
|
168
|
+
if (options.verbose) {
|
|
169
|
+
spinner.info(chalk.dim(`Running: ${updateCmd}`));
|
|
170
|
+
}
|
|
171
|
+
// Execute the update command
|
|
172
|
+
execSync(updateCmd, { stdio: options.verbose ? 'inherit' : 'ignore' });
|
|
173
|
+
// Get new version
|
|
174
|
+
const newVersion = getInstalledVersion(pluginInfo.name, isGlobal || false);
|
|
175
|
+
spinner.succeed(chalk.green(`ā ${pluginInfo.displayName} ${getPluginTypeBadge(pluginInfo.type)} updated successfully`) +
|
|
176
|
+
(currentVersion && newVersion ? chalk.dim(` (${currentVersion} ā ${newVersion})`) : ''));
|
|
114
177
|
}
|
|
115
178
|
else {
|
|
116
|
-
|
|
179
|
+
// Update all plugins
|
|
180
|
+
spinner.text = 'Finding all installed MediaProc plugins...';
|
|
181
|
+
if (options.verbose) {
|
|
182
|
+
spinner.info(chalk.dim('Scanning for official, community, and third-party plugins...'));
|
|
183
|
+
}
|
|
184
|
+
// Build update command for all @mediaproc packages
|
|
185
|
+
let updateCmd;
|
|
186
|
+
if (packageManager === 'npm') {
|
|
187
|
+
updateCmd = isGlobal
|
|
188
|
+
? 'npm update -g $(npm list -g --depth=0 --parseable 2>/dev/null | xargs -n1 basename 2>/dev/null | grep -E "^@mediaproc|^mediaproc-")'
|
|
189
|
+
: 'npm update';
|
|
190
|
+
}
|
|
191
|
+
else if (packageManager === 'pnpm') {
|
|
192
|
+
updateCmd = isGlobal
|
|
193
|
+
? 'pnpm update -g "@mediaproc/*" "mediaproc-*"'
|
|
194
|
+
: 'pnpm update "@mediaproc/*" "mediaproc-*"';
|
|
195
|
+
}
|
|
196
|
+
else if (packageManager === 'yarn') {
|
|
197
|
+
updateCmd = isGlobal
|
|
198
|
+
? 'yarn global upgrade'
|
|
199
|
+
: 'yarn upgrade';
|
|
200
|
+
}
|
|
201
|
+
else if (packageManager === 'bun') {
|
|
202
|
+
updateCmd = isGlobal
|
|
203
|
+
? 'bun update -g'
|
|
204
|
+
: 'bun update';
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
throw new Error('Unknown package manager');
|
|
208
|
+
}
|
|
209
|
+
if (options.verbose) {
|
|
210
|
+
spinner.info(chalk.dim(`Running: ${updateCmd}`));
|
|
211
|
+
}
|
|
212
|
+
spinner.text = 'Updating all plugins...';
|
|
213
|
+
execSync(updateCmd, { stdio: options.verbose ? 'inherit' : 'ignore' });
|
|
214
|
+
spinner.succeed(chalk.green('ā All MediaProc plugins updated successfully'));
|
|
117
215
|
}
|
|
118
|
-
|
|
119
|
-
execSync(updateCmd, { stdio: 'inherit' });
|
|
120
|
-
spinner.succeed(chalk.green('ā All @mediaproc plugins updated successfully'));
|
|
121
|
-
console.log(chalk.dim('\nRestart your terminal or run a command to use the updated versions.'));
|
|
216
|
+
console.log(chalk.dim('\nš” Tip: Run a command to use the updated version, or restart your terminal.'));
|
|
122
217
|
}
|
|
123
218
|
catch (error) {
|
|
124
|
-
spinner.fail(chalk.red('Failed to update
|
|
219
|
+
spinner.fail(chalk.red('Failed to update plugin(s)'));
|
|
125
220
|
if (error instanceof Error) {
|
|
126
|
-
console.error(chalk.red(error.message));
|
|
221
|
+
console.error(chalk.red(`Error: ${error.message}`));
|
|
127
222
|
}
|
|
128
223
|
process.exit(1);
|
|
129
224
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAA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