deploy-stack 0.2.8 → 0.2.9

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.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,14 +43,75 @@ export async function generateTemplates(targetDir, config) {
43
43
 
44
44
  // 5. Handle .gitignore appending cleanly
45
45
  const targetGitignore = path.join(targetDir, '.gitignore');
46
- const gitignoreContent = await fs.readFile(path.join(templatesDir, '_gitignore'), 'utf-8');
47
46
 
48
47
  if (!fsSync.existsSync(targetGitignore)) {
49
- await fs.writeFile(targetGitignore, gitignoreContent);
48
+ await fs.writeFile(targetGitignore, gitignoreContent(options.finalFramework));
50
49
  } else {
51
50
  const existingGitignore = await fs.readFile(targetGitignore, 'utf-8');
52
51
  if (!existingGitignore.includes('terraform/.terraform/')) {
53
- await fs.appendFile(targetGitignore, '\n# Added by deploy-stack (Terraform)\nterraform/.terraform/\nterraform/*.tfstate\nterraform/*.tfstate.backup\nterraform/.terraform.lock.hcl\nterraform/secret_keys.json\nterraform/.terraform.*\n');
52
+ const appendIgnore = '\n# Added by deploy-stack (Terraform)\nterraform/.terraform/\nterraform/*.tfstate\nterraform/*.tfstate.backup\nterraform/.terraform.lock.hcl\nterraform/secret_keys.json\nterraform/.terraform.*\n.env\n';
53
+ await fs.appendFile(targetGitignore, appendIgnore);
54
54
  }
55
55
  }
56
+ }
57
+
58
+ function getGitignoreContent(framework) {
59
+ const baseIgnore = `
60
+ # Infrastructure (deploy-stack)
61
+ terraform/.terraform/
62
+ terraform/*.tfstate
63
+ terraform/*.tfstate.backup
64
+ terraform/.terraform.lock.hcl
65
+ terraform/secret_keys.json
66
+ terraform/.terraform.*
67
+ .env
68
+
69
+ # OS
70
+ .DS_Store
71
+ Thumbs.db
72
+ `;
73
+
74
+ const nodeIgnore = `
75
+ # Node.js
76
+ node_modules/
77
+ npm-debug.log
78
+ yarn-error.log
79
+ `;
80
+
81
+ const nextjsIgnore = `
82
+ # Next.js
83
+ node_modules/
84
+ .next/
85
+ out/
86
+ build/
87
+ next-env.d.ts
88
+ `;
89
+
90
+ const pythonIgnore = `
91
+ # Python
92
+ __pycache__/
93
+ *.py[cod]
94
+ *$py.class
95
+ venv/
96
+ env/
97
+ .venv/
98
+ .pytest_cache/
99
+ `;
100
+
101
+ const staticIgnore = `
102
+ # Static Sites
103
+ node_modules/
104
+ dist/
105
+ build/
106
+ .cache/
107
+ public/
108
+ `;
109
+
110
+ let frameworkIgnore = '';
111
+ if (framework === 'node') frameworkIgnore = nodeIgnore;
112
+ if (framework === 'nextjs') frameworkIgnore = nextjsIgnore;
113
+ if (framework === 'python') frameworkIgnore = pythonIgnore;
114
+ if (framework === 'static') frameworkIgnore = staticIgnore;
115
+
116
+ return (baseIgnore + frameworkIgnore).trim();
56
117
  }
@@ -1,19 +0,0 @@
1
- # Terraform
2
- terraform/.terraform/
3
- terraform/*.tfstate
4
- terraform/*.tfstate.backup
5
- terraform/.terraform.lock.hcl
6
- terraform/secret_keys.json
7
- terraform/.terraform.*
8
-
9
- # Node & Next.js
10
- node_modules/
11
- .next/
12
- .env
13
- .env.*
14
- !.env.example
15
-
16
- # Python
17
- __pycache__/
18
- *.pyc
19
- venv/