@magentrix-corp/magentrix-cli 1.3.8 → 1.3.10
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 +89 -51
- package/actions/iris/buildStage.js +22 -11
- 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/config-reader.js +6 -6
- 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
|
|
|
@@ -573,7 +573,7 @@ Your Vue project needs two configuration files:
|
|
|
573
573
|
```typescript
|
|
574
574
|
// src/config.ts
|
|
575
575
|
export const config = {
|
|
576
|
-
|
|
576
|
+
appSlug: "my-app", // Required: App identifier (folder name on server)
|
|
577
577
|
appName: "My Application", // Required: Display name in navigation menu
|
|
578
578
|
appDescription: "", // Optional: App description
|
|
579
579
|
appIconId: "", // Optional: App icon ID
|
|
@@ -585,26 +585,58 @@ 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:**
|
|
592
|
-
- Slug: `
|
|
592
|
+
- Slug: `appSlug`, `slug`, or `app_slug`
|
|
593
593
|
- Name: `appName`, `app_name`, or `name`
|
|
594
594
|
- Description: `appDescription` or `app_description`
|
|
595
595
|
- Icon: `appIconId` or `app_icon_id`
|
|
596
596
|
|
|
597
|
+
#### Changing an App Slug
|
|
598
|
+
|
|
599
|
+
> **⚠️ Important:** Changing the `appSlug`/`slug` in `config.ts` creates a **new** Iris app on Magentrix. The old app is **not** automatically deleted.
|
|
600
|
+
|
|
601
|
+
If you simply change the slug and run `vue-run-build`, you'll end up with two apps on the server - the old one becomes orphaned.
|
|
602
|
+
|
|
603
|
+
**Recommended workflow for changing an app slug:**
|
|
604
|
+
|
|
605
|
+
```bash
|
|
606
|
+
# 1. Delete the old app first (from Magentrix workspace)
|
|
607
|
+
cd ~/magentrix-workspace
|
|
608
|
+
magentrix iris-app-delete # Select the old app, confirm deletion
|
|
609
|
+
# This removes it from server, local files, and cache
|
|
610
|
+
# Optionally unlink the Vue project when prompted
|
|
611
|
+
|
|
612
|
+
# 2. Change the slug in your Vue project
|
|
613
|
+
cd ~/my-vue-app
|
|
614
|
+
# Edit config.ts: change appSlug from "old-slug" to "new-slug"
|
|
615
|
+
|
|
616
|
+
# 3. Re-link the project with the new slug
|
|
617
|
+
magentrix iris-app-link # Updates the linked project with new slug
|
|
618
|
+
|
|
619
|
+
# 4. Build, stage, and publish
|
|
620
|
+
magentrix vue-run-build # Stages to new folder: src/iris-apps/new-slug/
|
|
621
|
+
# When prompted, choose to publish
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
**What happens if you don't follow this workflow:**
|
|
625
|
+
- Both `old-slug` and `new-slug` apps will exist on the server
|
|
626
|
+
- The old app remains in `src/iris-apps/old-slug/` locally
|
|
627
|
+
- You'll need to manually delete the old app using `magentrix iris-app-delete`
|
|
628
|
+
|
|
597
629
|
### Command Availability
|
|
598
630
|
|
|
599
631
|
**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)
|
|
632
|
+
- ✓ `magentrix iris-app-link` - Link project to CLI
|
|
633
|
+
- ✓ `magentrix vue-run-build` - Build and stage (prompts for target workspace)
|
|
634
|
+
- ✓ `magentrix vue-run-dev` - Start dev server (uses `.env.development` credentials)
|
|
603
635
|
- ✓ `magentrix update` - Update CLI to latest version
|
|
604
636
|
|
|
605
637
|
**In Magentrix workspace directories** (has `.magentrix/` folder):
|
|
606
638
|
- ✓ All standard commands (`setup`, `pull`, `publish`, etc.)
|
|
607
|
-
- ✓ All Iris commands (`vue-build
|
|
639
|
+
- ✓ All Iris commands (`vue-run-build`, `iris-app-delete`, `iris-app-recover`, etc.)
|
|
608
640
|
|
|
609
641
|
**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
642
|
|
|
@@ -612,31 +644,31 @@ VITE_ASSETS = '[]' # Injected automatically by run-dev
|
|
|
612
644
|
|
|
613
645
|
```bash
|
|
614
646
|
# First time setup
|
|
615
|
-
magentrix iris-link # Link your Vue project
|
|
647
|
+
magentrix iris-app-link # Link your Vue project
|
|
616
648
|
|
|
617
649
|
# Development (run from Vue project folder)
|
|
618
650
|
cd ~/my-vue-app # Work from your Vue project
|
|
619
|
-
magentrix run-dev # Start dev server with platform assets
|
|
651
|
+
magentrix vue-run-dev # Start dev server with platform assets
|
|
620
652
|
# Make changes, test locally
|
|
621
653
|
# Press Ctrl+C to stop
|
|
622
654
|
|
|
623
655
|
# Deployment - Option A (from Vue project folder)
|
|
624
656
|
cd ~/my-vue-app # Work from your Vue project
|
|
625
|
-
magentrix vue-build
|
|
657
|
+
magentrix vue-run-build # Build and select workspace to stage into
|
|
626
658
|
# Prompted: "Do you want to publish to Magentrix now?" → Yes/No
|
|
627
659
|
|
|
628
660
|
# Deployment - Option B (from Magentrix workspace)
|
|
629
661
|
cd ~/magentrix-workspace # Navigate to Magentrix workspace
|
|
630
|
-
magentrix vue-build
|
|
662
|
+
magentrix vue-run-build --path ~/my-vue-app # Build and stage
|
|
631
663
|
# Prompted: "Do you want to publish to Magentrix now?" → Yes/No
|
|
632
664
|
# If autopublish is running, it auto-deploys instead
|
|
633
665
|
|
|
634
666
|
# Deleting an app (from workspace)
|
|
635
|
-
magentrix iris-delete # Select app, confirm, auto-backup created
|
|
667
|
+
magentrix iris-app-delete # Select app, confirm, auto-backup created
|
|
636
668
|
magentrix publish # Sync deletion to server
|
|
637
669
|
|
|
638
670
|
# Recovering a deleted app (from workspace)
|
|
639
|
-
magentrix iris-recover # Select backup, restore files
|
|
671
|
+
magentrix iris-app-recover # Select backup, restore files
|
|
640
672
|
magentrix publish # Sync recovery to server
|
|
641
673
|
```
|
|
642
674
|
|
|
@@ -649,39 +681,39 @@ For automatic deployment during development:
|
|
|
649
681
|
magentrix autopublish
|
|
650
682
|
|
|
651
683
|
# Terminal 2: Build and stage after making changes
|
|
652
|
-
magentrix vue-build
|
|
684
|
+
magentrix vue-run-build
|
|
653
685
|
# Autopublish will detect the changes and upload automatically
|
|
654
686
|
```
|
|
655
687
|
|
|
656
688
|
### Troubleshooting Iris Apps
|
|
657
689
|
|
|
658
|
-
#### Running vue-build
|
|
690
|
+
#### Running vue-run-build from different locations
|
|
659
691
|
|
|
660
|
-
The `vue-build
|
|
692
|
+
The `vue-run-build` command works from both locations:
|
|
661
693
|
|
|
662
694
|
**From Vue project directory:**
|
|
663
695
|
```bash
|
|
664
696
|
cd ~/my-vue-app
|
|
665
|
-
magentrix vue-build
|
|
697
|
+
magentrix vue-run-build # Prompts for which workspace to stage into
|
|
666
698
|
```
|
|
667
699
|
|
|
668
700
|
**From Magentrix workspace:**
|
|
669
701
|
```bash
|
|
670
702
|
cd ~/magentrix-workspace
|
|
671
|
-
magentrix vue-build
|
|
672
|
-
# Or with path: magentrix vue-build
|
|
703
|
+
magentrix vue-run-build # Prompts for which Vue project to build
|
|
704
|
+
# Or with path: magentrix vue-run-build --path ~/my-vue-app
|
|
673
705
|
```
|
|
674
706
|
|
|
675
707
|
#### "No Magentrix workspaces found"
|
|
676
708
|
When running from a Vue project, the command looks for registered workspaces in the global config. To register a workspace:
|
|
677
709
|
1. Navigate to your Magentrix workspace
|
|
678
710
|
2. Run `magentrix setup` (this automatically registers it)
|
|
679
|
-
3. Or specify workspace manually: `magentrix vue-build
|
|
711
|
+
3. Or specify workspace manually: `magentrix vue-run-build --workspace /path/to/workspace`
|
|
680
712
|
|
|
681
713
|
**Note**: Existing workspaces are auto-registered when you run any command from them.
|
|
682
714
|
|
|
683
715
|
#### "Publishing Iris apps from an out-of-sync workspace is not allowed"
|
|
684
|
-
When running `vue-build
|
|
716
|
+
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
717
|
|
|
686
718
|
**Why this is required:**
|
|
687
719
|
- Prevents deployment conflicts
|
|
@@ -691,10 +723,10 @@ When running `vue-build-stage` from a Vue project, the CLI checks if the target
|
|
|
691
723
|
**To resolve:**
|
|
692
724
|
1. Navigate to the workspace: `cd /path/to/workspace`
|
|
693
725
|
2. Pull latest changes: `magentrix pull`
|
|
694
|
-
3. Re-run `vue-build
|
|
726
|
+
3. Re-run `vue-run-build` from your Vue project
|
|
695
727
|
|
|
696
|
-
#### "Missing required field in config.ts: slug (
|
|
697
|
-
Your Vue project's `config.ts` is missing the app identifier. Add an `
|
|
728
|
+
#### "Missing required field in config.ts: slug (appSlug)"
|
|
729
|
+
Your Vue project's `config.ts` is missing the app identifier. Add an `appSlug` or `slug` field.
|
|
698
730
|
|
|
699
731
|
#### "Missing required field in config.ts: appName"
|
|
700
732
|
Your Vue project's `config.ts` is missing the display name. Add an `appName` field.
|
|
@@ -720,9 +752,9 @@ The CLI looks for config in these locations:
|
|
|
720
752
|
#### Deleting an Iris app
|
|
721
753
|
To remove an Iris app:
|
|
722
754
|
```bash
|
|
723
|
-
magentrix iris-delete
|
|
755
|
+
magentrix iris-app-delete
|
|
724
756
|
```
|
|
725
|
-
This creates an automatic recovery backup before deletion. You can restore using `magentrix iris-recover`.
|
|
757
|
+
This creates an automatic recovery backup before deletion. You can restore using `magentrix iris-app-recover`.
|
|
726
758
|
|
|
727
759
|
**Permission errors:**
|
|
728
760
|
If you get "Permission Denied" when deleting local files:
|
|
@@ -733,16 +765,22 @@ If you get "Permission Denied" when deleting local files:
|
|
|
733
765
|
#### Recovering a deleted app
|
|
734
766
|
To restore a deleted Iris app:
|
|
735
767
|
```bash
|
|
736
|
-
magentrix iris-recover --list # See all available backups
|
|
737
|
-
magentrix iris-recover # Select and restore a backup
|
|
768
|
+
magentrix iris-app-recover --list # See all available backups
|
|
769
|
+
magentrix iris-app-recover # Select and restore a backup
|
|
738
770
|
magentrix publish # Sync to server
|
|
739
771
|
```
|
|
740
772
|
|
|
741
773
|
**Important**: After recovery, you must run `magentrix publish` to sync the app back to the Magentrix server.
|
|
742
774
|
|
|
743
|
-
#### Changes not detected after vue-build
|
|
775
|
+
#### Changes not detected after vue-run-build
|
|
744
776
|
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
777
|
|
|
778
|
+
#### Duplicate apps after changing slug
|
|
779
|
+
If you changed the `appSlug`/`slug` in `config.ts` and now have two apps on the server:
|
|
780
|
+
1. The old app is orphaned and needs manual cleanup
|
|
781
|
+
2. Run `magentrix iris-app-delete` and select the old app to remove it
|
|
782
|
+
3. See [Changing an App Slug](#changing-an-app-slug) for the proper workflow
|
|
783
|
+
|
|
746
784
|
---
|
|
747
785
|
|
|
748
786
|
## Handling Conflicts
|
|
@@ -798,16 +836,16 @@ magentrix status # Verify everything is in sync
|
|
|
798
836
|
**Option A: From Vue project folder**
|
|
799
837
|
```bash
|
|
800
838
|
cd ~/my-vue-app # Navigate to your Vue project
|
|
801
|
-
magentrix iris-link # Link project (first time only)
|
|
802
|
-
magentrix vue-build
|
|
839
|
+
magentrix iris-app-link # Link project (first time only)
|
|
840
|
+
magentrix vue-run-build # Build and select workspace to stage into
|
|
803
841
|
# Prompted: "Do you want to publish to Magentrix now?" → Yes/No
|
|
804
842
|
```
|
|
805
843
|
|
|
806
844
|
**Option B: From Magentrix workspace**
|
|
807
845
|
```bash
|
|
808
846
|
cd ~/magentrix-workspace # Navigate to Magentrix workspace
|
|
809
|
-
magentrix iris-link --path ~/my-vue-app # Link project (first time only)
|
|
810
|
-
magentrix vue-build
|
|
847
|
+
magentrix iris-app-link --path ~/my-vue-app # Link project (first time only)
|
|
848
|
+
magentrix vue-run-build --path ~/my-vue-app # Build and stage
|
|
811
849
|
# Prompted: "Do you want to publish to Magentrix now?" (unless autopublish is running)
|
|
812
850
|
```
|
|
813
851
|
|
|
@@ -816,13 +854,13 @@ magentrix vue-build-stage --path ~/my-vue-app # Build and stage
|
|
|
816
854
|
### Deleting and Recovering Apps
|
|
817
855
|
```bash
|
|
818
856
|
# Delete an app (creates automatic backup)
|
|
819
|
-
magentrix iris-delete # Select app, confirm deletion
|
|
857
|
+
magentrix iris-app-delete # Select app, confirm deletion
|
|
820
858
|
|
|
821
859
|
# View available backups
|
|
822
|
-
magentrix iris-recover --list
|
|
860
|
+
magentrix iris-app-recover --list
|
|
823
861
|
|
|
824
862
|
# Recover a deleted app
|
|
825
|
-
magentrix iris-recover # Select backup, restore
|
|
863
|
+
magentrix iris-app-recover # Select backup, restore
|
|
826
864
|
magentrix publish # Sync recovery to server
|
|
827
865
|
```
|
|
828
866
|
|
|
@@ -1107,11 +1145,11 @@ magentrix status # Shows sync status
|
|
|
1107
1145
|
- `magentrix status` - Check sync status
|
|
1108
1146
|
- `magentrix autopublish` - Auto-sync mode
|
|
1109
1147
|
- `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
|
|
1148
|
+
- `magentrix iris-app-link` - Link Vue.js projects for deployment
|
|
1149
|
+
- `magentrix vue-run-build` - Build and stage Vue.js apps
|
|
1150
|
+
- `magentrix vue-run-dev` - Start Vue dev server with platform assets
|
|
1151
|
+
- `magentrix iris-app-delete` - Delete an Iris app with recovery backup
|
|
1152
|
+
- `magentrix iris-app-recover` - Recover a deleted Iris app
|
|
1115
1153
|
|
|
1116
1154
|
---
|
|
1117
1155
|
|
|
@@ -1123,6 +1161,6 @@ Once you're comfortable with basic usage:
|
|
|
1123
1161
|
2. **Learn the autopublish workflow** for faster development
|
|
1124
1162
|
3. **Explore conflict resolution** if you work in a team
|
|
1125
1163
|
4. **Check out templates** created by the `create` command to understand best practices
|
|
1126
|
-
5. **Deploy Vue.js apps** using `iris-link`, `vue-build
|
|
1164
|
+
5. **Deploy Vue.js apps** using `iris-app-link`, `vue-run-build`, and `vue-run-dev` commands
|
|
1127
1165
|
|
|
1128
1166
|
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
|
|
@@ -434,7 +434,7 @@ async function buildFromVueProject(options) {
|
|
|
434
434
|
console.log(chalk.cyan('To continue manually:'));
|
|
435
435
|
console.log(chalk.white(` 1. Navigate to workspace: ${chalk.yellow(`cd "${workspacePath}"`)}`));
|
|
436
436
|
console.log(chalk.white(` 2. Run ${chalk.yellow('magentrix pull')} to resolve conflicts`));
|
|
437
|
-
console.log(chalk.white(` 3. Run ${chalk.yellow('magentrix vue-build
|
|
437
|
+
console.log(chalk.white(` 3. Run ${chalk.yellow('magentrix vue-run-build --skip-build')} to stage`));
|
|
438
438
|
console.log(chalk.white(` 4. Run ${chalk.yellow('magentrix publish')} to deploy`));
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
@@ -533,13 +533,24 @@ async function checkWorkspaceSyncStatus(workspacePath) {
|
|
|
533
533
|
});
|
|
534
534
|
|
|
535
535
|
child.on('close', (code) => {
|
|
536
|
-
// 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...")
|
|
537
539
|
const lowerOutput = output.toLowerCase();
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
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);
|
|
543
554
|
|
|
544
555
|
resolvePromise({ checked: code === 0, needsPull });
|
|
545
556
|
});
|
|
@@ -596,7 +607,7 @@ async function selectWorkspace() {
|
|
|
596
607
|
console.log(chalk.white(` • Or run ${chalk.cyan('magentrix setup')} in a new directory to create one`));
|
|
597
608
|
console.log();
|
|
598
609
|
console.log(chalk.gray('Or specify a workspace path directly:'));
|
|
599
|
-
console.log(chalk.white(` ${chalk.cyan('magentrix vue-build
|
|
610
|
+
console.log(chalk.white(` ${chalk.cyan('magentrix vue-run-build --workspace /path/to/workspace')}`));
|
|
600
611
|
console.log();
|
|
601
612
|
|
|
602
613
|
// Allow manual entry
|
|
@@ -714,8 +725,8 @@ async function selectProject() {
|
|
|
714
725
|
console.log(chalk.yellow('No linked Vue projects found.'));
|
|
715
726
|
console.log();
|
|
716
727
|
console.log(chalk.gray('To get started:'));
|
|
717
|
-
console.log(chalk.white(` 1. Link a Vue project: ${chalk.cyan('magentrix iris-link')}`));
|
|
718
|
-
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')}`));
|
|
719
730
|
console.log();
|
|
720
731
|
}
|
|
721
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
|
@@ -163,13 +163,13 @@ export function parseConfigFile(configPath) {
|
|
|
163
163
|
result.raw = content;
|
|
164
164
|
|
|
165
165
|
// Extract slug (various patterns)
|
|
166
|
-
// slug: "dashboard",
|
|
166
|
+
// slug: "dashboard", appSlug: "dashboard", app_slug: "dashboard"
|
|
167
167
|
// Also handles: slug: env.slug || "fallback"
|
|
168
|
-
const slugMatch = content.match(/(?:slug|
|
|
168
|
+
const slugMatch = content.match(/(?:slug|appSlug|app_slug)\s*:\s*["'`]([^"'`]+)["'`]/);
|
|
169
169
|
if (slugMatch) {
|
|
170
170
|
result.slug = slugMatch[1];
|
|
171
171
|
} else {
|
|
172
|
-
const slugFallbackMatch = content.match(/(?:slug|
|
|
172
|
+
const slugFallbackMatch = content.match(/(?:slug|appSlug|app_slug)\s*:\s*[^,\n]+\|\|\s*["'`]([^"'`]+)["'`]/);
|
|
173
173
|
if (slugFallbackMatch) {
|
|
174
174
|
result.slug = slugFallbackMatch[1];
|
|
175
175
|
}
|
|
@@ -296,7 +296,7 @@ export function readVueConfig(projectPath) {
|
|
|
296
296
|
|
|
297
297
|
// Validate required fields in config.ts
|
|
298
298
|
if (!result.slug) {
|
|
299
|
-
result.errors.push('Missing required field in config.ts: slug (
|
|
299
|
+
result.errors.push('Missing required field in config.ts: slug (appSlug)');
|
|
300
300
|
}
|
|
301
301
|
if (!result.appName) {
|
|
302
302
|
result.errors.push('Missing required field in config.ts: appName');
|
|
@@ -422,7 +422,7 @@ Could not find config.ts in the Vue project.
|
|
|
422
422
|
Expected location: ${join(projectPath, 'src/config.ts')}
|
|
423
423
|
|
|
424
424
|
Required fields in config.ts:
|
|
425
|
-
-
|
|
425
|
+
- appSlug (slug): App identifier (used as folder name)
|
|
426
426
|
- appName: Display name for navigation menu
|
|
427
427
|
|
|
428
428
|
Required fields in .env.development:
|
|
@@ -432,7 +432,7 @@ Required fields in .env.development:
|
|
|
432
432
|
|
|
433
433
|
Example config.ts:
|
|
434
434
|
export const config = {
|
|
435
|
-
|
|
435
|
+
appSlug: "my-app",
|
|
436
436
|
appName: "My Application"
|
|
437
437
|
}
|
|
438
438
|
|
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 = [
|