stackloom-cli 1.0.0
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/LICENSE +21 -0
- package/README.md +169 -0
- package/bin/cli.js +306 -0
- package/branding.json +8 -0
- package/package.json +72 -0
- package/src/__tests__/cli-smoke.test.js +46 -0
- package/src/blueprint/__tests__/blueprint.test.js +116 -0
- package/src/blueprint/blueprint.js +181 -0
- package/src/blueprint/default.blueprint.json +78 -0
- package/src/blueprint/index.js +10 -0
- package/src/blueprint/loader.js +101 -0
- package/src/blueprint/schema-kit.js +161 -0
- package/src/blueprint/schema.js +78 -0
- package/src/branding/__tests__/branding.test.js +49 -0
- package/src/branding/index.js +48 -0
- package/src/commands/__tests__/commands.test.js +83 -0
- package/src/commands/check.js +71 -0
- package/src/commands/cleanup.js +347 -0
- package/src/commands/customize.js +263 -0
- package/src/commands/doctor.js +84 -0
- package/src/commands/env.js +75 -0
- package/src/commands/finalize.js +68 -0
- package/src/commands/generate/ci-cd.js +378 -0
- package/src/commands/generate/deploy-advanced.js +253 -0
- package/src/commands/generate/deploy.js +99 -0
- package/src/commands/generate/env.template.js +221 -0
- package/src/commands/generate/index.js +7 -0
- package/src/commands/generate/module.js +836 -0
- package/src/commands/generate/page.js +1415 -0
- package/src/commands/generate/test-scaffold.js +279 -0
- package/src/commands/generate/theme.js +67 -0
- package/src/commands/generate-resource.js +133 -0
- package/src/commands/index.js +9 -0
- package/src/commands/init.js +350 -0
- package/src/commands/make/resource.js +298 -0
- package/src/commands/preset.js +57 -0
- package/src/commands/remove.js +170 -0
- package/src/commands/rename.js +54 -0
- package/src/commands/rollback.js +90 -0
- package/src/commands/wizard.js +303 -0
- package/src/core/__tests__/generator.test.js +67 -0
- package/src/core/__tests__/marker-strategy.test.js +57 -0
- package/src/core/__tests__/resource-definition.test.js +32 -0
- package/src/core/generator.js +542 -0
- package/src/core/marker-strategy.js +138 -0
- package/src/core/resource-definition.js +346 -0
- package/src/core/state-tracker.js +67 -0
- package/src/core/template-loader.js +163 -0
- package/src/engine/__tests__/engine.test.js +306 -0
- package/src/engine/index.js +21 -0
- package/src/engine/injector.js +198 -0
- package/src/engine/pipeline.js +138 -0
- package/src/engine/transaction.js +105 -0
- package/src/engine/validator.js +190 -0
- package/src/index.js +4 -0
- package/src/recipes/__tests__/recipe.test.js +128 -0
- package/src/recipes/builtin/module.json +22 -0
- package/src/recipes/builtin/page.json +21 -0
- package/src/recipes/builtin/resource.json +35 -0
- package/src/recipes/condition.js +147 -0
- package/src/recipes/index.js +11 -0
- package/src/recipes/loader.js +95 -0
- package/src/recipes/recipe.js +89 -0
- package/src/recipes/schema.js +47 -0
- package/src/schemas/__tests__/schemas.test.js +67 -0
- package/src/schemas/index.js +18 -0
- package/src/schemas/options.js +38 -0
- package/src/schemas/resource.js +112 -0
- package/src/services/__tests__/reporter.test.js +98 -0
- package/src/services/clock.js +31 -0
- package/src/services/index.js +43 -0
- package/src/services/reporter.js +136 -0
- package/src/templates/resource/api.js.ejs +39 -0
- package/src/templates/resource/components/form.jsx.ejs +81 -0
- package/src/templates/resource/components/table.jsx.ejs +68 -0
- package/src/templates/resource/controller.js.ejs +154 -0
- package/src/templates/resource/hooks.js.ejs +46 -0
- package/src/templates/resource/model.js.ejs +64 -0
- package/src/templates/resource/page-detail.jsx.ejs +55 -0
- package/src/templates/resource/page-form.jsx.ejs +30 -0
- package/src/templates/resource/page-inline.jsx.ejs +74 -0
- package/src/templates/resource/page-modal.jsx.ejs +98 -0
- package/src/templates/resource/page-page.jsx.ejs +99 -0
- package/src/templates/resource/page-sidepanel.jsx.ejs +100 -0
- package/src/templates/resource/routes.js.ejs +35 -0
- package/src/templates/resource/service.js.ejs +132 -0
- package/src/templates/resource/test.ejs +71 -0
- package/src/templates/resource/types.ts.ejs +17 -0
- package/src/templates/resource/validator.js.ejs +26 -0
- package/src/templates/snippets/lazy-import.ejs +1 -0
- package/src/templates/snippets/nav-entry.ejs +1 -0
- package/src/templates/snippets/route-entry.ejs +5 -0
- package/src/templates/snippets/route-mount.ejs +1 -0
- package/src/utils/fieldValidators.js +371 -0
- package/src/utils/logging/logger.js +47 -0
- package/src/utils/namingUtils.js +38 -0
- package/src/utils/sanitize.js +200 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// Environment Configuration Template
|
|
2
|
+
// Usage: Generate .env files for different environments
|
|
3
|
+
|
|
4
|
+
export const envTemplate = `# ============================================
|
|
5
|
+
# Environment Configuration
|
|
6
|
+
# ============================================
|
|
7
|
+
# Copy this file to .env and update with your values
|
|
8
|
+
# Never commit .env to version control!
|
|
9
|
+
|
|
10
|
+
# ============================================
|
|
11
|
+
# Application
|
|
12
|
+
# ============================================
|
|
13
|
+
NODE_ENV=development
|
|
14
|
+
PORT=3000
|
|
15
|
+
APP_URL=http://localhost:3000
|
|
16
|
+
API_URL=http://localhost:5000/api
|
|
17
|
+
|
|
18
|
+
# ============================================
|
|
19
|
+
# Database (MongoDB)
|
|
20
|
+
# ============================================
|
|
21
|
+
MONGODB_URI=mongodb://localhost:27017/your-database
|
|
22
|
+
MONGODB_CONNECTION_TIMEOUT=10000
|
|
23
|
+
MONGODB_POOL_SIZE=10
|
|
24
|
+
|
|
25
|
+
# ============================================
|
|
26
|
+
# Authentication
|
|
27
|
+
# ============================================
|
|
28
|
+
JWT_SECRET=change-this-to-a-secure-random-string
|
|
29
|
+
JWT_EXPIRES_IN=7d
|
|
30
|
+
JWT_REFRESH_EXPIRES_IN=30d
|
|
31
|
+
|
|
32
|
+
# ============================================
|
|
33
|
+
# Security
|
|
34
|
+
# ============================================
|
|
35
|
+
CORS_ORIGIN=http://localhost:3000
|
|
36
|
+
CSRF_SECRET=change-this-to-a-secure-random-string
|
|
37
|
+
RATE_LIMIT_WINDOW=15
|
|
38
|
+
RATE_LIMIT_MAX=100
|
|
39
|
+
|
|
40
|
+
# ============================================
|
|
41
|
+
# Email (SMTP)
|
|
42
|
+
# ============================================
|
|
43
|
+
SMTP_HOST=smtp.gmail.com
|
|
44
|
+
SMTP_PORT=587
|
|
45
|
+
SMTP_USER=your-email@gmail.com
|
|
46
|
+
SMTP_PASS=your-app-password
|
|
47
|
+
SMTP_FROM=noreply@your-app.com
|
|
48
|
+
|
|
49
|
+
# ============================================
|
|
50
|
+
# File Upload
|
|
51
|
+
# ============================================
|
|
52
|
+
UPLOAD_DIR=./uploads
|
|
53
|
+
MAX_FILE_SIZE=5242880
|
|
54
|
+
ALLOWED_FILE_TYPES=image/jpeg,image/png,application/pdf
|
|
55
|
+
|
|
56
|
+
# ============================================
|
|
57
|
+
# Logging
|
|
58
|
+
# ============================================
|
|
59
|
+
LOG_LEVEL=info
|
|
60
|
+
LOG_FORMAT=combined
|
|
61
|
+
LOG_DIR=./logs
|
|
62
|
+
|
|
63
|
+
# ============================================
|
|
64
|
+
# Redis (for caching/sessions)
|
|
65
|
+
# ============================================
|
|
66
|
+
REDIS_URL=redis://localhost:6379
|
|
67
|
+
REDIS_TTL=3600
|
|
68
|
+
|
|
69
|
+
# ============================================
|
|
70
|
+
# External Services
|
|
71
|
+
# ============================================
|
|
72
|
+
# STRIPE_SECRET_KEY=sk_test_your_key
|
|
73
|
+
# SENTRY_DSN=https://your-dsn@sentry.io/project
|
|
74
|
+
# AWS_ACCESS_KEY_ID=your-key
|
|
75
|
+
# AWS_SECRET_ACCESS_KEY=your-secret
|
|
76
|
+
# AWS_REGION=us-east-1
|
|
77
|
+
# AWS_BUCKET_NAME=your-bucket
|
|
78
|
+
|
|
79
|
+
# ============================================
|
|
80
|
+
# Feature Flags
|
|
81
|
+
# ============================================
|
|
82
|
+
ENABLE_EMAIL_VERIFICATION=true
|
|
83
|
+
ENABLE_TWO_FACTOR_AUTH=false
|
|
84
|
+
ENABLE_USER_REGISTRATION=true
|
|
85
|
+
ENABLE_PUBLIC_API=true
|
|
86
|
+
|
|
87
|
+
# ============================================
|
|
88
|
+
# Development Tools
|
|
89
|
+
# ============================================
|
|
90
|
+
ENABLE_DEV_TOOLS=true
|
|
91
|
+
ENABLE_GRAPHQL_PLAYGROUND=false
|
|
92
|
+
ENABLE_SWAGGER_DOCS=true
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
export const gitignoreTemplate = `# Dependencies
|
|
96
|
+
node_modules/
|
|
97
|
+
.pnp
|
|
98
|
+
.pnp.js
|
|
99
|
+
|
|
100
|
+
# Testing
|
|
101
|
+
/coverage
|
|
102
|
+
|
|
103
|
+
# Production
|
|
104
|
+
/build
|
|
105
|
+
/dist
|
|
106
|
+
|
|
107
|
+
# Environment
|
|
108
|
+
.env
|
|
109
|
+
.env.local
|
|
110
|
+
.env.development.local
|
|
111
|
+
.env.test.local
|
|
112
|
+
.env.production.local
|
|
113
|
+
|
|
114
|
+
# Logs
|
|
115
|
+
logs/
|
|
116
|
+
*.log
|
|
117
|
+
npm-debug.log*
|
|
118
|
+
yarn-debug.log*
|
|
119
|
+
yarn-error.log*
|
|
120
|
+
lerna-debug.log*
|
|
121
|
+
|
|
122
|
+
# Runtime
|
|
123
|
+
pids
|
|
124
|
+
*.pid
|
|
125
|
+
*.seed
|
|
126
|
+
*.pid.lock
|
|
127
|
+
|
|
128
|
+
# Coverage directory used by tools like istanbul
|
|
129
|
+
coverage/
|
|
130
|
+
*.lcov
|
|
131
|
+
|
|
132
|
+
# nyc test coverage
|
|
133
|
+
.nyc_output
|
|
134
|
+
|
|
135
|
+
# Grunt intermediate storage
|
|
136
|
+
.grunt
|
|
137
|
+
|
|
138
|
+
# Bower directory
|
|
139
|
+
bower_components
|
|
140
|
+
|
|
141
|
+
# node-waf configuration
|
|
142
|
+
.lock-wscript
|
|
143
|
+
|
|
144
|
+
# Compiled binary addons
|
|
145
|
+
build/Release
|
|
146
|
+
|
|
147
|
+
# Dependency directories
|
|
148
|
+
jspm_packages/
|
|
149
|
+
|
|
150
|
+
# TypeScript cache
|
|
151
|
+
*.tsbuildinfo
|
|
152
|
+
|
|
153
|
+
# Optional npm cache directory
|
|
154
|
+
.npm
|
|
155
|
+
|
|
156
|
+
# Optional eslint cache
|
|
157
|
+
.eslintcache
|
|
158
|
+
|
|
159
|
+
# Microbundle cache
|
|
160
|
+
.rpt2_cache/
|
|
161
|
+
.rts2_cache_cjs/
|
|
162
|
+
.rts2_cache_es/
|
|
163
|
+
.rts2_cache_umd/
|
|
164
|
+
|
|
165
|
+
# Optional REPL history
|
|
166
|
+
.node_repl_history
|
|
167
|
+
|
|
168
|
+
# Output of 'npm pack'
|
|
169
|
+
*.tgz
|
|
170
|
+
|
|
171
|
+
# Yarn Integrity file
|
|
172
|
+
.yarn-integrity
|
|
173
|
+
|
|
174
|
+
# parcel-bundler cache
|
|
175
|
+
.cache
|
|
176
|
+
.parcel-cache
|
|
177
|
+
|
|
178
|
+
# Next.js build output
|
|
179
|
+
.next
|
|
180
|
+
|
|
181
|
+
# Nuxt.js build / generate output
|
|
182
|
+
.nuxt
|
|
183
|
+
dist
|
|
184
|
+
|
|
185
|
+
# Gatsby files
|
|
186
|
+
.cache/
|
|
187
|
+
public
|
|
188
|
+
|
|
189
|
+
# vuepress build output
|
|
190
|
+
.vuepress/dist
|
|
191
|
+
|
|
192
|
+
# Serverless directories
|
|
193
|
+
.serverless/
|
|
194
|
+
|
|
195
|
+
# FuseBox cache
|
|
196
|
+
.fusebox/
|
|
197
|
+
|
|
198
|
+
# DynamoDB Local files
|
|
199
|
+
.dynamodb/
|
|
200
|
+
|
|
201
|
+
# TernJS port file
|
|
202
|
+
.tern-port
|
|
203
|
+
|
|
204
|
+
# Stores VSCode versions
|
|
205
|
+
.vscode-test
|
|
206
|
+
|
|
207
|
+
# IDE
|
|
208
|
+
.vscode/
|
|
209
|
+
.idea/
|
|
210
|
+
*.swp
|
|
211
|
+
*.swo
|
|
212
|
+
*~
|
|
213
|
+
.DS_Store
|
|
214
|
+
|
|
215
|
+
# Backup files
|
|
216
|
+
.loom-backup-*
|
|
217
|
+
.fsk-backup-*
|
|
218
|
+
|
|
219
|
+
# Local files
|
|
220
|
+
*.local
|
|
221
|
+
`;
|