deploy-stack 0.18.0 → 0.18.2

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.
Files changed (65) hide show
  1. package/.github/workflows/deploy-docs.yml +37 -0
  2. package/.github/workflows/iac-validation.yml +67 -6
  3. package/.github/workflows/publish.yml +5 -0
  4. package/.muserules +6 -1
  5. package/README.md +6 -6
  6. package/apps/docs/.astro/collections/docs.schema.json +644 -0
  7. package/apps/docs/.astro/content-assets.mjs +4 -0
  8. package/apps/docs/.astro/content-modules.mjs +4 -0
  9. package/apps/docs/.astro/content.d.ts +179 -0
  10. package/apps/docs/.astro/data-store.json +1 -0
  11. package/apps/docs/.astro/dev.json +14 -0
  12. package/apps/docs/.astro/settings.json +5 -0
  13. package/apps/docs/.astro/types.d.ts +2 -0
  14. package/apps/docs/astro.config.mjs +68 -0
  15. package/apps/docs/package.json +17 -0
  16. package/{docs/adr → apps/docs/src/content/docs/adrs}/0001-s3-native-state-locking.md +4 -1
  17. package/{docs/adr → apps/docs/src/content/docs/adrs}/0002-eject-mechanism-pure-iac.md +4 -1
  18. package/{docs/adr → apps/docs/src/content/docs/adrs}/0003-sync-ai-context-strategy.md +4 -1
  19. package/{docs/adr → apps/docs/src/content/docs/adrs}/0004-iac-driven-diagnostic-context.md +4 -1
  20. package/apps/docs/src/content/docs/cli/apply.md +29 -0
  21. package/apps/docs/src/content/docs/cli/destroy.md +29 -0
  22. package/apps/docs/src/content/docs/cli/diagnose.md +28 -0
  23. package/apps/docs/src/content/docs/cli/doctor.md +28 -0
  24. package/apps/docs/src/content/docs/cli/eject.md +29 -0
  25. package/apps/docs/src/content/docs/cli/init.md +42 -0
  26. package/apps/docs/src/content/docs/cli/secrets.md +36 -0
  27. package/apps/docs/src/content/docs/cli/sync-ai.md +27 -0
  28. package/apps/docs/src/content/docs/guides/aws-credentials.md +68 -0
  29. package/apps/docs/src/content/docs/guides/cicd-pipeline.md +46 -0
  30. package/{docs → apps/docs/src/content/docs}/guides/database-connections.md +4 -1
  31. package/apps/docs/src/content/docs/guides/docker-compose.md +37 -0
  32. package/apps/docs/src/content/docs/guides/dockerfiles.md +46 -0
  33. package/{docs → apps/docs/src/content/docs}/guides/ephemeral-pr-previews.md +4 -1
  34. package/{docs → apps/docs/src/content/docs/guides}/examples.md +15 -8
  35. package/apps/docs/src/content/docs/guides/frameworks.md +88 -0
  36. package/{docs → apps/docs/src/content/docs}/guides/headless.md +4 -1
  37. package/apps/docs/src/content/docs/guides/rerun-init.md +43 -0
  38. package/{docs → apps/docs/src/content/docs}/guides/secrets-management.md +4 -1
  39. package/apps/docs/src/content/docs/index.mdx +36 -0
  40. package/{docs/migration → apps/docs/src/content/docs/migrations}/astro-vercel-to-aws.md +4 -1
  41. package/{docs/migration → apps/docs/src/content/docs/migrations}/heroku-procfile-to-aws.md +4 -1
  42. package/{docs/migration → apps/docs/src/content/docs/migrations}/nextjs-vercel-to-aws.md +4 -1
  43. package/{docs/migration → apps/docs/src/content/docs/migrations}/sveltekit-vercel-to-aws.md +4 -1
  44. package/{docs/ROADMAP.md → apps/docs/src/content/docs/roadmap.md} +5 -2
  45. package/{docs → apps/docs/src/content/docs}/testing-strategy.md +13 -9
  46. package/apps/docs/src/content.config.ts +7 -0
  47. package/apps/docs/src/custom.css +14 -0
  48. package/apps/docs/tsconfig.json +6 -0
  49. package/bin/cli.js +1 -1
  50. package/package.json +7 -2
  51. package/src/commands/diagnose.js +21 -7
  52. package/src/commands/init.js +5 -5
  53. package/src/commands/secrets.js +23 -8
  54. package/src/core/telemetry.js +8 -5
  55. package/src/utils/aws.js +16 -0
  56. package/src/utils/generator.js +6 -5
  57. package/src/utils/prompts.js +1 -1
  58. package/templates/docker/nestjs.Dockerfile +15 -3
  59. package/templates/docker/svelte.Dockerfile +4 -2
  60. package/templates/terraform/backend.tf +14 -1
  61. package/templates/terraform/secrets.tf +0 -6
  62. package/tests/__snapshots__/generator.test.js.snap +4 -2
  63. package/tests/diagnose.test.js +2 -2
  64. package/tests/secrets.test.js +29 -0
  65. package/docs/frameworks.md +0 -34
