@atlashub/smartstack-cli 4.54.0 → 4.55.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/dist/index.js +114 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/project/Dockerfile.backend.template +56 -0
- package/templates/project/Dockerfile.frontend.template +63 -0
- package/templates/project/dockerignore.template +13 -0
- package/templates/skills/business-analyse-html/SKILL.md +2 -0
- package/templates/skills/business-analyse-html/steps/step-03-render.md +17 -0
package/package.json
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# SmartStack Backend - Multi-stage build
|
|
3
|
+
# Image: smartstack-{project}-backend:{tag}
|
|
4
|
+
# ============================================================
|
|
5
|
+
|
|
6
|
+
# --- Stage 1: Build ---
|
|
7
|
+
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
8
|
+
WORKDIR /src
|
|
9
|
+
|
|
10
|
+
# Copy project files for NuGet restore cache
|
|
11
|
+
COPY src/{{ProjectName}}.Domain/{{ProjectName}}.Domain.csproj {{ProjectName}}.Domain/
|
|
12
|
+
COPY src/{{ProjectName}}.Application/{{ProjectName}}.Application.csproj {{ProjectName}}.Application/
|
|
13
|
+
COPY src/{{ProjectName}}.Infrastructure/{{ProjectName}}.Infrastructure.csproj {{ProjectName}}.Infrastructure/
|
|
14
|
+
COPY src/{{ProjectName}}.Api/{{ProjectName}}.Api.csproj {{ProjectName}}.Api/
|
|
15
|
+
|
|
16
|
+
# Restore packages (cached layer)
|
|
17
|
+
RUN dotnet restore {{ProjectName}}.Api/{{ProjectName}}.Api.csproj
|
|
18
|
+
|
|
19
|
+
# Copy all source code
|
|
20
|
+
COPY src/{{ProjectName}}.Domain/ {{ProjectName}}.Domain/
|
|
21
|
+
COPY src/{{ProjectName}}.Application/ {{ProjectName}}.Application/
|
|
22
|
+
COPY src/{{ProjectName}}.Infrastructure/ {{ProjectName}}.Infrastructure/
|
|
23
|
+
COPY src/{{ProjectName}}.Api/ {{ProjectName}}.Api/
|
|
24
|
+
|
|
25
|
+
# Publish release build
|
|
26
|
+
RUN dotnet publish {{ProjectName}}.Api/{{ProjectName}}.Api.csproj \
|
|
27
|
+
-c Release \
|
|
28
|
+
-o /app/publish \
|
|
29
|
+
--no-restore
|
|
30
|
+
|
|
31
|
+
# --- Stage 2: Runtime ---
|
|
32
|
+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
|
33
|
+
WORKDIR /app
|
|
34
|
+
|
|
35
|
+
# Create non-root user
|
|
36
|
+
RUN adduser --disabled-password --gecos "" appuser
|
|
37
|
+
|
|
38
|
+
# Copy published app
|
|
39
|
+
COPY --from=build /app/publish .
|
|
40
|
+
|
|
41
|
+
# Configure ports
|
|
42
|
+
# 5142 = API HTTP
|
|
43
|
+
# 5143 = WebSocket (SignalR)
|
|
44
|
+
# 8080 = Health check
|
|
45
|
+
EXPOSE 5142 5143 8080
|
|
46
|
+
|
|
47
|
+
ENV ASPNETCORE_URLS="http://+:5142;http://+:5143;http://+:8080"
|
|
48
|
+
|
|
49
|
+
# Health check
|
|
50
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
51
|
+
CMD curl -f http://localhost:8080/health || exit 1
|
|
52
|
+
|
|
53
|
+
# Run as non-root
|
|
54
|
+
USER appuser
|
|
55
|
+
|
|
56
|
+
ENTRYPOINT ["dotnet", "{{ProjectName}}.Api.dll"]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# SmartStack Frontend - Multi-stage build
|
|
3
|
+
# Image: smartstack-{project}-frontend:{tag}
|
|
4
|
+
# ============================================================
|
|
5
|
+
|
|
6
|
+
# --- Stage 1: Build ---
|
|
7
|
+
FROM node:22-alpine AS build
|
|
8
|
+
WORKDIR /app
|
|
9
|
+
|
|
10
|
+
# Build arguments for API URLs (injected at build time)
|
|
11
|
+
ARG VITE_API_URL
|
|
12
|
+
ARG VITE_WS_URL
|
|
13
|
+
|
|
14
|
+
# Copy package files for npm cache
|
|
15
|
+
COPY package.json package-lock.json ./
|
|
16
|
+
|
|
17
|
+
# Install dependencies (cached layer)
|
|
18
|
+
RUN npm install
|
|
19
|
+
|
|
20
|
+
# Copy source code
|
|
21
|
+
COPY . .
|
|
22
|
+
|
|
23
|
+
# Build for production
|
|
24
|
+
RUN npm run build:prod
|
|
25
|
+
|
|
26
|
+
# --- Stage 2: Runtime ---
|
|
27
|
+
FROM nginx:alpine AS runtime
|
|
28
|
+
|
|
29
|
+
# Copy built files
|
|
30
|
+
COPY --from=build /app/dist /usr/share/nginx/html
|
|
31
|
+
|
|
32
|
+
# Inline Nginx configuration
|
|
33
|
+
RUN cat > /etc/nginx/conf.d/default.conf << 'NGINX'
|
|
34
|
+
server {
|
|
35
|
+
listen 3000;
|
|
36
|
+
server_name _;
|
|
37
|
+
root /usr/share/nginx/html;
|
|
38
|
+
index index.html;
|
|
39
|
+
|
|
40
|
+
# SPA routing - fallback to index.html
|
|
41
|
+
location / {
|
|
42
|
+
try_files $uri $uri/ /index.html;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# Gzip compression
|
|
46
|
+
gzip on;
|
|
47
|
+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
|
|
48
|
+
gzip_min_length 256;
|
|
49
|
+
|
|
50
|
+
# Static asset caching (1 year for hashed files)
|
|
51
|
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
52
|
+
expires 1y;
|
|
53
|
+
add_header Cache-Control "public, immutable";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
NGINX
|
|
57
|
+
|
|
58
|
+
EXPOSE 3000
|
|
59
|
+
|
|
60
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
|
61
|
+
CMD wget -qO- http://localhost:3000/ || exit 1
|
|
62
|
+
|
|
63
|
+
CMD ["nginx", "-g", "daemon off;"]
|
|
@@ -49,6 +49,8 @@ Generate the interactive HTML document of the business analysis from the JSON an
|
|
|
49
49
|
- **NEVER** call `.join()` on arrays without checking element types — object elements produce `[object Object]`
|
|
50
50
|
- **Final file** MUST be > 100KB
|
|
51
51
|
- **Final file** MUST NOT contain the string `[object Object]`
|
|
52
|
+
- **NEVER** reuse a build script (`_build-html.js`, `generate-html.js`) from a previous session — always re-execute steps 01→02→03→04 from scratch. Build scripts are throwaway artifacts that bypass the skill's normalization logic.
|
|
53
|
+
- **With `--force`:** delete any existing build script before proceeding
|
|
52
54
|
|
|
53
55
|
## References
|
|
54
56
|
|
|
@@ -13,6 +13,23 @@ Inject FEATURE_DATA and EMBEDDED_ARTIFACTS into the HTML template and write the
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
+
## PRE-RENDER CLEANUP (MANDATORY)
|
|
17
|
+
|
|
18
|
+
> **NEVER reuse a build script from a previous session.**
|
|
19
|
+
> Build scripts (`_build-html.js`, `generate-html.js`) are throwaway artifacts that bypass
|
|
20
|
+
> the skill's normalization logic (normalizeKpi, normalizeColumn, Format B-CANONICAL).
|
|
21
|
+
> Reusing them causes stale data and missed fixes.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Delete any existing build scripts in the project directory:
|
|
25
|
+
rm -f _build-html.js generate-html.js build-html.js
|
|
26
|
+
|
|
27
|
+
This ensures the HTML is always generated from the current step-02 output,
|
|
28
|
+
not from a cached script that may use outdated mapping logic.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
16
33
|
## EXECUTION SEQUENCE
|
|
17
34
|
|
|
18
35
|
### 1. Locate Template
|