@magentrix-corp/magentrix-cli 1.3.7 → 1.3.9
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 +47 -47
- package/actions/iris/buildStage.js +47 -33
- package/actions/iris/delete.js +5 -5
- package/actions/iris/dev.js +3 -3
- package/actions/iris/link.js +2 -2
- package/actions/iris/recover.js +3 -3
- package/bin/magentrix.js +16 -16
- package/package.json +1 -1
- package/utils/iris/builder.js +1 -1
- package/utils/iris/linker.js +1 -1
package/README.md
CHANGED
|
@@ -367,7 +367,7 @@ src/
|
|
|
367
367
|
|
|
368
368
|
> **⚠️ IMPORTANT: Deleting Iris Apps**
|
|
369
369
|
>
|
|
370
|
-
> **NEVER manually delete folders from `src/iris-apps/`!** Always use the `magentrix iris-delete` command to remove Iris apps. Manual deletion will cause:
|
|
370
|
+
> **NEVER manually delete folders from `src/iris-apps/`!** Always use the `magentrix iris-app-delete` command to remove Iris apps. Manual deletion will cause:
|
|
371
371
|
> - No recovery backup created (you cannot restore the app)
|
|
372
372
|
> - App remains on the Magentrix server (orphaned)
|
|
373
373
|
> - Cache becomes out of sync (causes errors on next publish)
|
|
@@ -375,7 +375,7 @@ src/
|
|
|
375
375
|
>
|
|
376
376
|
> **Correct way to delete an Iris app:**
|
|
377
377
|
> ```bash
|
|
378
|
-
> magentrix iris-delete
|
|
378
|
+
> magentrix iris-app-delete
|
|
379
379
|
> ```
|
|
380
380
|
|
|
381
381
|
### File Extensions
|
|
@@ -454,7 +454,7 @@ The tool supports all file types including:
|
|
|
454
454
|
|
|
455
455
|
MagentrixCLI supports deploying Vue.js applications (Iris apps) to your Magentrix instance. These apps are built with Vue.js and Module Federation, allowing you to create custom frontend experiences.
|
|
456
456
|
|
|
457
|
-
> **⚠️ CRITICAL: Always use `magentrix iris-delete` to remove Iris apps!**
|
|
457
|
+
> **⚠️ CRITICAL: Always use `magentrix iris-app-delete` to remove Iris apps!**
|
|
458
458
|
>
|
|
459
459
|
> Never manually delete folders from `src/iris-apps/`. Manual deletion bypasses backups, leaves orphaned apps on the server, and corrupts the cache. See [Deleting an Iris app](#delete-an-iris-app) for proper deletion.
|
|
460
460
|
|
|
@@ -469,7 +469,7 @@ The Iris deployment workflow:
|
|
|
469
469
|
|
|
470
470
|
#### Link a Vue Project
|
|
471
471
|
```bash
|
|
472
|
-
magentrix iris-link
|
|
472
|
+
magentrix iris-app-link
|
|
473
473
|
```
|
|
474
474
|
**What it does**: Opens an interactive menu to manage linked Vue.js projects. Projects are stored globally so they persist across Magentrix workspaces.
|
|
475
475
|
|
|
@@ -487,7 +487,7 @@ magentrix iris-link
|
|
|
487
487
|
|
|
488
488
|
#### Build and Stage
|
|
489
489
|
```bash
|
|
490
|
-
magentrix vue-build
|
|
490
|
+
magentrix vue-run-build
|
|
491
491
|
```
|
|
492
492
|
**What it does**: Builds a linked Vue project and copies the output to `src/iris-apps/<slug>/` for publishing.
|
|
493
493
|
|
|
@@ -511,7 +511,7 @@ magentrix vue-build-stage
|
|
|
511
511
|
|
|
512
512
|
#### Vue Development Server
|
|
513
513
|
```bash
|
|
514
|
-
magentrix run-dev
|
|
514
|
+
magentrix vue-run-dev
|
|
515
515
|
```
|
|
516
516
|
**What it does**: Starts the Vue development server with platform assets (CSS, fonts) automatically injected from your Magentrix instance.
|
|
517
517
|
|
|
@@ -528,7 +528,7 @@ magentrix run-dev
|
|
|
528
528
|
|
|
529
529
|
#### Delete an Iris App
|
|
530
530
|
```bash
|
|
531
|
-
magentrix iris-delete
|
|
531
|
+
magentrix iris-app-delete
|
|
532
532
|
```
|
|
533
533
|
**What it does**: Safely delete a published Iris app with automatic recovery backup.
|
|
534
534
|
|
|
@@ -544,11 +544,11 @@ magentrix iris-delete
|
|
|
544
544
|
**Safety features:**
|
|
545
545
|
- Automatic backup before deletion
|
|
546
546
|
- Must type slug name to confirm
|
|
547
|
-
- Recovery possible with `iris-recover`
|
|
547
|
+
- Recovery possible with `iris-app-recover`
|
|
548
548
|
|
|
549
549
|
#### Recover a Deleted App
|
|
550
550
|
```bash
|
|
551
|
-
magentrix iris-recover
|
|
551
|
+
magentrix iris-app-recover
|
|
552
552
|
```
|
|
553
553
|
**What it does**: Restore a deleted Iris app from automatic backup.
|
|
554
554
|
|
|
@@ -585,7 +585,7 @@ export const config = {
|
|
|
585
585
|
```bash
|
|
586
586
|
VITE_SITE_URL = https://yourinstance.magentrix.com
|
|
587
587
|
VITE_REFRESH_TOKEN = your-api-key
|
|
588
|
-
VITE_ASSETS = '[]' # Injected automatically by run-dev
|
|
588
|
+
VITE_ASSETS = '[]' # Injected automatically by vue-run-dev
|
|
589
589
|
```
|
|
590
590
|
|
|
591
591
|
**Accepted field names in config.ts:**
|
|
@@ -597,14 +597,14 @@ VITE_ASSETS = '[]' # Injected automatically by run-dev
|
|
|
597
597
|
### Command Availability
|
|
598
598
|
|
|
599
599
|
**In Vue project directories** (detected by presence of `config.ts`):
|
|
600
|
-
- ✓ `magentrix iris-link` - Link project to CLI
|
|
601
|
-
- ✓ `magentrix vue-build
|
|
602
|
-
- ✓ `magentrix run-dev` - Start dev server (uses `.env.development` credentials)
|
|
600
|
+
- ✓ `magentrix iris-app-link` - Link project to CLI
|
|
601
|
+
- ✓ `magentrix vue-run-build` - Build and stage (prompts for target workspace)
|
|
602
|
+
- ✓ `magentrix vue-run-dev` - Start dev server (uses `.env.development` credentials)
|
|
603
603
|
- ✓ `magentrix update` - Update CLI to latest version
|
|
604
604
|
|
|
605
605
|
**In Magentrix workspace directories** (has `.magentrix/` folder):
|
|
606
606
|
- ✓ All standard commands (`setup`, `pull`, `publish`, etc.)
|
|
607
|
-
- ✓ All Iris commands (`vue-build
|
|
607
|
+
- ✓ All Iris commands (`vue-run-build`, `iris-app-delete`, `iris-app-recover`, etc.)
|
|
608
608
|
|
|
609
609
|
**Note**: The `setup` command cannot be run inside a Vue project directory - run it from your Magentrix workspace. Commands like `pull`, `publish`, `autopublish` require a Magentrix workspace.
|
|
610
610
|
|
|
@@ -612,31 +612,31 @@ VITE_ASSETS = '[]' # Injected automatically by run-dev
|
|
|
612
612
|
|
|
613
613
|
```bash
|
|
614
614
|
# First time setup
|
|
615
|
-
magentrix iris-link # Link your Vue project
|
|
615
|
+
magentrix iris-app-link # Link your Vue project
|
|
616
616
|
|
|
617
617
|
# Development (run from Vue project folder)
|
|
618
618
|
cd ~/my-vue-app # Work from your Vue project
|
|
619
|
-
magentrix run-dev # Start dev server with platform assets
|
|
619
|
+
magentrix vue-run-dev # Start dev server with platform assets
|
|
620
620
|
# Make changes, test locally
|
|
621
621
|
# Press Ctrl+C to stop
|
|
622
622
|
|
|
623
623
|
# Deployment - Option A (from Vue project folder)
|
|
624
624
|
cd ~/my-vue-app # Work from your Vue project
|
|
625
|
-
magentrix vue-build
|
|
625
|
+
magentrix vue-run-build # Build and select workspace to stage into
|
|
626
626
|
# Prompted: "Do you want to publish to Magentrix now?" → Yes/No
|
|
627
627
|
|
|
628
628
|
# Deployment - Option B (from Magentrix workspace)
|
|
629
629
|
cd ~/magentrix-workspace # Navigate to Magentrix workspace
|
|
630
|
-
magentrix vue-build
|
|
630
|
+
magentrix vue-run-build --path ~/my-vue-app # Build and stage
|
|
631
631
|
# Prompted: "Do you want to publish to Magentrix now?" → Yes/No
|
|
632
632
|
# If autopublish is running, it auto-deploys instead
|
|
633
633
|
|
|
634
634
|
# Deleting an app (from workspace)
|
|
635
|
-
magentrix iris-delete # Select app, confirm, auto-backup created
|
|
635
|
+
magentrix iris-app-delete # Select app, confirm, auto-backup created
|
|
636
636
|
magentrix publish # Sync deletion to server
|
|
637
637
|
|
|
638
638
|
# Recovering a deleted app (from workspace)
|
|
639
|
-
magentrix iris-recover # Select backup, restore files
|
|
639
|
+
magentrix iris-app-recover # Select backup, restore files
|
|
640
640
|
magentrix publish # Sync recovery to server
|
|
641
641
|
```
|
|
642
642
|
|
|
@@ -649,39 +649,39 @@ For automatic deployment during development:
|
|
|
649
649
|
magentrix autopublish
|
|
650
650
|
|
|
651
651
|
# Terminal 2: Build and stage after making changes
|
|
652
|
-
magentrix vue-build
|
|
652
|
+
magentrix vue-run-build
|
|
653
653
|
# Autopublish will detect the changes and upload automatically
|
|
654
654
|
```
|
|
655
655
|
|
|
656
656
|
### Troubleshooting Iris Apps
|
|
657
657
|
|
|
658
|
-
#### Running vue-build
|
|
658
|
+
#### Running vue-run-build from different locations
|
|
659
659
|
|
|
660
|
-
The `vue-build
|
|
660
|
+
The `vue-run-build` command works from both locations:
|
|
661
661
|
|
|
662
662
|
**From Vue project directory:**
|
|
663
663
|
```bash
|
|
664
664
|
cd ~/my-vue-app
|
|
665
|
-
magentrix vue-build
|
|
665
|
+
magentrix vue-run-build # Prompts for which workspace to stage into
|
|
666
666
|
```
|
|
667
667
|
|
|
668
668
|
**From Magentrix workspace:**
|
|
669
669
|
```bash
|
|
670
670
|
cd ~/magentrix-workspace
|
|
671
|
-
magentrix vue-build
|
|
672
|
-
# Or with path: magentrix vue-build
|
|
671
|
+
magentrix vue-run-build # Prompts for which Vue project to build
|
|
672
|
+
# Or with path: magentrix vue-run-build --path ~/my-vue-app
|
|
673
673
|
```
|
|
674
674
|
|
|
675
675
|
#### "No Magentrix workspaces found"
|
|
676
676
|
When running from a Vue project, the command looks for registered workspaces in the global config. To register a workspace:
|
|
677
677
|
1. Navigate to your Magentrix workspace
|
|
678
678
|
2. Run `magentrix setup` (this automatically registers it)
|
|
679
|
-
3. Or specify workspace manually: `magentrix vue-build
|
|
679
|
+
3. Or specify workspace manually: `magentrix vue-run-build --workspace /path/to/workspace`
|
|
680
680
|
|
|
681
681
|
**Note**: Existing workspaces are auto-registered when you run any command from them.
|
|
682
682
|
|
|
683
683
|
#### "Publishing Iris apps from an out-of-sync workspace is not allowed"
|
|
684
|
-
When running `vue-build
|
|
684
|
+
When running `vue-run-build` from a Vue project, the CLI checks if the target workspace is in sync with the server. If there are pending remote changes, you must pull first.
|
|
685
685
|
|
|
686
686
|
**Why this is required:**
|
|
687
687
|
- Prevents deployment conflicts
|
|
@@ -691,7 +691,7 @@ When running `vue-build-stage` from a Vue project, the CLI checks if the target
|
|
|
691
691
|
**To resolve:**
|
|
692
692
|
1. Navigate to the workspace: `cd /path/to/workspace`
|
|
693
693
|
2. Pull latest changes: `magentrix pull`
|
|
694
|
-
3. Re-run `vue-build
|
|
694
|
+
3. Re-run `vue-run-build` from your Vue project
|
|
695
695
|
|
|
696
696
|
#### "Missing required field in config.ts: slug (appPath)"
|
|
697
697
|
Your Vue project's `config.ts` is missing the app identifier. Add an `appPath` or `slug` field.
|
|
@@ -720,9 +720,9 @@ The CLI looks for config in these locations:
|
|
|
720
720
|
#### Deleting an Iris app
|
|
721
721
|
To remove an Iris app:
|
|
722
722
|
```bash
|
|
723
|
-
magentrix iris-delete
|
|
723
|
+
magentrix iris-app-delete
|
|
724
724
|
```
|
|
725
|
-
This creates an automatic recovery backup before deletion. You can restore using `magentrix iris-recover`.
|
|
725
|
+
This creates an automatic recovery backup before deletion. You can restore using `magentrix iris-app-recover`.
|
|
726
726
|
|
|
727
727
|
**Permission errors:**
|
|
728
728
|
If you get "Permission Denied" when deleting local files:
|
|
@@ -733,14 +733,14 @@ If you get "Permission Denied" when deleting local files:
|
|
|
733
733
|
#### Recovering a deleted app
|
|
734
734
|
To restore a deleted Iris app:
|
|
735
735
|
```bash
|
|
736
|
-
magentrix iris-recover --list # See all available backups
|
|
737
|
-
magentrix iris-recover # Select and restore a backup
|
|
736
|
+
magentrix iris-app-recover --list # See all available backups
|
|
737
|
+
magentrix iris-app-recover # Select and restore a backup
|
|
738
738
|
magentrix publish # Sync to server
|
|
739
739
|
```
|
|
740
740
|
|
|
741
741
|
**Important**: After recovery, you must run `magentrix publish` to sync the app back to the Magentrix server.
|
|
742
742
|
|
|
743
|
-
#### Changes not detected after vue-build
|
|
743
|
+
#### Changes not detected after vue-run-build
|
|
744
744
|
The CLI uses content hash tracking to detect changes. If you rebuild without changes, `magentrix publish` will show "All files are in sync — nothing to publish!" This is expected behavior and saves unnecessary uploads.
|
|
745
745
|
|
|
746
746
|
---
|
|
@@ -798,16 +798,16 @@ magentrix status # Verify everything is in sync
|
|
|
798
798
|
**Option A: From Vue project folder**
|
|
799
799
|
```bash
|
|
800
800
|
cd ~/my-vue-app # Navigate to your Vue project
|
|
801
|
-
magentrix iris-link # Link project (first time only)
|
|
802
|
-
magentrix vue-build
|
|
801
|
+
magentrix iris-app-link # Link project (first time only)
|
|
802
|
+
magentrix vue-run-build # Build and select workspace to stage into
|
|
803
803
|
# Prompted: "Do you want to publish to Magentrix now?" → Yes/No
|
|
804
804
|
```
|
|
805
805
|
|
|
806
806
|
**Option B: From Magentrix workspace**
|
|
807
807
|
```bash
|
|
808
808
|
cd ~/magentrix-workspace # Navigate to Magentrix workspace
|
|
809
|
-
magentrix iris-link --path ~/my-vue-app # Link project (first time only)
|
|
810
|
-
magentrix vue-build
|
|
809
|
+
magentrix iris-app-link --path ~/my-vue-app # Link project (first time only)
|
|
810
|
+
magentrix vue-run-build --path ~/my-vue-app # Build and stage
|
|
811
811
|
# Prompted: "Do you want to publish to Magentrix now?" (unless autopublish is running)
|
|
812
812
|
```
|
|
813
813
|
|
|
@@ -816,13 +816,13 @@ magentrix vue-build-stage --path ~/my-vue-app # Build and stage
|
|
|
816
816
|
### Deleting and Recovering Apps
|
|
817
817
|
```bash
|
|
818
818
|
# Delete an app (creates automatic backup)
|
|
819
|
-
magentrix iris-delete # Select app, confirm deletion
|
|
819
|
+
magentrix iris-app-delete # Select app, confirm deletion
|
|
820
820
|
|
|
821
821
|
# View available backups
|
|
822
|
-
magentrix iris-recover --list
|
|
822
|
+
magentrix iris-app-recover --list
|
|
823
823
|
|
|
824
824
|
# Recover a deleted app
|
|
825
|
-
magentrix iris-recover # Select backup, restore
|
|
825
|
+
magentrix iris-app-recover # Select backup, restore
|
|
826
826
|
magentrix publish # Sync recovery to server
|
|
827
827
|
```
|
|
828
828
|
|
|
@@ -1107,11 +1107,11 @@ magentrix status # Shows sync status
|
|
|
1107
1107
|
- `magentrix status` - Check sync status
|
|
1108
1108
|
- `magentrix autopublish` - Auto-sync mode
|
|
1109
1109
|
- `magentrix update` - Update to latest version
|
|
1110
|
-
- `magentrix iris-link` - Link Vue.js projects for deployment
|
|
1111
|
-
- `magentrix vue-build
|
|
1112
|
-
- `magentrix run-dev` - Start Vue dev server with platform assets
|
|
1113
|
-
- `magentrix iris-delete` - Delete an Iris app with recovery backup
|
|
1114
|
-
- `magentrix iris-recover` - Recover a deleted Iris app
|
|
1110
|
+
- `magentrix iris-app-link` - Link Vue.js projects for deployment
|
|
1111
|
+
- `magentrix vue-run-build` - Build and stage Vue.js apps
|
|
1112
|
+
- `magentrix vue-run-dev` - Start Vue dev server with platform assets
|
|
1113
|
+
- `magentrix iris-app-delete` - Delete an Iris app with recovery backup
|
|
1114
|
+
- `magentrix iris-app-recover` - Recover a deleted Iris app
|
|
1115
1115
|
|
|
1116
1116
|
---
|
|
1117
1117
|
|
|
@@ -1123,6 +1123,6 @@ Once you're comfortable with basic usage:
|
|
|
1123
1123
|
2. **Learn the autopublish workflow** for faster development
|
|
1124
1124
|
3. **Explore conflict resolution** if you work in a team
|
|
1125
1125
|
4. **Check out templates** created by the `create` command to understand best practices
|
|
1126
|
-
5. **Deploy Vue.js apps** using `iris-link`, `vue-build
|
|
1126
|
+
5. **Deploy Vue.js apps** using `iris-app-link`, `vue-run-build`, and `vue-run-dev` commands
|
|
1127
1127
|
|
|
1128
1128
|
Happy coding with MagentrixCLI! 🚀
|
|
@@ -66,7 +66,7 @@ function isMagentrixWorkspace() {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* vue-build
|
|
69
|
+
* vue-run-build command - Build a Vue project and stage to CLI workspace.
|
|
70
70
|
*
|
|
71
71
|
* Two modes of operation:
|
|
72
72
|
* 1. Run from Magentrix workspace: prompts for which Vue project to build
|
|
@@ -398,28 +398,9 @@ async function buildFromVueProject(options) {
|
|
|
398
398
|
console.log(chalk.green('\u2713 Build output validated'));
|
|
399
399
|
}
|
|
400
400
|
|
|
401
|
-
//
|
|
401
|
+
// Check if workspace might be out of sync and offer to pull first (BEFORE staging)
|
|
402
|
+
// This ensures pull doesn't overwrite our staged files
|
|
402
403
|
console.log();
|
|
403
|
-
console.log(chalk.blue(`Staging to workspace: ${workspacePath}`));
|
|
404
|
-
|
|
405
|
-
const stageResult = stageToWorkspace(distPath, slug, workspacePath);
|
|
406
|
-
|
|
407
|
-
if (!stageResult.success) {
|
|
408
|
-
console.log(chalk.red(`Failed to stage: ${stageResult.error}`));
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
console.log(chalk.green(`\u2713 Staged ${stageResult.fileCount} files to ${stageResult.stagedPath}`));
|
|
413
|
-
|
|
414
|
-
// Summary
|
|
415
|
-
console.log();
|
|
416
|
-
console.log(chalk.green('─'.repeat(48)));
|
|
417
|
-
console.log(chalk.green.bold('\u2713 Build & Stage Complete!'));
|
|
418
|
-
console.log();
|
|
419
|
-
console.log(chalk.gray(`Staged to: ${stageResult.stagedPath}`));
|
|
420
|
-
console.log();
|
|
421
|
-
|
|
422
|
-
// Check if workspace might be out of sync and offer to pull first
|
|
423
404
|
console.log(chalk.gray('Checking workspace sync status...'));
|
|
424
405
|
const syncStatus = await checkWorkspaceSyncStatus(workspacePath);
|
|
425
406
|
|
|
@@ -444,7 +425,7 @@ async function buildFromVueProject(options) {
|
|
|
444
425
|
console.log(chalk.yellow('Pull encountered issues. You may want to resolve them manually.'));
|
|
445
426
|
|
|
446
427
|
const continueAnyway = await confirm({
|
|
447
|
-
message: 'Do you still want to continue with publishing?',
|
|
428
|
+
message: 'Do you still want to continue with staging and publishing?',
|
|
448
429
|
default: false
|
|
449
430
|
});
|
|
450
431
|
|
|
@@ -453,7 +434,8 @@ async function buildFromVueProject(options) {
|
|
|
453
434
|
console.log(chalk.cyan('To continue manually:'));
|
|
454
435
|
console.log(chalk.white(` 1. Navigate to workspace: ${chalk.yellow(`cd "${workspacePath}"`)}`));
|
|
455
436
|
console.log(chalk.white(` 2. Run ${chalk.yellow('magentrix pull')} to resolve conflicts`));
|
|
456
|
-
console.log(chalk.white(` 3. Run ${chalk.yellow('magentrix
|
|
437
|
+
console.log(chalk.white(` 3. Run ${chalk.yellow('magentrix vue-run-build --skip-build')} to stage`));
|
|
438
|
+
console.log(chalk.white(` 4. Run ${chalk.yellow('magentrix publish')} to deploy`));
|
|
457
439
|
return;
|
|
458
440
|
}
|
|
459
441
|
}
|
|
@@ -474,6 +456,27 @@ async function buildFromVueProject(options) {
|
|
|
474
456
|
console.log(chalk.green('✓ Workspace is in sync'));
|
|
475
457
|
}
|
|
476
458
|
|
|
459
|
+
// Stage to selected workspace (AFTER pull to avoid overwriting)
|
|
460
|
+
console.log();
|
|
461
|
+
console.log(chalk.blue(`Staging to workspace: ${workspacePath}`));
|
|
462
|
+
|
|
463
|
+
const stageResult = stageToWorkspace(distPath, slug, workspacePath);
|
|
464
|
+
|
|
465
|
+
if (!stageResult.success) {
|
|
466
|
+
console.log(chalk.red(`Failed to stage: ${stageResult.error}`));
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
console.log(chalk.green(`\u2713 Staged ${stageResult.fileCount} files to ${stageResult.stagedPath}`));
|
|
471
|
+
|
|
472
|
+
// Summary
|
|
473
|
+
console.log();
|
|
474
|
+
console.log(chalk.green('─'.repeat(48)));
|
|
475
|
+
console.log(chalk.green.bold('\u2713 Build & Stage Complete!'));
|
|
476
|
+
console.log();
|
|
477
|
+
console.log(chalk.gray(`Staged to: ${stageResult.stagedPath}`));
|
|
478
|
+
console.log();
|
|
479
|
+
|
|
477
480
|
// Ask if they want to publish now
|
|
478
481
|
const shouldPublish = await confirm({
|
|
479
482
|
message: 'Do you want to publish to Magentrix now?',
|
|
@@ -530,13 +533,24 @@ async function checkWorkspaceSyncStatus(workspacePath) {
|
|
|
530
533
|
});
|
|
531
534
|
|
|
532
535
|
child.on('close', (code) => {
|
|
533
|
-
// Check output for
|
|
536
|
+
// Check output for specific issue indicators from status command
|
|
537
|
+
// Note: We avoid checking for "remote" as it appears in normal output
|
|
538
|
+
// ("Checking local files vs remote Magentrix...")
|
|
534
539
|
const lowerOutput = output.toLowerCase();
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
+
|
|
541
|
+
// If everything is in sync, this message appears
|
|
542
|
+
const isInSync = lowerOutput.includes('all files are up to date') ||
|
|
543
|
+
lowerOutput.includes('in sync');
|
|
544
|
+
|
|
545
|
+
// Check for specific issue keywords from logFileStatus output
|
|
546
|
+
const hasConflict = lowerOutput.includes('conflict');
|
|
547
|
+
const isOutdated = lowerOutput.includes('outdated');
|
|
548
|
+
const isAhead = lowerOutput.includes('is ahead');
|
|
549
|
+
const isMissing = lowerOutput.includes('is missing');
|
|
550
|
+
const hasContentMismatch = lowerOutput.includes('content mismatch');
|
|
551
|
+
const hasWarnings = lowerOutput.includes('⚠️') || lowerOutput.includes('🛑');
|
|
552
|
+
|
|
553
|
+
const needsPull = !isInSync && (hasConflict || isOutdated || isAhead || isMissing || hasContentMismatch || hasWarnings);
|
|
540
554
|
|
|
541
555
|
resolvePromise({ checked: code === 0, needsPull });
|
|
542
556
|
});
|
|
@@ -593,7 +607,7 @@ async function selectWorkspace() {
|
|
|
593
607
|
console.log(chalk.white(` • Or run ${chalk.cyan('magentrix setup')} in a new directory to create one`));
|
|
594
608
|
console.log();
|
|
595
609
|
console.log(chalk.gray('Or specify a workspace path directly:'));
|
|
596
|
-
console.log(chalk.white(` ${chalk.cyan('magentrix vue-build
|
|
610
|
+
console.log(chalk.white(` ${chalk.cyan('magentrix vue-run-build --workspace /path/to/workspace')}`));
|
|
597
611
|
console.log();
|
|
598
612
|
|
|
599
613
|
// Allow manual entry
|
|
@@ -711,8 +725,8 @@ async function selectProject() {
|
|
|
711
725
|
console.log(chalk.yellow('No linked Vue projects found.'));
|
|
712
726
|
console.log();
|
|
713
727
|
console.log(chalk.gray('To get started:'));
|
|
714
|
-
console.log(chalk.white(` 1. Link a Vue project: ${chalk.cyan('magentrix iris-link')}`));
|
|
715
|
-
console.log(chalk.white(` 2. Or specify path: ${chalk.cyan('magentrix vue-build
|
|
728
|
+
console.log(chalk.white(` 1. Link a Vue project: ${chalk.cyan('magentrix iris-app-link')}`));
|
|
729
|
+
console.log(chalk.white(` 2. Or specify path: ${chalk.cyan('magentrix vue-run-build --path /path/to/vue-project')}`));
|
|
716
730
|
console.log();
|
|
717
731
|
}
|
|
718
732
|
|
package/actions/iris/delete.js
CHANGED
|
@@ -12,7 +12,7 @@ import { EXPORT_ROOT, IRIS_APPS_DIR } from '../../vars/global.js';
|
|
|
12
12
|
const config = new Config();
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* iris-delete command - Delete a published Iris app with backup and recovery.
|
|
15
|
+
* iris-app-delete command - Delete a published Iris app with backup and recovery.
|
|
16
16
|
*/
|
|
17
17
|
export const irisDelete = async () => {
|
|
18
18
|
process.stdout.write('\x1Bc'); // Clear console
|
|
@@ -41,7 +41,7 @@ export const irisDelete = async () => {
|
|
|
41
41
|
console.log(chalk.yellow('No published Iris apps found.'));
|
|
42
42
|
console.log();
|
|
43
43
|
console.log(chalk.gray('Published apps appear here after running:'));
|
|
44
|
-
console.log(chalk.white(` 1. ${chalk.cyan('magentrix vue-build
|
|
44
|
+
console.log(chalk.white(` 1. ${chalk.cyan('magentrix vue-run-build')}`));
|
|
45
45
|
console.log(chalk.white(` 2. ${chalk.cyan('magentrix publish')}`));
|
|
46
46
|
console.log();
|
|
47
47
|
return;
|
|
@@ -81,7 +81,7 @@ export const irisDelete = async () => {
|
|
|
81
81
|
console.log(chalk.red(` • Navigation menu entry on Magentrix`));
|
|
82
82
|
console.log();
|
|
83
83
|
console.log(chalk.yellow('A recovery backup will be created before deletion.'));
|
|
84
|
-
console.log(chalk.gray('You can restore using: ') + chalk.cyan('magentrix iris-recover'));
|
|
84
|
+
console.log(chalk.gray('You can restore using: ') + chalk.cyan('magentrix iris-app-recover'));
|
|
85
85
|
console.log(chalk.red('─'.repeat(48)));
|
|
86
86
|
console.log();
|
|
87
87
|
|
|
@@ -142,7 +142,7 @@ export const irisDelete = async () => {
|
|
|
142
142
|
|
|
143
143
|
if (!deleteResult.success && deleteResult.error !== 'App not found on server (already deleted)') {
|
|
144
144
|
console.log(chalk.red(`Failed to delete from server: ${deleteResult.error}`));
|
|
145
|
-
console.log(chalk.yellow('Backup preserved. Use ') + chalk.cyan('magentrix iris-recover') + chalk.yellow(' to restore.'));
|
|
145
|
+
console.log(chalk.yellow('Backup preserved. Use ') + chalk.cyan('magentrix iris-app-recover') + chalk.yellow(' to restore.'));
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -204,7 +204,7 @@ export const irisDelete = async () => {
|
|
|
204
204
|
console.log();
|
|
205
205
|
console.log(chalk.cyan('Recovery:'));
|
|
206
206
|
console.log(chalk.white(` Backup saved to: ${chalk.gray(backupResult.backupPath)}`));
|
|
207
|
-
console.log(chalk.white(` To restore, run: ${chalk.cyan('magentrix iris-recover')}`));
|
|
207
|
+
console.log(chalk.white(` To restore, run: ${chalk.cyan('magentrix iris-app-recover')}`));
|
|
208
208
|
console.log();
|
|
209
209
|
};
|
|
210
210
|
|
package/actions/iris/dev.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from '../../utils/iris/linker.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* run-dev command - Start Vue dev server with platform assets injected.
|
|
21
|
+
* vue-run-dev command - Start Vue dev server with platform assets injected.
|
|
22
22
|
*
|
|
23
23
|
* Uses credentials from .env.development (VITE_REFRESH_TOKEN, VITE_SITE_URL).
|
|
24
24
|
* Assets are updated in .env.development (VITE_ASSETS) and kept between runs.
|
|
@@ -233,8 +233,8 @@ async function selectProject() {
|
|
|
233
233
|
console.log(chalk.yellow('No linked Vue projects found.'));
|
|
234
234
|
console.log();
|
|
235
235
|
console.log(chalk.gray('To get started:'));
|
|
236
|
-
console.log(chalk.white(` 1. Link a Vue project: ${chalk.cyan('magentrix iris-link')}`));
|
|
237
|
-
console.log(chalk.white(` 2. Or specify path: ${chalk.cyan('magentrix run-dev --path /path/to/vue-project')}`));
|
|
236
|
+
console.log(chalk.white(` 1. Link a Vue project: ${chalk.cyan('magentrix iris-app-link')}`));
|
|
237
|
+
console.log(chalk.white(` 2. Or specify path: ${chalk.cyan('magentrix vue-run-dev --path /path/to/vue-project')}`));
|
|
238
238
|
console.log();
|
|
239
239
|
}
|
|
240
240
|
|
package/actions/iris/link.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { formatMissingConfigError, formatConfigErrors, readVueConfig } from '../../utils/iris/config-reader.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* iris-link command - Link a Vue project to the CLI.
|
|
15
|
+
* iris-app-link command - Link a Vue project to the CLI.
|
|
16
16
|
*
|
|
17
17
|
* Options:
|
|
18
18
|
* --path <dir> Specify Vue project path directly
|
|
@@ -265,7 +265,7 @@ async function linkProjectDirect(projectPath) {
|
|
|
265
265
|
console.log(chalk.green(`\u2713 Project linked successfully!`));
|
|
266
266
|
console.log();
|
|
267
267
|
console.log(chalk.cyan('Next steps:'));
|
|
268
|
-
console.log(chalk.white(` 1. Build and stage: ${chalk.yellow('magentrix vue-build
|
|
268
|
+
console.log(chalk.white(` 1. Build and stage: ${chalk.yellow('magentrix vue-run-build')}`));
|
|
269
269
|
console.log(chalk.white(` 2. Publish to server: ${chalk.yellow('magentrix publish')}`));
|
|
270
270
|
console.log(chalk.white(` Or use ${chalk.yellow('magentrix autopublish')} for automatic publishing`));
|
|
271
271
|
}
|
package/actions/iris/recover.js
CHANGED
|
@@ -8,7 +8,7 @@ import { showPermissionError } from '../../utils/permissionError.js';
|
|
|
8
8
|
import { EXPORT_ROOT, IRIS_APPS_DIR } from '../../vars/global.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* iris-recover command - Restore a deleted Iris app from backup.
|
|
11
|
+
* iris-app-recover command - Restore a deleted Iris app from backup.
|
|
12
12
|
*
|
|
13
13
|
* Options:
|
|
14
14
|
* --list List all available backups
|
|
@@ -29,7 +29,7 @@ export const irisRecover = async (options = {}) => {
|
|
|
29
29
|
console.log(chalk.yellow('No recovery backups found.'));
|
|
30
30
|
console.log();
|
|
31
31
|
console.log(chalk.gray('Backups are created automatically when you delete an Iris app.'));
|
|
32
|
-
console.log(chalk.white(`Use: ${chalk.cyan('magentrix iris-delete')}`));
|
|
32
|
+
console.log(chalk.white(`Use: ${chalk.cyan('magentrix iris-app-delete')}`));
|
|
33
33
|
console.log();
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
@@ -50,7 +50,7 @@ export const irisRecover = async (options = {}) => {
|
|
|
50
50
|
console.log();
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
console.log(chalk.white(`To recover, run: ${chalk.cyan('magentrix iris-recover')}`));
|
|
53
|
+
console.log(chalk.white(`To recover, run: ${chalk.cyan('magentrix iris-app-recover')}`));
|
|
54
54
|
console.log();
|
|
55
55
|
return;
|
|
56
56
|
}
|
package/bin/magentrix.js
CHANGED
|
@@ -47,9 +47,9 @@ function requireMagentrixWorkspace(fn) {
|
|
|
47
47
|
console.error(chalk.yellow('It looks like you\'re in a Vue project directory.'));
|
|
48
48
|
console.error(chalk.gray('This command requires a Magentrix workspace with global API key and instance URL.\n'));
|
|
49
49
|
console.error(chalk.cyan('Available commands in Vue projects:'));
|
|
50
|
-
console.error(chalk.gray(' • magentrix iris-link'));
|
|
51
|
-
console.error(chalk.gray(' • magentrix vue-build
|
|
52
|
-
console.error(chalk.gray(' • magentrix run-dev'));
|
|
50
|
+
console.error(chalk.gray(' • magentrix iris-app-link'));
|
|
51
|
+
console.error(chalk.gray(' • magentrix vue-run-build'));
|
|
52
|
+
console.error(chalk.gray(' • magentrix vue-run-dev'));
|
|
53
53
|
console.error(chalk.gray(' • magentrix update\n'));
|
|
54
54
|
process.exit(1);
|
|
55
55
|
}
|
|
@@ -150,11 +150,11 @@ program
|
|
|
150
150
|
{ name: 'publish', desc: 'Publish pending changes to the remote server', icon: '📤 ' },
|
|
151
151
|
{ name: 'autopublish', desc: 'Watch & sync changes in real time', icon: '🔄 ' },
|
|
152
152
|
{ name: 'update', desc: 'Update MagentrixCLI to the latest version', icon: '⬆️ ' },
|
|
153
|
-
{ name: 'iris-link', desc: 'Link a Vue project to the CLI', icon: '🔗 ' },
|
|
154
|
-
{ name: 'vue-build
|
|
155
|
-
{ name: 'run-dev', desc: 'Start Vue dev server with platform assets', icon: '🌐 ' },
|
|
156
|
-
{ name: 'iris-delete', desc: 'Delete an Iris app with backup', icon: '🗑️ ' },
|
|
157
|
-
{ name: 'iris-recover', desc: 'Recover a deleted Iris app from backup', icon: '♻️ ' }
|
|
153
|
+
{ name: 'iris-app-link', desc: 'Link a Vue project to the CLI', icon: '🔗 ' },
|
|
154
|
+
{ name: 'vue-run-build', desc: 'Build Vue project and stage for publish', icon: '🏗️ ' },
|
|
155
|
+
{ name: 'vue-run-dev', desc: 'Start Vue dev server with platform assets', icon: '🌐 ' },
|
|
156
|
+
{ name: 'iris-app-delete', desc: 'Delete an Iris app with backup', icon: '🗑️ ' },
|
|
157
|
+
{ name: 'iris-app-recover', desc: 'Recover a deleted Iris app from backup', icon: '♻️ ' }
|
|
158
158
|
];
|
|
159
159
|
|
|
160
160
|
const maxNameLen = Math.max(...commands.map(c => c.name.length));
|
|
@@ -285,7 +285,7 @@ program
|
|
|
285
285
|
|
|
286
286
|
// Iris commands for Vue.js app management
|
|
287
287
|
program
|
|
288
|
-
.command('iris-link')
|
|
288
|
+
.command('iris-app-link')
|
|
289
289
|
.description('Link a Vue project to the CLI for deployment')
|
|
290
290
|
.option('--path <path>', 'Path to the Vue project')
|
|
291
291
|
.option('--unlink', 'Unlink a project instead of linking')
|
|
@@ -294,7 +294,7 @@ program
|
|
|
294
294
|
.action(irisLink);
|
|
295
295
|
|
|
296
296
|
program
|
|
297
|
-
.command('vue-build
|
|
297
|
+
.command('vue-run-build')
|
|
298
298
|
.description('Build a Vue project and stage it for publishing')
|
|
299
299
|
.option('--path <path>', 'Path to the Vue project')
|
|
300
300
|
.option('--skip-build', 'Skip build step and use existing dist/')
|
|
@@ -302,19 +302,19 @@ program
|
|
|
302
302
|
.action(vueBuildStage);
|
|
303
303
|
|
|
304
304
|
program
|
|
305
|
-
.command('run-dev')
|
|
305
|
+
.command('vue-run-dev')
|
|
306
306
|
.description('Start Vue dev server with platform assets injected')
|
|
307
307
|
.option('--path <path>', 'Path to the Vue project')
|
|
308
308
|
.option('--no-inject', 'Skip asset injection')
|
|
309
309
|
.action(irisDev);
|
|
310
310
|
|
|
311
311
|
program
|
|
312
|
-
.command('iris-delete')
|
|
312
|
+
.command('iris-app-delete')
|
|
313
313
|
.description('Delete a published Iris app with recovery backup')
|
|
314
314
|
.action(irisDelete);
|
|
315
315
|
|
|
316
316
|
program
|
|
317
|
-
.command('iris-recover')
|
|
317
|
+
.command('iris-app-recover')
|
|
318
318
|
.description('Recover a deleted Iris app from backup')
|
|
319
319
|
.option('--list', 'List available recovery backups')
|
|
320
320
|
.action(irisRecover);
|
|
@@ -328,9 +328,9 @@ program.argument('[command]', 'command to run').action((cmd) => {
|
|
|
328
328
|
console.error(chalk.yellow('It looks like you\'re in a Vue project directory.'));
|
|
329
329
|
console.error(chalk.gray('This command requires a Magentrix workspace with global API key and instance URL.\n'));
|
|
330
330
|
console.error(chalk.cyan('Available commands in Vue projects:'));
|
|
331
|
-
console.error(chalk.gray(' • magentrix iris-link'));
|
|
332
|
-
console.error(chalk.gray(' • magentrix vue-build
|
|
333
|
-
console.error(chalk.gray(' • magentrix run-dev'));
|
|
331
|
+
console.error(chalk.gray(' • magentrix iris-app-link'));
|
|
332
|
+
console.error(chalk.gray(' • magentrix vue-run-build'));
|
|
333
|
+
console.error(chalk.gray(' • magentrix vue-run-dev'));
|
|
334
334
|
console.error(chalk.gray(' • magentrix update\n'));
|
|
335
335
|
process.exit(1);
|
|
336
336
|
}
|
package/package.json
CHANGED
package/utils/iris/builder.js
CHANGED
package/utils/iris/linker.js
CHANGED
|
@@ -378,7 +378,7 @@ export function updateLastBuild(slug) {
|
|
|
378
378
|
*/
|
|
379
379
|
export function formatLinkedProjects(projects) {
|
|
380
380
|
if (!projects || projects.length === 0) {
|
|
381
|
-
return 'No Vue projects linked.\n\nUse `magentrix iris-link` to link a project.';
|
|
381
|
+
return 'No Vue projects linked.\n\nUse `magentrix iris-app-link` to link a project.';
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
const lines = [
|