@@ -0,0 +1,37 @@
1
+ name: Deploy Docs to GitHub Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths: ['apps/docs/**']
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-node@v4
20
+ with:
21
+ node-version: 22
22
+ - run: npm ci
23
+ - run: npm run build
24
+ working-directory: apps/docs
25
+ - uses: actions/upload-pages-artifact@v3
26
+ with:
27
+ path: apps/docs/dist
28
+
29
+ deploy:
30
+ environment:
31
+ name: github-pages
32
+ url: ${{ steps.deployment.outputs.page_url }}
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - id: deployment
37
+ uses: actions/deploy-pages@v4
@@ -5,6 +5,7 @@ on:
5
5
  branches: [main]
6
6
  pull_request:
7
7
  workflow_dispatch:
8
+ workflow_call:
8
9
 
9
10
  jobs:
10
11
  validate:
@@ -32,10 +33,15 @@ jobs:
32
33
  github_token: ${{ secrets.GITHUB_TOKEN }}
33
34
 
34
35
  - name: Scaffold app (${{ matrix.framework }})
36
+ env:
37
+ CI_MOCK_AWS: 'true'
38
+ DO_NOT_TRACK: '1'
35
39
  run: |
36
- TMPDIR=$(mktemp -d)
37
- echo "GENERATED_DIR=$TMPDIR" >> "$GITHUB_ENV"
38
- cd "$TMPDIR"
40
+ TMPROOT=$(mktemp -d)
41
+ APP_DIR="$TMPROOT/test-app-${{ matrix.framework }}"
42
+ mkdir -p "$APP_DIR"
43
+ echo "GENERATED_DIR=$APP_DIR" >> "$GITHUB_ENV"
44
+ cd "$APP_DIR"
39
45
  node "$GITHUB_WORKSPACE/bin/cli.js" --headless --preconfigured --framework=${{ matrix.framework }}
40
46
 
41
47
  - name: Terraform Compile
@@ -52,11 +58,66 @@ jobs:
52
58
  working-directory: ${{ env.GENERATED_DIR }}/terraform
53
59
  run: tflint
54
60
 
55
- - name: DevSecOps Scan
56
- uses: aquasecurity/trivy-action@master
61
+ - name: DevSecOps Scan (IaC & Filesystem)
62
+ uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25
57
63
  with:
58
64
  scan-type: 'fs'
59
65
  scan-ref: ${{ env.GENERATED_DIR }}
60
66
  format: 'table'
67
+ output: 'trivy-fs-results.txt'
61
68
  severity: 'HIGH,CRITICAL'
62
- exit-code: '1'
69
+ exit-code: '0'
70
+
71
+ - name: Build Container Image
72
+ working-directory: ${{ env.GENERATED_DIR }}
73
+ run: |
74
+ awk '
75
+ /^COPY/ { next }
76
+ /^RUN/ {
77
+ if ($0 ~ /apk |apt-get |apt |addgroup |adduser |groupadd |useradd |gem install |mkdir |chown |rm /) {
78
+ print $0
79
+ skip = 0
80
+ } else {
81
+ skip = 1
82
+ }
83
+ next
84
+ }
85
+ {
86
+ if (skip) {
87
+ # If the line does NOT end with a backslash, the skipped block is over
88
+ if ($0 !~ /\\ *$/) skip = 0
89
+ } else {
90
+ print $0
91
+ }
92
+ }
93
+ ' Dockerfile > Dockerfile.tmp && mv Dockerfile.tmp Dockerfile
94
+
95
+ # Print the patched Dockerfile to the logs for easy debugging
96
+ echo "Patched Dockerfile:"
97
+ cat Dockerfile
98
+ echo "-------------------"
99
+
100
+ docker build -t test-app-${{ matrix.framework }}:latest .
101
+
102
+ - name: DevSecOps Scan (Container Image)
103
+ uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25
104
+ with:
105
+ image-ref: 'test-app-${{ matrix.framework }}:latest'
106
+ format: 'table'
107
+ output: 'trivy-image-results.txt'
108
+ severity: 'HIGH,CRITICAL'
109
+ exit-code: '0'
110
+
111
+ - name: Publish Trivy Summary to GitHub Actions UI
112
+ if: always()
113
+ run: |
114
+ echo "### 🏗️ Terraform Misconfiguration Scan (${{ matrix.framework }})" >> $GITHUB_STEP_SUMMARY
115
+ echo "\`\`\`text" >> $GITHUB_STEP_SUMMARY
116
+ if [ -f trivy-fs-results.txt ]; then cat trivy-fs-results.txt >> $GITHUB_STEP_SUMMARY; else echo "Scan failed or skipped."; fi
117
+ echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
118
+ echo "" >> $GITHUB_STEP_SUMMARY
119
+
120
+ echo "### 🛡️ Container Security Scan Results (${{ matrix.framework }})" >> $GITHUB_STEP_SUMMARY
121
+ echo "\`\`\`text" >> $GITHUB_STEP_SUMMARY
122
+ if [ -f trivy-image-results.txt ]; then cat trivy-image-results.txt >> $GITHUB_STEP_SUMMARY; else echo "Container scan failed or skipped."; fi
123
+ echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
@@ -5,7 +5,12 @@ on:
5
5
  types: [published]
