@atlashub/smartstack-cli 4.9.0 → 4.11.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/dist/mcp-entry.mjs +19 -19
- package/dist/mcp-entry.mjs.map +1 -1
- package/package.json +1 -1
- package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +11 -1
- package/templates/skills/apex/references/post-checks.md +1 -1
- package/templates/skills/apex/references/smartstack-layers.md +1 -1
- package/templates/skills/apex/steps/step-03-execute.md +2 -2
- package/templates/skills/application/references/frontend-i18n-and-output.md +1 -1
- package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +10 -0
- package/templates/skills/application/references/frontend-verification.md +1 -1
- package/templates/skills/application/steps/step-05-frontend.md +2 -2
package/package.json
CHANGED
|
@@ -52,6 +52,16 @@ const applicationRoutes: ApplicationRouteExtensions = {
|
|
|
52
52
|
|
|
53
53
|
Routes are automatically injected into BOTH standard (`/{application}/...`) and tenant-prefixed (`/t/:slug/{application}/...`) route trees by `mergeRoutes()`. No manual duplication needed.
|
|
54
54
|
|
|
55
|
+
#### Custom Applications (Pattern A)
|
|
56
|
+
|
|
57
|
+
Custom application keys (any key **not** in the built-in list: `administration`, `support`, `user`, `api`) are fully supported in `applicationRoutes`. `mergeRoutes()` automatically:
|
|
58
|
+
|
|
59
|
+
1. Creates a new route entry wrapped in `<AppLayout />`
|
|
60
|
+
2. Injects it into **both** standard (`/{app-key}/...`) and tenant-prefixed (`/t/:slug/{app-key}/...`) trees, inside `TenantRouteWrapper > RouteGuard > LicenseGuard`
|
|
61
|
+
3. Generates automatic parent redirect routes (e.g., `employees` → `employees/management`)
|
|
62
|
+
|
|
63
|
+
No need to use Pattern B for custom applications — Pattern A handles everything automatically.
|
|
64
|
+
|
|
55
65
|
### Pattern B: JSX Routes
|
|
56
66
|
|
|
57
67
|
**If App.tsx contains:** `<Route path="/{application}" element={<{Layout} />}>`
|
|
@@ -117,7 +127,7 @@ For each application, you MUST add:
|
|
|
117
127
|
|
|
118
128
|
The `to` prop is resolved relative to the **parent route** (`/{application}`), so always use the full path from the application root.
|
|
119
129
|
|
|
120
|
-
> Note: `scaffold_routes` with `outputFormat: "
|
|
130
|
+
> Note: `scaffold_routes` with `outputFormat: "applicationRoutes"` generates these redirects automatically.
|
|
121
131
|
|
|
122
132
|
---
|
|
123
133
|
|
|
@@ -1118,7 +1118,7 @@ if [ -n "$PAGE_FILES" ]; then
|
|
|
1118
1118
|
# Extract navigate targets (relative paths like '../leave-types', './create', etc.)
|
|
1119
1119
|
NAV_TARGETS=$(grep -oP "navigate\(['\"]([^'\"]+)['\"]" $PAGE_FILES 2>/dev/null | grep -oP "['\"][^'\"]+['\"]" | tr -d "'" | tr -d '"' | sort -u)
|
|
1120
1120
|
# Extract route paths from App.tsx or route config
|
|
1121
|
-
APP_FILES=$(find web/ -name "App.tsx" -o -name "routes.tsx" -o -name "clientRoutes*.tsx" 2>/dev/null)
|
|
1121
|
+
APP_FILES=$(find web/ -name "App.tsx" -o -name "routes.tsx" -o -name "applicationRoutes*.tsx" -o -name "clientRoutes*.tsx" 2>/dev/null)
|
|
1122
1122
|
if [ -n "$APP_FILES" ] && [ -n "$NAV_TARGETS" ]; then
|
|
1123
1123
|
ROUTE_PATHS=$(grep -oP "path:\s*['\"]([^'\"]+)['\"]" $APP_FILES 2>/dev/null | grep -oP "['\"][^'\"]+['\"]" | tr -d "'" | tr -d '"' | sort -u)
|
|
1124
1124
|
for TARGET in $NAV_TARGETS; do
|
|
@@ -278,7 +278,7 @@ var sectionRoute = $"{moduleRoute}/{ToKebabCase(sectionCode)}";
|
|
|
278
278
|
| Action | Tool |
|
|
279
279
|
|--------|------|
|
|
280
280
|
| API client | MCP `scaffold_api_client` |
|
|
281
|
-
| Routes | MCP `scaffold_routes` (outputFormat: `
|
|
281
|
+
| Routes | MCP `scaffold_routes` (outputFormat: `applicationRoutes`) |
|
|
282
282
|
| Complex pages | /ui-components skill + `smartstack-frontend.md` patterns |
|
|
283
283
|
| Validate routes | MCP `validate_frontend_routes` |
|
|
284
284
|
|
|
@@ -298,7 +298,7 @@ test({module}): backend unit and integration tests
|
|
|
298
298
|
|
|
299
299
|
For each module:
|
|
300
300
|
- **API client:** MCP scaffold_api_client
|
|
301
|
-
- **Routes:** MCP scaffold_routes (outputFormat: '
|
|
301
|
+
- **Routes:** MCP scaffold_routes (outputFormat: 'applicationRoutes') → generates lazy imports + Suspense
|
|
302
302
|
- **Wire Routes to App.tsx (BLOCKING):** After scaffold_routes, routes MUST be wired into App.tsx:
|
|
303
303
|
→ Read App.tsx and detect the routing pattern
|
|
304
304
|
→ **Pattern A** (`applicationRoutes: ApplicationRouteExtensions`): add routes to `applicationRoutes['{application_kebab}'][]` with RELATIVE paths
|
|
@@ -377,7 +377,7 @@ For each entity:
|
|
|
377
377
|
Task: "Execute Layer 3 frontend for entity {EntityName}:
|
|
378
378
|
**MANDATORY: Read references/smartstack-frontend.md FIRST**
|
|
379
379
|
- API client: MCP scaffold_api_client
|
|
380
|
-
- Routes: MCP scaffold_routes (outputFormat: '
|
|
380
|
+
- Routes: MCP scaffold_routes (outputFormat: 'applicationRoutes')
|
|
381
381
|
- Wire Routes to App.tsx (BLOCKING): After scaffold_routes, wire into App.tsx:
|
|
382
382
|
→ Read App.tsx, detect Pattern A (applicationRoutes) or Pattern B (JSX Route)
|
|
383
383
|
→ Pattern A: add to applicationRoutes['{application_kebab}'][] with RELATIVE paths
|
|
@@ -48,7 +48,7 @@ Display generated frontend code organized by category:
|
|
|
48
48
|
|
|
49
49
|
### Routes
|
|
50
50
|
- Updated `navRoutes.generated.ts`
|
|
51
|
-
- Generated `
|
|
51
|
+
- Generated `applicationRoutes.generated.tsx`
|
|
52
52
|
- Wired routes in `App.tsx` (standard + tenant blocks)
|
|
53
53
|
|
|
54
54
|
### i18n
|
|
@@ -48,6 +48,16 @@ const applicationRoutes: ApplicationRouteExtensions = {
|
|
|
48
48
|
|
|
49
49
|
Routes are automatically injected into BOTH standard (`/{application}/...`) and tenant-prefixed (`/t/:slug/{application}/...`) route trees by `mergeRoutes()`. No manual duplication needed.
|
|
50
50
|
|
|
51
|
+
#### Custom Applications (Pattern A)
|
|
52
|
+
|
|
53
|
+
Custom application keys (any key **not** in the built-in list: `administration`, `support`, `user`, `api`) are fully supported in `applicationRoutes`. `mergeRoutes()` automatically:
|
|
54
|
+
|
|
55
|
+
1. Creates a new route entry wrapped in `<AppLayout />`
|
|
56
|
+
2. Injects it into **both** standard (`/{app-key}/...`) and tenant-prefixed (`/t/:slug/{app-key}/...`) trees, inside `TenantRouteWrapper > RouteGuard > LicenseGuard`
|
|
57
|
+
3. Generates automatic parent redirect routes (e.g., `employees` → `employees/management`)
|
|
58
|
+
|
|
59
|
+
No need to use Pattern B for custom applications — Pattern A handles everything automatically.
|
|
60
|
+
|
|
51
61
|
### Pattern B: JSX Routes
|
|
52
62
|
|
|
53
63
|
**If App.tsx contains:** `<Route path="/{application}" element={<{Layout} />}>`
|
|
@@ -87,7 +87,7 @@ Verify routes are actually wired into App.tsx (not just generated in standalone
|
|
|
87
87
|
3. Verify the route also appears inside the **tenant-prefixed** block (`/t/:slug/...`)
|
|
88
88
|
4. Verify the page component is imported (lazy-loaded) at the top of the file
|
|
89
89
|
|
|
90
|
-
**If routes are only in `
|
|
90
|
+
**If routes are only in `applicationRoutes.generated.tsx` or `routes/index.tsx` but NOT in App.tsx, the routes will NOT work at runtime — page will be BLANK.**
|
|
91
91
|
|
|
92
92
|
Run validation:
|
|
93
93
|
```
|
|
@@ -103,12 +103,12 @@ Args:
|
|
|
103
103
|
options:
|
|
104
104
|
includeGuards: true
|
|
105
105
|
generateRegistry: true
|
|
106
|
-
outputFormat: "
|
|
106
|
+
outputFormat: "applicationRoutes"
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
This generates:
|
|
110
110
|
- `navRoutes.generated.ts` - Route registry (NavRoute to API/web path mapping)
|
|
111
|
-
- `
|
|
111
|
+
- `applicationRoutes.generated.tsx` - Route fragments grouped by context with page imports
|
|
112
112
|
|
|
113
113
|
### 4. Wire Routes to App.tsx (BLOCKING)
|
|
114
114
|
|