deploy-stack 0.18.1 → 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.
- package/.github/workflows/deploy-docs.yml +37 -0
- package/README.md +6 -6
- package/apps/docs/.astro/collections/docs.schema.json +644 -0
- package/apps/docs/.astro/content-assets.mjs +4 -0
- package/apps/docs/.astro/content-modules.mjs +4 -0
- package/apps/docs/.astro/content.d.ts +179 -0
- package/apps/docs/.astro/data-store.json +1 -0
- package/apps/docs/.astro/dev.json +14 -0
- package/apps/docs/.astro/settings.json +5 -0
- package/apps/docs/.astro/types.d.ts +2 -0
- package/apps/docs/astro.config.mjs +68 -0
- package/apps/docs/package.json +17 -0
- package/{docs/adr → apps/docs/src/content/docs/adrs}/0001-s3-native-state-locking.md +4 -1
- package/{docs/adr → apps/docs/src/content/docs/adrs}/0002-eject-mechanism-pure-iac.md +4 -1
- package/{docs/adr → apps/docs/src/content/docs/adrs}/0003-sync-ai-context-strategy.md +4 -1
- package/{docs/adr → apps/docs/src/content/docs/adrs}/0004-iac-driven-diagnostic-context.md +4 -1
- package/apps/docs/src/content/docs/cli/apply.md +29 -0
- package/apps/docs/src/content/docs/cli/destroy.md +29 -0
- package/apps/docs/src/content/docs/cli/diagnose.md +28 -0
- package/apps/docs/src/content/docs/cli/doctor.md +28 -0
- package/apps/docs/src/content/docs/cli/eject.md +29 -0
- package/apps/docs/src/content/docs/cli/init.md +42 -0
- package/apps/docs/src/content/docs/cli/secrets.md +36 -0
- package/apps/docs/src/content/docs/cli/sync-ai.md +27 -0
- package/apps/docs/src/content/docs/guides/aws-credentials.md +68 -0
- package/apps/docs/src/content/docs/guides/cicd-pipeline.md +46 -0
- package/{docs → apps/docs/src/content/docs}/guides/database-connections.md +4 -1
- package/apps/docs/src/content/docs/guides/docker-compose.md +37 -0
- package/apps/docs/src/content/docs/guides/dockerfiles.md +46 -0
- package/{docs → apps/docs/src/content/docs}/guides/ephemeral-pr-previews.md +4 -1
- package/{docs → apps/docs/src/content/docs/guides}/examples.md +14 -7
- package/apps/docs/src/content/docs/guides/frameworks.md +88 -0
- package/{docs → apps/docs/src/content/docs}/guides/headless.md +4 -1
- package/apps/docs/src/content/docs/guides/rerun-init.md +43 -0
- package/{docs → apps/docs/src/content/docs}/guides/secrets-management.md +4 -1
- package/apps/docs/src/content/docs/index.mdx +36 -0
- package/{docs/migration → apps/docs/src/content/docs/migrations}/astro-vercel-to-aws.md +4 -1
- package/{docs/migration → apps/docs/src/content/docs/migrations}/heroku-procfile-to-aws.md +4 -1
- package/{docs/migration → apps/docs/src/content/docs/migrations}/nextjs-vercel-to-aws.md +4 -1
- package/{docs/migration → apps/docs/src/content/docs/migrations}/sveltekit-vercel-to-aws.md +4 -1
- package/{docs/ROADMAP.md → apps/docs/src/content/docs/roadmap.md} +5 -2
- package/{docs → apps/docs/src/content/docs}/testing-strategy.md +11 -8
- package/apps/docs/src/content.config.ts +7 -0
- package/apps/docs/src/custom.css +14 -0
- package/apps/docs/tsconfig.json +6 -0
- package/bin/cli.js +1 -1
- package/package.json +7 -2
- package/src/commands/diagnose.js +21 -7
- package/src/commands/init.js +5 -5
- package/src/commands/secrets.js +23 -8
- package/src/core/telemetry.js +8 -5
- package/src/utils/prompts.js +1 -1
- package/tests/diagnose.test.js +2 -2
- package/tests/secrets.test.js +29 -0
- package/docs/frameworks.md +0 -34
package/src/utils/prompts.js
CHANGED
|
@@ -106,7 +106,7 @@ export async function getProjectConfig(isHeadless, headlessOptions, targetDir, d
|
|
|
106
106
|
let aiAssistants = [];
|
|
107
107
|
if (setupType === 'advanced') {
|
|
108
108
|
const prChoice = await confirm({
|
|
109
|
-
message: `Enable Ephemeral PR Previews? (Spins up isolated, temporary AWS environments for PRs)\n ${color.gray('📖 Learn more: https://github.com/anton-codes-iac/deploy-stack/blob/main/docs/guides/ephemeral-pr-previews.md')}`,
|
|
109
|
+
message: `Enable Ephemeral PR Previews? (Spins up isolated, temporary AWS environments for PRs)\n ${color.gray('📖 Learn more: https://github.com/anton-codes-iac/deploy-stack/blob/main/apps/docs/src/content/docs/guides/ephemeral-pr-previews.md')}`,
|
|
110
110
|
initialValue: false,
|
|
111
111
|
});
|
|
112
112
|
if (typeof prChoice === 'symbol') process.exit(0);
|
package/tests/diagnose.test.js
CHANGED
|
@@ -104,7 +104,7 @@ describe('Command: diagnose', () => {
|
|
|
104
104
|
try {
|
|
105
105
|
const result = await runDiagnose({
|
|
106
106
|
cluster: 'test-cluster',
|
|
107
|
-
region: 'us-east-
|
|
107
|
+
region: 'us-east-2',
|
|
108
108
|
logGroup: '/ecs/test'
|
|
109
109
|
});
|
|
110
110
|
|
|
@@ -132,7 +132,7 @@ describe('Command: diagnose', () => {
|
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
try {
|
|
135
|
-
const result = await runDiagnose({ cluster: 'test-cluster', region: 'us-east-
|
|
135
|
+
const result = await runDiagnose({ cluster: 'test-cluster', region: 'us-east-2' });
|
|
136
136
|
expect(result.healthy).toBe(true);
|
|
137
137
|
expect(mockLogsSend).not.toHaveBeenCalled();
|
|
138
138
|
expect(output.join('\n')).toMatch(/healthy|No stopped tasks/i);
|
package/tests/secrets.test.js
CHANGED
|
@@ -90,4 +90,33 @@ describe('Secrets Push Command', () => {
|
|
|
90
90
|
exitSpy.mockRestore();
|
|
91
91
|
consoleSpy.mockRestore();
|
|
92
92
|
});
|
|
93
|
+
|
|
94
|
+
it('gracefully falls back to .env when envFilePath is undefined or omitted', async () => {
|
|
95
|
+
// Create default .env file
|
|
96
|
+
await fs.writeFile('.env', 'DATABASE_URL=postgres://localhost:5432/db');
|
|
97
|
+
await fs.writeFile(path.join('terraform', 'main.tf'), 'region = "us-east-1"');
|
|
98
|
+
|
|
99
|
+
// Call pushSecrets with undefined/omitted argument
|
|
100
|
+
await pushSecrets(undefined, 'my-project');
|
|
101
|
+
|
|
102
|
+
// Verify it resolved .env properly and sent secrets
|
|
103
|
+
expect(MockUpdateSecretCommand).toHaveBeenCalledWith({
|
|
104
|
+
SecretId: 'my-project-secrets',
|
|
105
|
+
SecretString: JSON.stringify({ DATABASE_URL: 'postgres://localhost:5432/db' })
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('gracefully falls back to .env when envFilePath is passed as an object or invalid type', async () => {
|
|
110
|
+
// Simulates Commander passing an options object as the first parameter
|
|
111
|
+
await fs.writeFile('.env', 'STRIPE_KEY=sk_test_12345');
|
|
112
|
+
await fs.writeFile(path.join('terraform', 'main.tf'), 'region = "us-east-1"');
|
|
113
|
+
|
|
114
|
+
// Call pushSecrets with an object
|
|
115
|
+
await pushSecrets({}, 'my-project');
|
|
116
|
+
|
|
117
|
+
expect(MockUpdateSecretCommand).toHaveBeenCalledWith({
|
|
118
|
+
SecretId: 'my-project-secrets',
|
|
119
|
+
SecretString: JSON.stringify({ STRIPE_KEY: 'sk_test_12345' })
|
|
120
|
+
});
|
|
121
|
+
});
|
|
93
122
|
});
|
package/docs/frameworks.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# 🧩 Framework Support & Quirks
|
|
2
|
-
|
|
3
|
-
`deploy-stack` is designed to be as "zero-config" as possible. However, because different frameworks have unique internal architectures (especially around network binding and build outputs), a few frameworks require minor application-level tweaks to run securely in a Dockerized AWS Fargate environment.
|
|
4
|
-
|
|
5
|
-
## The 3-Tier Support Philosophy
|
|
6
|
-
|
|
7
|
-
We handle framework requirements using a 3-tier strategy so you are never left guessing why a deployment failed:
|
|
8
|
-
|
|
9
|
-
1. **Zero-Touch Plugins (Tier 1):** If you use one of our ecosystem plugins (e.g., `nest add nest-deploy-stack` or `cookiecutter-django-deploy-stack`), your code is automatically patched and configured. Zero manual intervention required.
|
|
10
|
-
2. **Intelligent CLI Pre-flight (Tier 2):** If you run the standalone `deploy-stack` CLI against a raw repository, the CLI statically analyzes your code. If it detects a missing production requirement (like a localhost binding), it will flag it inline in your terminal with the exact copy-paste fix.
|
|
11
|
-
3. **In-Repo Docs (Tier 3):** The generated `DEPLOYMENT.md` file always contains a framework-specific checklist before you push to CI/CD.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 🛠️ Framework Requirements Cheat Sheet
|
|
16
|
-
|
|
17
|
-
| Framework | What `deploy-stack` Automates | Application Code Requirement | Zero-Click Starter / Plugin |
|
|
18
|
-
|---|---|---|---|
|
|
19
|
-
| **Next.js** | Multi-stage Dockerfile, CloudFront edge routing, `vercel.json` parsing | `output: 'standalone'` must be set in `next.config.js` | Built-in CLI detection |
|
|
20
|
-
| **NestJS** | Multi-stage TypeScript build (`dist/`), unprivileged Node runtime | `await app.listen(port, '0.0.0.0')` in `src/main.ts` | `nest-deploy-stack` (`nest add`) |
|
|
21
|
-
| **FastAPI** | Alpine Python container, Uvicorn CLI args, unprivileged port mapping | None (0.0.0.0 set via Docker CMD) | `cookiecutter-fastapi-deploy-stack` |
|
|
22
|
-
| **Django** | Gunicorn WSGI adapter, Celery worker topologies, RDS bindings | None (0.0.0.0 set via Docker CMD) | `cookiecutter-django-deploy-stack` |
|
|
23
|
-
| **Ruby on Rails** | Puma adapter, `RAILS_MASTER_KEY` injection into Secrets Manager placeholder, Kamal Dockerfile replaced with 0-CVE Alpine build | None (0.0.0.0 set via Docker CMD) | `rails-template-deploy-stack` |
|
|
24
|
-
| **Nuxt 3** | Nitro-optimized Node output | None (`NITRO_HOST=0.0.0.0` injected automatically) | `nuxt-deploy-stack` |
|
|
25
|
-
| **SvelteKit** | Node adapter conversion | None (`HOST=0.0.0.0` injected automatically) | `svelte-adapter-deploy-stack` |
|
|
26
|
-
| **Static Sites** *(Vite, Astro, React)* | Output folder detection (`dist/`, `build/`), Nginx routing | None | `vite-plugin-deploy-stack` |
|
|
27
|
-
|
|
28
|
-
## ⚠️ The Golden Rule: 0.0.0.0 vs Localhost
|
|
29
|
-
|
|
30
|
-
The most common reason a newly deployed container fails its ALB health check is network binding.
|
|
31
|
-
|
|
32
|
-
In local development, frameworks bind to `localhost` (or `127.0.0.1`) for security. However, inside a Docker container on AWS ECS, binding to `localhost` means the web server only listens to internal container traffic. The AWS Application Load Balancer (ALB) trying to route traffic from the outside world will hit a closed port, resulting in a `502 Bad Gateway` or `503 Service Temporarily Unavailable`.
|
|
33
|
-
|
|
34
|
-
**Always ensure your application explicitly binds to `0.0.0.0`.**
|