6
6
 
7
7
  jobs:
8
+ validate:
9
+ uses: ./.github/workflows/iac-validation.yml
10
+ secrets: inherit
11
+
8
12
  build-and-publish:
13
+ needs: [validate]
9
14
  runs-on: ubuntu-latest
10
15
  permissions:
11
16
  contents: read
package/.muserules CHANGED
@@ -13,4 +13,9 @@
13
13
  ## 3. Workflow
14
14
  - Read the relevant `specs/` document before writing any code.
15
15
  - Run `npm test` continuously to verify your work.
16
- - Do not conclude your task until the test suite passes completely.
16
+ - Do not conclude your task until the test suite passes completely.
17
+
18
+ ## 4. Documentation & Communication
19
+ - **Audience First:** Write all READMEs, documentation, and release notes for the **end-user**, not the backend engineer.
20
+ - **Focus on Value:** Emphasize *what* the change does for the user (e.g., "Enhanced security," "Faster deployments") rather than *how* it was implemented under the hood.
21
+ - **Hide the Wiring:** Do not explain deep technical refactors, regex changes, or script adjustments in user-facing docs unless they require the user to change their own behavior. Keep it concise, accessible, and benefit-driven.
package/README.md CHANGED
@@ -56,11 +56,11 @@ You retain complete ownership of your infrastructure code without relying on bla
56
56
 
57
57
  ## 📚 Documentation & Guides
58
58
  Transitioning from PaaS to AWS involves a few architectural shifts. We've written concise guides to help you understand how `deploy-stack` handles the heavy lifting:
59
- * [Migrating from Heroku to AWS (Procfile Support)](./docs/migrations/heroku-procfile-to-aws.md)
60
- * [Managing Secrets & Environment Variables](./docs/guides/secrets-management.md)
61
- * [Zero-Trust Database Connections](./docs/guides/database-connections.md)
62
- * [Migrating Next.js from Vercel](./docs/migrations/nextjs-vercel-to-aws.md)
63
- * [Ephemeral PR Previews & AWS Costs](./docs/guides/ephemeral-pr-previews.md)
59
+ * [Migrating from Heroku to AWS (Procfile Support)](./apps/docs/src/content/docs/migrations/heroku-procfile-to-aws.md)
60
+ * [Managing Secrets & Environment Variables](./apps/docs/src/content/docs/guides/secrets-management.md)
61
+ * [Zero-Trust Database Connections](./apps/docs/src/content/docs/guides/database-connections.md)
62
+ * [Migrating Next.js from Vercel](./apps/docs/src/content/docs/migrations/nextjs-vercel-to-aws.md)
63
+ * [Ephemeral PR Previews & AWS Costs](./apps/docs/src/content/docs/guides/ephemeral-pr-previews.md)
64
64
 
65
65
  ---
66
66
 
@@ -139,7 +139,7 @@ your-project/
139
139
  * **[Heroku to AWS Migration (Django)](https://github.com/anton-codes-iac/deploy-stack-heroku-django-example):** A classic Heroku-style monolith migrated via the Procfile Importer.
140
140
  * **[Zero-Secret AWS Secrets Manager Injection](https://github.com/anton-codes-iac/deploy-stack-secrets-example):** A production-grade Node.js architecture demonstrating zero-plaintext secret injection. Encrypts local `.env` variables directly into AWS and maps them into ECS memory at container boot, verified against GitHub's API.
141
141
 
142
- 👉 **[View all 14+ reference implementations in our Examples Gallery](./docs/examples.md)**
142
+ 👉 **[View all 14+ reference implementations in our Examples Gallery](./apps/docs/src/content/docs/examples.md)**
143
143
 
144
144
  ---
145
145