@atlashub/smartstack-cli 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -166,6 +166,22 @@ WAIT for the user's response. Store as `{PROJECT_NAME}`.
|
|
|
166
166
|
|
|
167
167
|
Then normalize name into variants (PascalCase.Dot, PascalCase, kebab-case, snake_case, Display Name).
|
|
168
168
|
|
|
169
|
+
### 2c-bis. Compute Final Project Path
|
|
170
|
+
|
|
171
|
+
After collecting root folder and project name, compute the actual project base:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
ROOT_BASENAME=$(basename "{PROJECT_BASE}")
|
|
175
|
+
if [ "$ROOT_BASENAME" != "{PROJECT_NAME}" ]; then
|
|
176
|
+
PROJECT_BASE="{PROJECT_BASE}/{PROJECT_NAME}"
|
|
177
|
+
echo "Project path: $PROJECT_BASE (appended project name)"
|
|
178
|
+
else
|
|
179
|
+
echo "Project path: {PROJECT_BASE} (already includes project name)"
|
|
180
|
+
fi
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Update `{PROJECT_BASE}` with the result. This value is what gets passed to `gitflow-init-clone`.
|
|
184
|
+
|
|
169
185
|
### 2d. Worktree Mode — CALL AskUserQuestion NOW
|
|
170
186
|
|
|
171
187
|
DO NOT SKIP THIS. This question has been skipped in past sessions causing incorrect defaults.
|
|
@@ -195,7 +211,7 @@ All 4 variables MUST have been confirmed by the user (not auto-derived):
|
|
|
195
211
|
| Variable | Required | How to verify |
|
|
196
212
|
|----------|----------|---------------|
|
|
197
213
|
| {REPO_URL} | ✅ | From command arg OR user answered question 2a |
|
|
198
|
-
| {PROJECT_BASE} | ✅ | User answered question 2b
|
|
214
|
+
| {PROJECT_BASE} | ✅ | User answered question 2b, then adjusted by 2c-bis if needed |
|
|
199
215
|
| {PROJECT_NAME} | ✅ | User answered question 2c (NEVER auto-derived) |
|
|
200
216
|
| {WORKTREE_MODE} | ✅ | User answered question 2d (NEVER defaulted to "organized") |
|
|
201
217
|
|
|
@@ -67,6 +67,16 @@ Store as `{PROJECT_NAME}`.
|
|
|
67
67
|
Then normalize into variants: PascalCase.Dot, PascalCase, kebab-case, snake_case, Display Name.
|
|
68
68
|
See [references/init-name-normalization.md](../references/init-name-normalization.md).
|
|
69
69
|
|
|
70
|
+
### 5b. Compute Final Project Path
|
|
71
|
+
|
|
72
|
+
After collecting both root folder and project name, ensure `{PROJECT_BASE}` points to the project-specific directory:
|
|
73
|
+
|
|
74
|
+
- If `basename({PROJECT_BASE})` already equals `{PROJECT_NAME}` → keep as-is (existing repo case)
|
|
75
|
+
- Otherwise → set `{PROJECT_BASE} = {PROJECT_BASE}/{PROJECT_NAME}` (fresh project case)
|
|
76
|
+
|
|
77
|
+
> **Example:** Root `D:/01 - projets/` + name `MyApp` → `PROJECT_BASE = D:/01 - projets/MyApp/`
|
|
78
|
+
> **Example:** Root `D:/01 - projets/MyApp/` + name `MyApp` → stays `D:/01 - projets/MyApp/` (no double nesting)
|
|
79
|
+
|
|
70
80
|
### 6. Question: Worktree Mode
|
|
71
81
|
|
|
72
82
|
Call AskUserQuestion:
|
|
@@ -97,12 +97,60 @@ EXISTING_PR=$(gh pr list --head "$CURRENT" --json number --jq '.[0].number' 2>/d
|
|
|
97
97
|
}
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
### 4. Run Pre-PR Checks
|
|
100
|
+
### 4. Run Pre-PR Checks (BLOCKING)
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
**4.1 Build validation:**
|
|
103
|
+
```bash
|
|
104
|
+
# Build check (multi-runtime detection)
|
|
105
|
+
echo "Running build check..."
|
|
106
|
+
if [ -f "*.sln" ] || ls *.csproj 2>/dev/null | head -1 > /dev/null; then
|
|
107
|
+
dotnet build --no-restore 2>&1 || {
|
|
108
|
+
echo "❌ .NET build failed. Fix before creating PR."
|
|
109
|
+
STOP
|
|
110
|
+
}
|
|
111
|
+
elif [ -f "package.json" ]; then
|
|
112
|
+
npm run build 2>&1 || {
|
|
113
|
+
echo "❌ npm build failed. Fix before creating PR."
|
|
114
|
+
STOP
|
|
115
|
+
}
|
|
116
|
+
fi
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**4.2 EF Core Migration Squash Enforcement (BLOCKING):**
|
|
120
|
+
|
|
121
|
+
> **CRITICAL:** Feature branches MUST have at most 1 migration before creating a PR. This check is MANDATORY when `config.efcore.enabled` is true.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Skip if EF Core is disabled in config
|
|
125
|
+
if [ "$GF_EFCORE_ENABLED" = "true" ]; then
|
|
126
|
+
if [ "$BRANCH_TYPE" = "feature" ]; then
|
|
127
|
+
MIGRATION_DIR=$(find . -path "*/Persistence/Migrations" -type d 2>/dev/null | head -1)
|
|
128
|
+
if [ -n "$MIGRATION_DIR" ]; then
|
|
129
|
+
NEW_MIGRATIONS=$(git diff --name-only "origin/$TARGET_BRANCH...HEAD" -- "$MIGRATION_DIR" \
|
|
130
|
+
| grep -E '\.cs$' \
|
|
131
|
+
| grep -v 'Designer\|ModelSnapshot' \
|
|
132
|
+
| wc -l)
|
|
133
|
+
|
|
134
|
+
if [ "$NEW_MIGRATIONS" -gt 1 ]; then
|
|
135
|
+
echo ""
|
|
136
|
+
echo "❌ MULTIPLE MIGRATIONS DETECTED ($NEW_MIGRATIONS migrations)"
|
|
137
|
+
echo "→ Feature branches must have exactly 1 migration (squashed) before PR"
|
|
138
|
+
echo "→ Run: /efcore squash"
|
|
139
|
+
echo ""
|
|
140
|
+
echo "Migrations found:"
|
|
141
|
+
git diff --name-only "origin/$TARGET_BRANCH...HEAD" -- "$MIGRATION_DIR" \
|
|
142
|
+
| grep -E '\.cs$' \
|
|
143
|
+
| grep -v 'Designer\|ModelSnapshot'
|
|
144
|
+
STOP
|
|
145
|
+
elif [ "$NEW_MIGRATIONS" -eq 1 ]; then
|
|
146
|
+
echo "✓ Single migration detected (squashed)"
|
|
147
|
+
else
|
|
148
|
+
echo "✓ No migrations in this feature"
|
|
149
|
+
fi
|
|
150
|
+
fi
|
|
151
|
+
fi
|
|
152
|
+
fi
|
|
153
|
+
```
|
|
106
154
|
|
|
107
155
|
### 5. Generate PR Content
|
|
108
156
|
|