deploy-stack 0.17.1 → 0.17.3

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.
@@ -0,0 +1,46 @@
1
+ # Headless Mode & Automation Guide
2
+
3
+ The `deploy-stack` CLI is designed to be fully automatable for CI/CD pipelines, custom scripts, and framework plugins (like `vite-plugin-deploy-stack`).
4
+
5
+ By passing the `--headless` flag, you bypass all interactive terminal prompts.
6
+
7
+ ## Required Flags
8
+ To use headless mode, simply include the `--headless` flag.
9
+
10
+ If `deploy-stack` cannot auto-detect your framework, you should also provide the `--framework` flag to ensure the correct infrastructure is generated.
11
+
12
+ * **Valid `--framework` options:** `node`, `nextjs`, `nuxt`, `python`, `django`, `rails`, `go`, `static`
13
+
14
+ ## Optional Configuration Flags
15
+
16
+ You can append any of these flags to customize the generated architecture. These map exactly to the options available in the interactive setup:
17
+
18
+ | Flag | Description | Default |
19
+ |---|---|---|
20
+ | `--region=<region>` | The AWS region to deploy to (e.g., `us-east-1`, `eu-west-1`). | `us-east-2` |
21
+ | `--size=<size>` | The Fargate compute size (`micro` or `small`). | `micro` |
22
+ | `--port=<number>` | The internal port your container exposes. | Framework dependent (`3000`, `8080`, `8000`) |
23
+ | `--healthCheckPath=<path>`| The ALB health check endpoint path. | `/` |
24
+ | `--desiredCount=<number>` | Number of container replicas to run (`1` or `2`). | `1` |
25
+ | `--branch=<name>` | The primary Git deployment branch for CI/CD. | `main` |
26
+ | `--dir=<path>` | The directory to generate files into (use `.` for current).| `.` |
27
+ | `--enablePrPreviews` | Generates workflows for Ephemeral PR Previews. | `false` |
28
+ | `--yes` | Automatically bypasses confirmation prompts during apply/destroy. | `false` |
29
+ | `--no-telemetry` | Disables anonymous usage analytics. | `false` |
30
+
31
+ ## Example Usage
32
+
33
+ **Standard Static Site Automation (e.g., Vite/React):**
34
+ ```bash
35
+ npx deploy-stack --headless --framework=static --region=eu-west-1 --size=micro
36
+ ```
37
+
38
+ **Next.js High-Availability CI/CD Generation:**
39
+ ```bash
40
+ npx deploy-stack --headless --framework=nextjs --size=small --desiredCount=2 --yes
41
+ ```
42
+
43
+ **Node.js Backend with PR Previews:**
44
+ ```bash
45
+ npx deploy-stack --headless --framework=node --port=4000 --enablePrPreviews
46
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deploy-stack",
3
- "version": "0.17.1",
3
+ "version": "0.17.3",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -21,6 +21,9 @@ export function detectFramework(targetDir) {
21
21
  if (deps['nuxt']) return { id: 'nuxt', name: 'Nuxt 3 (SSR)' };
22
22
  if (deps['express']) return { id: 'node', name: 'Node.js / Express' };
23
23
 
24
+ // Explicit SvelteKit SSR Detection
25
+ if (deps['@sveltejs/kit']) return { id: 'svelte', name: 'SvelteKit SSR', buildDir: 'build' };
26
+
24
27
  // Static Site Generators & SPAs (with precise build directories)
25
28
  if (deps['@sveltejs/kit']) return { id: 'static', name: 'SvelteKit', buildDir: 'build' };
26
29
  if (deps['react-scripts']) return { id: 'static', name: 'Create React App', buildDir: 'build' };
@@ -60,6 +60,7 @@ export async function getProjectConfig(isHeadless, headlessOptions, targetDir, d
60
60
  { value: 'node', label: 'Node.js / Express' },
61
61
  { value: 'nextjs', label: 'Next.js (Standalone)' },
62
62
  { value: 'nuxt', label: 'Nuxt 3 (SSR)' },
63
+ { value: 'svelte', label: 'SvelteKit (SSR)' },
63
64
  { value: 'python', label: 'Python FastAPI' },
64
65
  { value: 'django', label: 'Django (Python)' },
65
66
  { value: 'rails', label: 'Ruby on Rails' },
@@ -0,0 +1,42 @@
1
+ # ==========================================
2
+ # Stage 1: Builder
3
+ # ==========================================
4
+ FROM node:22-alpine AS builder
5
+ WORKDIR /app
6
+
7
+ # Install all dependencies (including devDependencies)
8
+ COPY package*.json ./
9
+ RUN npm ci
10
+
11
+ # Copy source code and compile the SvelteKit application
12
+ COPY . .
13
+ # Inject the bypass flag so the adapter doesn't trigger inside the container!
14
+ RUN DEPLOY_STACK_BYPASS=true npm run build
15
+
16
+ # ==========================================
17
+ # Stage 2: Production (Zero-CVE)
18
+ # ==========================================
19
+ FROM node:22-alpine
20
+
21
+ # 1. DevSecOps: Patch underlying Alpine OS vulnerabilities
22
+ RUN apk update && apk upgrade --no-cache
23
+
24
+ # 2. Set production environment
25
+ ENV NODE_ENV=production
26
+ WORKDIR /app
27
+
28
+ # 3. Copy manifests and install ONLY production dependencies
29
+ COPY --from=builder --chown=node:node /app/package*.json ./
30
+ RUN npm ci --omit=dev && npm cache clean --force
31
+
32
+ # 4. Copy the compiled SvelteKit server from the builder stage
33
+ COPY --from=builder --chown=node:node /app/build/ ./build/
34
+
35
+ # 5. DevSecOps: Nuke NPM completely to eliminate Trivy vulnerabilities
36
+ RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx
37
+
38
+ USER node
39
+ EXPOSE {{PORT}}
40
+
41
+ # 6. Execute the raw Node server directly
42
+ CMD ["node", "build/index.js"]