@atlashub/smartstack-cli 1.14.0 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.documentation/gitflow.html +230 -235
- package/.documentation/installation.html +114 -39
- package/config/default-config.json +10 -1
- package/package.json +1 -1
- package/templates/agents/efcore/migration.md +4 -4
- package/templates/commands/efcore/_shared.md +1 -1
- package/templates/commands/efcore/migration.md +1 -1
- package/templates/commands/efcore/rebase-snapshot.md +1 -1
- package/templates/commands/efcore/squash.md +1 -0
- package/templates/skills/gitflow/steps/step-start.md +109 -9
- package/templates/commands/gitflow/OPTIMIZATIONS.md +0 -206
- package/templates/gitflow/config.json +0 -138
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
.platform-btn {
|
|
16
16
|
flex: 1;
|
|
17
|
-
padding: 1rem
|
|
17
|
+
padding: 0.875rem 1rem;
|
|
18
18
|
border: 2px solid var(--border);
|
|
19
19
|
border-radius: 8px;
|
|
20
20
|
background: var(--bg-card);
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
transition: all 0.2s ease;
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
justify-content: center;
|
|
27
|
+
gap: 0.5rem;
|
|
28
|
+
font-size: 0.95rem;
|
|
28
29
|
font-weight: 500;
|
|
30
|
+
min-height: 52px;
|
|
29
31
|
}
|
|
30
32
|
.platform-btn:hover {
|
|
31
33
|
border-color: var(--primary);
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
background: rgba(59, 130, 246, 0.1);
|
|
37
39
|
}
|
|
38
40
|
.platform-btn .platform-icon {
|
|
39
|
-
font-size: 1.
|
|
41
|
+
font-size: 1.25rem;
|
|
40
42
|
}
|
|
41
43
|
.platform-content {
|
|
42
44
|
display: none;
|
|
@@ -48,26 +50,35 @@
|
|
|
48
50
|
/* OS Selector */
|
|
49
51
|
.os-selector {
|
|
50
52
|
display: flex;
|
|
51
|
-
gap: 0.
|
|
52
|
-
margin-bottom: 1rem;
|
|
53
|
+
gap: 0.75rem;
|
|
53
54
|
}
|
|
54
55
|
.os-btn {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
border
|
|
56
|
+
flex: 1;
|
|
57
|
+
padding: 0.875rem 1rem;
|
|
58
|
+
border: 2px solid var(--border);
|
|
59
|
+
border-radius: 8px;
|
|
58
60
|
background: var(--bg-card);
|
|
59
61
|
color: var(--text);
|
|
60
62
|
cursor: pointer;
|
|
61
63
|
transition: all 0.2s ease;
|
|
62
|
-
font-size: 0.
|
|
64
|
+
font-size: 0.95rem;
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
gap: 0.5rem;
|
|
70
|
+
min-height: 52px;
|
|
63
71
|
}
|
|
64
72
|
.os-btn:hover {
|
|
65
73
|
border-color: var(--primary);
|
|
74
|
+
background: var(--bg-hover);
|
|
66
75
|
}
|
|
67
76
|
.os-btn.active {
|
|
68
77
|
border-color: var(--primary);
|
|
69
78
|
background: rgba(59, 130, 246, 0.1);
|
|
70
|
-
|
|
79
|
+
}
|
|
80
|
+
.os-btn .os-icon {
|
|
81
|
+
font-size: 1.25rem;
|
|
71
82
|
}
|
|
72
83
|
.os-content {
|
|
73
84
|
display: none;
|
|
@@ -80,7 +91,7 @@
|
|
|
80
91
|
.settings-panel {
|
|
81
92
|
background: var(--bg-card);
|
|
82
93
|
border: 1px solid var(--border);
|
|
83
|
-
border-radius:
|
|
94
|
+
border-radius: 12px;
|
|
84
95
|
padding: 1.5rem;
|
|
85
96
|
margin-bottom: 2rem;
|
|
86
97
|
}
|
|
@@ -91,13 +102,18 @@
|
|
|
91
102
|
}
|
|
92
103
|
.settings-group {
|
|
93
104
|
flex: 1;
|
|
94
|
-
min-width:
|
|
105
|
+
min-width: 280px;
|
|
95
106
|
}
|
|
96
107
|
.settings-label {
|
|
97
108
|
font-weight: 600;
|
|
98
109
|
color: var(--text);
|
|
99
110
|
margin-bottom: 0.75rem;
|
|
100
|
-
display:
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: 0.5rem;
|
|
114
|
+
}
|
|
115
|
+
.settings-label .label-icon {
|
|
116
|
+
font-size: 1.1rem;
|
|
101
117
|
}
|
|
102
118
|
|
|
103
119
|
/* Tutorial section */
|
|
@@ -489,17 +505,28 @@
|
|
|
489
505
|
<div class="settings-row">
|
|
490
506
|
<div class="settings-group">
|
|
491
507
|
<span class="settings-label">
|
|
508
|
+
<span class="label-icon">💻</span>
|
|
492
509
|
<span data-lang="fr">Systeme d'exploitation</span>
|
|
493
510
|
<span data-lang="en">Operating System</span>
|
|
494
511
|
</span>
|
|
495
512
|
<div class="os-selector">
|
|
496
|
-
<button class="os-btn active" data-os="windows" onclick="setOS('windows')">
|
|
497
|
-
|
|
498
|
-
|
|
513
|
+
<button class="os-btn active" data-os="windows" onclick="setOS('windows')">
|
|
514
|
+
<span class="os-icon">🪟</span>
|
|
515
|
+
<span>Windows</span>
|
|
516
|
+
</button>
|
|
517
|
+
<button class="os-btn" data-os="macos" onclick="setOS('macos')">
|
|
518
|
+
<span class="os-icon">🍎</span>
|
|
519
|
+
<span>macOS</span>
|
|
520
|
+
</button>
|
|
521
|
+
<button class="os-btn" data-os="linux" onclick="setOS('linux')">
|
|
522
|
+
<span class="os-icon">🐧</span>
|
|
523
|
+
<span>Linux</span>
|
|
524
|
+
</button>
|
|
499
525
|
</div>
|
|
500
526
|
</div>
|
|
501
527
|
<div class="settings-group">
|
|
502
528
|
<span class="settings-label">
|
|
529
|
+
<span class="label-icon">🔀</span>
|
|
503
530
|
<span data-lang="fr">Plateforme Git</span>
|
|
504
531
|
<span data-lang="en">Git Platform</span>
|
|
505
532
|
</span>
|
|
@@ -651,8 +678,10 @@ git config --global credential.helper manager</code></pre>
|
|
|
651
678
|
</div>
|
|
652
679
|
</div>
|
|
653
680
|
|
|
654
|
-
<
|
|
655
|
-
|
|
681
|
+
<div class="tutorial-note" style="margin-top: 1rem;">
|
|
682
|
+
<p data-lang="fr"><strong>Pas besoin de <code>az login</code></strong> - Git Credential Manager ouvrira automatiquement votre navigateur pour vous authentifier avec votre compte Azure AD lors de la premiere operation Git (clone, push, etc.).</p>
|
|
683
|
+
<p data-lang="en"><strong>No need for <code>az login</code></strong> - Git Credential Manager will automatically open your browser to authenticate with your Azure AD account on the first Git operation (clone, push, etc.).</p>
|
|
684
|
+
</div>
|
|
656
685
|
</div>
|
|
657
686
|
</div>
|
|
658
687
|
</div>
|
|
@@ -815,14 +844,17 @@ claude mcp list</code></pre>
|
|
|
815
844
|
<span data-lang="en">Start your first project</span>
|
|
816
845
|
</h3>
|
|
817
846
|
|
|
818
|
-
<div class="alert alert-
|
|
819
|
-
<span class="alert-icon">&#
|
|
847
|
+
<div class="alert alert-success" style="margin-bottom: 1.5rem;">
|
|
848
|
+
<span class="alert-icon">✅</span>
|
|
820
849
|
<div class="alert-content">
|
|
821
|
-
<p data-lang="fr">
|
|
822
|
-
<p data-lang="en">
|
|
850
|
+
<p data-lang="fr"><strong>Vous lisez cette doc dans votre projet ?</strong> Vous etes deja pret ! Les etapes A, B, C sont deja faites. <a href="#step-d" style="color: var(--success); font-weight: 600;">Passez directement a l'etape D →</a></p>
|
|
851
|
+
<p data-lang="en"><strong>Reading this doc in your project?</strong> You're already set! Steps A, B, C are done. <a href="#step-d" style="color: var(--success); font-weight: 600;">Skip to step D →</a></p>
|
|
823
852
|
</div>
|
|
824
853
|
</div>
|
|
825
854
|
|
|
855
|
+
<p data-lang="fr" style="color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem;">Les etapes A, B, C ci-dessous sont pour reference si vous devez configurer un nouveau projet.</p>
|
|
856
|
+
<p data-lang="en" style="color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem;">Steps A, B, C below are for reference if you need to set up a new project.</p>
|
|
857
|
+
|
|
826
858
|
<!-- Step A: Create repo -->
|
|
827
859
|
<div class="tutorial-section">
|
|
828
860
|
<h4>
|
|
@@ -907,19 +939,16 @@ claude mcp list</code></pre>
|
|
|
907
939
|
<div class="tutorial-section">
|
|
908
940
|
<h4>
|
|
909
941
|
<span class="step-badge">C</span>
|
|
910
|
-
<span data-lang="fr">
|
|
911
|
-
<span data-lang="en">
|
|
942
|
+
<span data-lang="fr">Installer les outils SmartStack</span>
|
|
943
|
+
<span data-lang="en">Install SmartStack tools</span>
|
|
912
944
|
</h4>
|
|
913
945
|
|
|
914
|
-
<p data-lang="fr">
|
|
915
|
-
<p data-lang="en">
|
|
946
|
+
<p data-lang="fr">Vous etes maintenant dans votre projet clone. Installez les outils SmartStack :</p>
|
|
947
|
+
<p data-lang="en">You are now in your cloned project. Install SmartStack tools:</p>
|
|
916
948
|
|
|
917
949
|
<div class="code-block">
|
|
918
950
|
<button class="copy-btn">Copy</button>
|
|
919
|
-
<pre><code>#
|
|
920
|
-
smartstack init MonProjet
|
|
921
|
-
|
|
922
|
-
# OU pour un projet existant (ajoute seulement les outils SmartStack)
|
|
951
|
+
<pre><code># Depuis la racine de votre projet clone
|
|
923
952
|
smartstack init .</code></pre>
|
|
924
953
|
</div>
|
|
925
954
|
|
|
@@ -927,39 +956,85 @@ smartstack init .</code></pre>
|
|
|
927
956
|
<p data-lang="en" style="margin-top: 1rem;">This command will:</p>
|
|
928
957
|
|
|
929
958
|
<ul style="margin: 0.5rem 0 1rem 1.5rem; color: var(--text-muted);">
|
|
930
|
-
<li data-lang="fr">Creer la structure Clean Architecture (.NET)</li>
|
|
931
|
-
<li data-lang="en">Create the Clean Architecture structure (.NET)</li>
|
|
932
959
|
<li data-lang="fr">Installer les skills et agents SmartStack</li>
|
|
933
960
|
<li data-lang="en">Install SmartStack skills and agents</li>
|
|
934
961
|
<li data-lang="fr">Configurer les hooks Claude Code</li>
|
|
935
962
|
<li data-lang="en">Configure Claude Code hooks</li>
|
|
963
|
+
<li data-lang="fr">Generer le fichier <code>CLAUDE.md</code> avec les regles du projet</li>
|
|
964
|
+
<li data-lang="en">Generate the <code>CLAUDE.md</code> file with project rules</li>
|
|
965
|
+
<li data-lang="fr">Generer cette documentation (<code>.documentation/</code>)</li>
|
|
966
|
+
<li data-lang="en">Generate this documentation (<code>.documentation/</code>)</li>
|
|
936
967
|
<li data-lang="fr">Verifier les serveurs MCP</li>
|
|
937
968
|
<li data-lang="en">Verify MCP servers</li>
|
|
938
969
|
</ul>
|
|
970
|
+
|
|
971
|
+
<div class="tutorial-note">
|
|
972
|
+
<p data-lang="fr"><strong>Nouveau projet .NET ?</strong> Si vous partez de zero et voulez creer la structure Clean Architecture, utilisez plutot <code>smartstack init MonProjet</code> avant l'etape A (sans creer de repo au prealable).</p>
|
|
973
|
+
<p data-lang="en"><strong>New .NET project?</strong> If you're starting from scratch and want to create the Clean Architecture structure, use <code>smartstack init MyProject</code> before step A (without creating a repo beforehand).</p>
|
|
974
|
+
</div>
|
|
939
975
|
</div>
|
|
940
976
|
|
|
941
977
|
<!-- Step D: Start working -->
|
|
942
|
-
<div class="tutorial-section">
|
|
978
|
+
<div class="tutorial-section" id="step-d">
|
|
943
979
|
<h4>
|
|
944
980
|
<span class="step-badge">D</span>
|
|
945
981
|
<span data-lang="fr">Commencer a travailler</span>
|
|
946
982
|
<span data-lang="en">Start working</span>
|
|
947
983
|
</h4>
|
|
948
984
|
|
|
949
|
-
<p data-lang="fr">Votre environnement est pret !
|
|
950
|
-
<p data-lang="en">Your environment is ready!
|
|
985
|
+
<p data-lang="fr">Votre environnement est pret ! Le workflow GitFlow vous guide selon votre objectif :</p>
|
|
986
|
+
<p data-lang="en">Your environment is ready! The GitFlow workflow guides you based on your goal:</p>
|
|
987
|
+
|
|
988
|
+
<!-- Mini decision guide -->
|
|
989
|
+
<div style="display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0;">
|
|
990
|
+
<div style="flex: 1; min-width: 200px; padding: 1rem; background: rgba(34, 197, 94, 0.1); border: 1px solid #22c55e; border-radius: 8px;">
|
|
991
|
+
<div style="font-weight: 600; color: #22c55e; margin-bottom: 0.5rem;">
|
|
992
|
+
<span data-lang="fr">Nouvelle fonctionnalite</span>
|
|
993
|
+
<span data-lang="en">New feature</span>
|
|
994
|
+
</div>
|
|
995
|
+
<code style="font-size: 0.85rem;">/gitflow:10-start feature {nom}</code>
|
|
996
|
+
</div>
|
|
997
|
+
<div style="flex: 1; min-width: 200px; padding: 1rem; background: rgba(234, 179, 8, 0.1); border: 1px solid #eab308; border-radius: 8px;">
|
|
998
|
+
<div style="font-weight: 600; color: #eab308; margin-bottom: 0.5rem;">
|
|
999
|
+
<span data-lang="fr">Deployer en prod</span>
|
|
1000
|
+
<span data-lang="en">Deploy to prod</span>
|
|
1001
|
+
</div>
|
|
1002
|
+
<code style="font-size: 0.85rem;">/gitflow:10-start release</code>
|
|
1003
|
+
</div>
|
|
1004
|
+
<div style="flex: 1; min-width: 200px; padding: 1rem; background: rgba(236, 72, 153, 0.1); border: 1px solid #ec4899; border-radius: 8px;">
|
|
1005
|
+
<div style="font-weight: 600; color: #ec4899; margin-bottom: 0.5rem;">
|
|
1006
|
+
<span data-lang="fr">Bug urgent prod</span>
|
|
1007
|
+
<span data-lang="en">Urgent prod bug</span>
|
|
1008
|
+
</div>
|
|
1009
|
+
<code style="font-size: 0.85rem;">/gitflow:10-start hotfix {nom}</code>
|
|
1010
|
+
</div>
|
|
1011
|
+
</div>
|
|
1012
|
+
|
|
1013
|
+
<p data-lang="fr" style="margin-top: 1rem;">Cycle de travail type :</p>
|
|
1014
|
+
<p data-lang="en" style="margin-top: 1rem;">Typical work cycle:</p>
|
|
951
1015
|
|
|
952
1016
|
<div class="code-block">
|
|
953
1017
|
<button class="copy-btn">Copy</button>
|
|
954
|
-
<pre><code>#
|
|
1018
|
+
<pre><code># 1. Demarrer une branche
|
|
955
1019
|
/gitflow:10-start feature ma-fonctionnalite
|
|
956
1020
|
|
|
957
|
-
#
|
|
1021
|
+
# 2. Coder... puis commiter regulierement
|
|
958
1022
|
/gitflow:3-commit
|
|
959
1023
|
|
|
960
|
-
#
|
|
1024
|
+
# 3. Creer une Pull Request quand c'est pret
|
|
1025
|
+
/gitflow:7-pull-request
|
|
1026
|
+
|
|
1027
|
+
# 4. Finaliser apres le merge
|
|
961
1028
|
/gitflow:11-finish</code></pre>
|
|
962
1029
|
</div>
|
|
1030
|
+
|
|
1031
|
+
<div class="alert alert-info" style="margin-top: 1rem;">
|
|
1032
|
+
<span class="alert-icon">📚</span>
|
|
1033
|
+
<div class="alert-content">
|
|
1034
|
+
<p data-lang="fr"><strong>Guide complet :</strong> Consultez le <a href="gitflow.html#workflow-decision" style="color: var(--primary);">schema decisonnel GitFlow</a> pour visualiser le workflow complet et choisir la bonne commande selon votre situation.</p>
|
|
1035
|
+
<p data-lang="en"><strong>Complete guide:</strong> See the <a href="gitflow.html#workflow-decision" style="color: var(--primary);">GitFlow decision diagram</a> to visualize the complete workflow and choose the right command for your situation.</p>
|
|
1036
|
+
</div>
|
|
1037
|
+
</div>
|
|
963
1038
|
</div>
|
|
964
1039
|
|
|
965
1040
|
<!-- Links to documentation -->
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://atlashub.ch/schemas/claude-gitflow-config.json",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"worktrees": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"mode": "organized",
|
|
7
|
+
"structure": {
|
|
8
|
+
"features": "../features",
|
|
9
|
+
"releases": "../releases",
|
|
10
|
+
"hotfixes": "../hotfixes"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
4
13
|
"git": {
|
|
5
14
|
"branches": {
|
|
6
15
|
"main": "main",
|
package/package.json
CHANGED
|
@@ -64,16 +64,16 @@ grep -oP '"version":\s*"\K[^"]+' package.json
|
|
|
64
64
|
find Migrations -name "core_*.cs" | grep -v Designer | grep -v Snapshot
|
|
65
65
|
|
|
66
66
|
# Existing migrations for Extensions
|
|
67
|
-
find Migrations -name "ext_*.cs" | grep -v Designer | grep -v Snapshot
|
|
67
|
+
find Persistence/Migrations -name "ext_*.cs" | grep -v Designer | grep -v Snapshot
|
|
68
68
|
|
|
69
69
|
# Create Core migration
|
|
70
|
-
dotnet ef migrations add $MIGRATION_NAME --context CoreDbContext
|
|
70
|
+
dotnet ef migrations add $MIGRATION_NAME --context CoreDbContext -o Persistence/Migrations
|
|
71
71
|
|
|
72
72
|
# Create Extensions migration
|
|
73
|
-
dotnet ef migrations add $MIGRATION_NAME --context ExtensionsDbContext
|
|
73
|
+
dotnet ef migrations add $MIGRATION_NAME --context ExtensionsDbContext -o Persistence/Migrations
|
|
74
74
|
|
|
75
75
|
# Delete
|
|
76
|
-
rm Migrations/*${OLD_NAME}*.cs
|
|
76
|
+
rm Persistence/Migrations/*${OLD_NAME}*.cs
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
## Context Detection
|
|
@@ -11,7 +11,7 @@ detect_efcore_project() {
|
|
|
11
11
|
CSPROJ=$(find . -name "*.csproj" -exec grep -l "Microsoft.EntityFrameworkCore" {} \; | head -1)
|
|
12
12
|
PROJECT_DIR=$(dirname "$CSPROJ")
|
|
13
13
|
PROJECT_NAME=$(basename "$CSPROJ" .csproj)
|
|
14
|
-
MIGRATIONS_DIR="$PROJECT_DIR/Migrations"
|
|
14
|
+
MIGRATIONS_DIR="$PROJECT_DIR/Persistence/Migrations"
|
|
15
15
|
|
|
16
16
|
STARTUP_PROJECT=$(find . -name "*.Api.csproj" -o -name "*Web.csproj" | head -1)
|
|
17
17
|
INFRA_PROJECT=$(find . -name "*Infrastructure.csproj" | head -1)
|
|
@@ -152,20 +152,100 @@ git checkout "$BASE_BRANCH" && git pull origin "$BASE_BRANCH"
|
|
|
152
152
|
git checkout -b "$FULL_BRANCH"
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
### 7. Create Local
|
|
155
|
+
### 7. Create Local Environment Config (Backend + Frontend)
|
|
156
156
|
|
|
157
|
-
**
|
|
157
|
+
**Detect project structure:**
|
|
158
158
|
```bash
|
|
159
|
+
# Find API project directory
|
|
160
|
+
API_DIR=$(find "$WORKTREE_PATH" -type d -name "*.Api" -path "*/src/*" | head -1)
|
|
161
|
+
# Find Web project directory
|
|
162
|
+
WEB_DIR=$(find "$WORKTREE_PATH" -type d -name "*-web" -path "*/web/*" | head -1)
|
|
163
|
+
|
|
164
|
+
# Generate unique ports based on branch name hash (to avoid conflicts between worktrees)
|
|
165
|
+
HASH=$(echo "$BRANCH_NAME" | md5sum | cut -c1-4)
|
|
166
|
+
HASH_NUM=$((16#$HASH % 100))
|
|
167
|
+
API_PORT=$((5200 + HASH_NUM))
|
|
168
|
+
WEB_PORT=$((5300 + HASH_NUM))
|
|
169
|
+
|
|
170
|
+
# Project and DB naming
|
|
159
171
|
PROJECT_NAME=$(basename $(pwd) | tr '[:upper:]' '[:lower:]')
|
|
160
|
-
DB_NAME
|
|
172
|
+
DB_NAME=$(echo "${PROJECT_NAME}_${branch_type}_${BRANCH_NAME}" | cut -c1-63)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### 7a. Backend: appsettings.Local.json
|
|
161
176
|
|
|
162
|
-
|
|
177
|
+
**If API project detected:**
|
|
178
|
+
```bash
|
|
179
|
+
[ -n "$API_DIR" ] && [ -f "$API_DIR/appsettings.json" ] && {
|
|
180
|
+
cat > "$API_DIR/appsettings.Local.json" << EOF
|
|
163
181
|
{
|
|
164
182
|
"ConnectionStrings": {
|
|
165
183
|
"DefaultConnection": "Server=localhost;Database=${DB_NAME};Trusted_Connection=true;TrustServerCertificate=true"
|
|
184
|
+
},
|
|
185
|
+
"Authentication": {
|
|
186
|
+
"FrontendUrl": "http://localhost:${WEB_PORT}"
|
|
187
|
+
},
|
|
188
|
+
"Kestrel": {
|
|
189
|
+
"Endpoints": {
|
|
190
|
+
"Http": {
|
|
191
|
+
"Url": "http://localhost:${API_PORT}"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"Serilog": {
|
|
196
|
+
"MinimumLevel": {
|
|
197
|
+
"Default": "Debug"
|
|
198
|
+
}
|
|
166
199
|
}
|
|
167
200
|
}
|
|
168
201
|
EOF
|
|
202
|
+
echo "Created: $API_DIR/appsettings.Local.json (DB: $DB_NAME, Port: $API_PORT)"
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### 7b. Frontend: .env.local + npm script
|
|
207
|
+
|
|
208
|
+
**If Web project detected:**
|
|
209
|
+
```bash
|
|
210
|
+
[ -n "$WEB_DIR" ] && [ -f "$WEB_DIR/package.json" ] && {
|
|
211
|
+
# Create .env.local
|
|
212
|
+
cat > "$WEB_DIR/.env.local" << EOF
|
|
213
|
+
# Local environment configuration
|
|
214
|
+
# Generated by /gitflow:start for branch: ${FULL_BRANCH}
|
|
215
|
+
# Run with: npm run local
|
|
216
|
+
|
|
217
|
+
VITE_API_URL=http://localhost:${API_PORT}
|
|
218
|
+
VITE_APP_ENV=local
|
|
219
|
+
VITE_DEBUG=true
|
|
220
|
+
EOF
|
|
221
|
+
echo "Created: $WEB_DIR/.env.local (API: localhost:$API_PORT)"
|
|
222
|
+
|
|
223
|
+
# Add "local" script to package.json if not exists
|
|
224
|
+
if ! grep -q '"local"' "$WEB_DIR/package.json"; then
|
|
225
|
+
# Use Node.js to safely modify package.json
|
|
226
|
+
node -e "
|
|
227
|
+
const fs = require('fs');
|
|
228
|
+
const pkg = JSON.parse(fs.readFileSync('$WEB_DIR/package.json', 'utf8'));
|
|
229
|
+
if (!pkg.scripts.local) {
|
|
230
|
+
pkg.scripts.local = 'vite --mode local --port ${WEB_PORT}';
|
|
231
|
+
fs.writeFileSync('$WEB_DIR/package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
232
|
+
console.log('Added script: npm run local');
|
|
233
|
+
}
|
|
234
|
+
"
|
|
235
|
+
fi
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
#### 7c. Summary of local config
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
243
|
+
│ LOCAL ENVIRONMENT CONFIGURED │
|
|
244
|
+
├─────────────────────────────────────────────────────────────┤
|
|
245
|
+
│ Database: ${DB_NAME} │
|
|
246
|
+
│ API Port: ${API_PORT} → dotnet run --environment Local │
|
|
247
|
+
│ Web Port: ${WEB_PORT} → npm run local │
|
|
248
|
+
└─────────────────────────────────────────────────────────────┘
|
|
169
249
|
```
|
|
170
250
|
|
|
171
251
|
### 8. Store State
|
|
@@ -178,7 +258,14 @@ EOF
|
|
|
178
258
|
"base_branch": "{BASE_BRANCH}",
|
|
179
259
|
"target_branch": "{TARGET}",
|
|
180
260
|
"worktree_path": "{WORKTREE_PATH}",
|
|
181
|
-
"version_current": "{VERSION}"
|
|
261
|
+
"version_current": "{VERSION}",
|
|
262
|
+
"local_config": {
|
|
263
|
+
"database": "{DB_NAME}",
|
|
264
|
+
"api_port": "{API_PORT}",
|
|
265
|
+
"web_port": "{WEB_PORT}",
|
|
266
|
+
"api_dir": "{API_DIR}",
|
|
267
|
+
"web_dir": "{WEB_DIR}"
|
|
268
|
+
}
|
|
182
269
|
}
|
|
183
270
|
```
|
|
184
271
|
|
|
@@ -193,18 +280,29 @@ EOF
|
|
|
193
280
|
║ Target: {TARGET} ║
|
|
194
281
|
║ Worktree: {WORKTREE_PATH} ║
|
|
195
282
|
╠══════════════════════════════════════════════════════════════════╣
|
|
283
|
+
║ LOCAL ENVIRONMENT: ║
|
|
284
|
+
║ Database: {DB_NAME} ║
|
|
285
|
+
║ API: http://localhost:{API_PORT} ║
|
|
286
|
+
║ Web: http://localhost:{WEB_PORT} ║
|
|
287
|
+
╠══════════════════════════════════════════════════════════════════╣
|
|
196
288
|
║ NEXT STEPS: ║
|
|
197
289
|
║ ║
|
|
198
290
|
║ 1. Go to worktree: ║
|
|
199
291
|
║ cd {WORKTREE_PATH} ║
|
|
200
292
|
║ ║
|
|
201
|
-
║ 2.
|
|
293
|
+
║ 2. Start local environment: ║
|
|
294
|
+
║ # Terminal 1 - Backend: ║
|
|
295
|
+
║ cd src/SmartStack.Api && dotnet run --environment Local ║
|
|
296
|
+
║ # Terminal 2 - Frontend: ║
|
|
297
|
+
║ cd web/smartstack-web && npm run local ║
|
|
298
|
+
║ ║
|
|
299
|
+
║ 3. Make changes and commit: ║
|
|
202
300
|
║ /gitflow commit ║
|
|
203
301
|
║ ║
|
|
204
|
-
║
|
|
302
|
+
║ 4. Create pull request: ║
|
|
205
303
|
║ /gitflow pr ║
|
|
206
304
|
║ ║
|
|
207
|
-
║
|
|
305
|
+
║ 5. After PR merged, finalize: ║
|
|
208
306
|
║ /gitflow finish ║
|
|
209
307
|
╚══════════════════════════════════════════════════════════════════╝
|
|
210
308
|
```
|
|
@@ -226,7 +324,9 @@ EOF
|
|
|
226
324
|
|
|
227
325
|
- Branch created from correct base
|
|
228
326
|
- Worktree set up (if enabled)
|
|
229
|
-
-
|
|
327
|
+
- Backend local config created: `appsettings.Local.json` (if .NET API detected)
|
|
328
|
+
- Frontend local config created: `.env.local` + `npm run local` script (if web project detected)
|
|
329
|
+
- Ports synchronized between backend and frontend (unique per branch)
|
|
230
330
|
- State stored for subsequent steps
|
|
231
331
|
|
|
232
332
|
## NEXT STEP:
|