deploy-stack 0.3.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deploy-stack",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -85,7 +85,7 @@ export async function mainStack() {
85
85
  // 2.7 Set intelligent defaults
86
86
  let defaultPort = '3000';
87
87
 
88
- if (finalFramework === 'static') defaultPort = '80';
88
+ if (finalFramework === 'static') defaultPort = '8080';
89
89
  if (finalFramework === 'python') defaultPort = '8000';
90
90
 
91
91
  // 3. Prompt Configuration Group
@@ -232,10 +232,16 @@ export async function mainStack() {
232
232
  // 9. Provide the Outro, Framework Warnings and Next Steps
233
233
  const frameworkWarnings = getFrameworkWarning(finalFramework);
234
234
 
235
+ const isGitInitialized = fsSync.existsSync(path.join(targetDir, '.git'));
236
+
235
237
  const cdStep = projectName === '.' ? '' : `1. cd ${projectName}\n `;
236
238
  const deployStepNum = projectName === '.' ? '1' : '2';
237
239
  const gitStepNum = projectName === '.' ? '2' : '3';
238
240
 
241
+ const gitInstructions = isGitInitialized
242
+ ? `git add .\n git commit -m "chore: add AWS infrastructure and CI/CD"\n git push`
243
+ : `git init\n git add .\n git commit -m "chore: add AWS infrastructure and CI/CD"\n git branch -M main\n git remote add origin https://github.com/your-username/your-repo.git\n git push -u origin main`;
244
+
239
245
  outro(`
240
246
  ${color.green('✅ Project provisioned successfully!')}
241
247
 
@@ -244,8 +250,10 @@ export async function mainStack() {
244
250
  Next steps:
245
251
  ${cdStep}${deployStepNum}. Deploy infrastructure:
246
252
  cd terraform && terraform init && terraform apply
247
- ${gitStepNum}. Push to GitHub:
248
- git init && git add . && git commit -m "Initial commit"
253
+
254
+ ${gitStepNum}. Push to GitHub to trigger CI/CD:
255
+ cd ..
256
+ ${gitInstructions}
249
257
 
250
258
  ${color.cyan('Once deployed, Terraform will output your new https://*.cloudfront.net URL.')}
251
259
 
@@ -25,7 +25,7 @@ export function getFrameworkWarning(frameworkId) {
25
25
  return (
26
26
  color.bgYellow(color.black(' ⚠️ IMPORTANT: STATIC SITE SETUP REQUIRED ')) +
27
27
  color.yellow('\n 1. Open your generated Dockerfile.') +
28
- color.yellow('\n 2. Ensure the build output folder on line 15 matches your framework:') +
28
+ color.yellow('\n 2. Ensure the "COPY --from=builder" command matches your framework:') +
29
29
  color.yellow('\n Vite / Astro: COPY --from=builder /app/dist /usr/share/nginx/html') +
30
30
  color.yellow('\n Create React App: COPY --from=builder /app/build /usr/share/nginx/html') +
31
31
  color.yellow('\n 3. Ensure your package.json has a "build" script (e.g., "vite build").\n\n')
@@ -17,8 +17,17 @@ FROM nginx:alpine
17
17
  # Vite/Astro = dist | Create React App/Gatsby = build | Next.js Static = out
18
18
  COPY --from=builder /app/dist /usr/share/nginx/html
19
19
 
20
- # Dynamically update the Nginx port
21
- RUN sed -i "s/listen 80;/listen {{PORT}};/g" /etc/nginx/conf.d/default.conf
20
+ # Inject custom Nginx configuration for unprivileged ports and SPA routing
21
+ RUN echo "server {" > /etc/nginx/conf.d/default.conf && \
22
+ echo " listen {{PORT}};" >> /etc/nginx/conf.d/default.conf && \
23
+ echo " listen [::]:{{PORT}};" >> /etc/nginx/conf.d/default.conf && \
24
+ echo " server_name localhost;" >> /etc/nginx/conf.d/default.conf && \
25
+ echo " location / {" >> /etc/nginx/conf.d/default.conf && \
26
+ echo " root /usr/share/nginx/html;" >> /etc/nginx/conf.d/default.conf && \
27
+ echo " index index.html index.htm;" >> /etc/nginx/conf.d/default.conf && \
28
+ echo " try_files \$uri \$uri/ /index.html;" >> /etc/nginx/conf.d/default.conf && \
29
+ echo " }" >> /etc/nginx/conf.d/default.conf && \
30
+ echo "}" >> /etc/nginx/conf.d/default.conf
22
31
 
23
32
  # Silence unprivileged user directive warning in main config
24
33
  RUN sed -i 's/^user\s\+nginx;/# user nginx;/' /etc/nginx/nginx.conf