create-smash-os 0.1.3 → 0.1.4
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/install.mjs +147 -7
- package/package.json +1 -1
package/install.mjs
CHANGED
|
@@ -96,7 +96,9 @@ console.log('');
|
|
|
96
96
|
// ─── Local-only mode ──────────────────────────────────────────────────────────
|
|
97
97
|
|
|
98
98
|
if (isLocal) {
|
|
99
|
-
const
|
|
99
|
+
const onCancel = () => { console.log(chalk.yellow('\n Cancelled.')); process.exit(0); };
|
|
100
|
+
|
|
101
|
+
const baseAnswers = await prompts([
|
|
100
102
|
{
|
|
101
103
|
type: 'text',
|
|
102
104
|
name: 'projectName',
|
|
@@ -104,15 +106,153 @@ if (isLocal) {
|
|
|
104
106
|
initial: basename(cwd),
|
|
105
107
|
validate: (v) => (v.trim().length > 0 ? true : 'Required'),
|
|
106
108
|
},
|
|
109
|
+
], { onCancel });
|
|
110
|
+
|
|
111
|
+
const { projectName } = baseAnswers;
|
|
112
|
+
|
|
113
|
+
console.log('');
|
|
114
|
+
console.log(chalk.bold(' Tech Stack'));
|
|
115
|
+
console.log(chalk.dim(' Select your tools — choose "Other" to enter a custom value'));
|
|
116
|
+
console.log('');
|
|
117
|
+
|
|
118
|
+
const O = '__other__';
|
|
119
|
+
const o = (prev) => prev === O ? 'text' : null;
|
|
120
|
+
const req = (v) => v.trim().length > 0 ? true : 'Required';
|
|
121
|
+
|
|
122
|
+
const stackAnswers = await prompts([
|
|
123
|
+
// ── Frontend Framework ─────────────────────────────────────────────────
|
|
107
124
|
{
|
|
108
|
-
type: '
|
|
109
|
-
name: '
|
|
110
|
-
message: '
|
|
111
|
-
|
|
125
|
+
type: 'select',
|
|
126
|
+
name: 'frontend',
|
|
127
|
+
message: 'Frontend framework',
|
|
128
|
+
choices: [
|
|
129
|
+
{ title: 'Next.js', value: 'Next.js' },
|
|
130
|
+
{ title: 'React Router v7', value: 'React Router v7' },
|
|
131
|
+
{ title: 'Remix', value: 'Remix' },
|
|
132
|
+
{ title: 'Vite + React (SPA)', value: 'Vite + React' },
|
|
133
|
+
{ title: 'SvelteKit', value: 'SvelteKit' },
|
|
134
|
+
{ title: 'Nuxt (Vue 3)', value: 'Nuxt' },
|
|
135
|
+
{ title: 'Astro', value: 'Astro' },
|
|
136
|
+
{ title: 'Angular', value: 'Angular' },
|
|
137
|
+
{ title: 'Solid Start', value: 'Solid Start' },
|
|
138
|
+
{ title: 'Other…', value: O },
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
{ type: o, name: 'frontendCustom', message: 'Specify your frontend framework', validate: req },
|
|
142
|
+
|
|
143
|
+
// ── Backend / API ──────────────────────────────────────────────────────
|
|
144
|
+
{
|
|
145
|
+
type: 'select',
|
|
146
|
+
name: 'backend',
|
|
147
|
+
message: 'Backend / API layer',
|
|
148
|
+
choices: [
|
|
149
|
+
{ title: 'Fullstack (handled by framework)', value: 'Fullstack (framework handles API)' },
|
|
150
|
+
{ title: 'Node.js + Express', value: 'Node.js + Express' },
|
|
151
|
+
{ title: 'Node.js + Hono', value: 'Node.js + Hono' },
|
|
152
|
+
{ title: 'Node.js + Fastify', value: 'Node.js + Fastify' },
|
|
153
|
+
{ title: 'Node.js + NestJS', value: 'Node.js + NestJS' },
|
|
154
|
+
{ title: 'Python + FastAPI', value: 'Python + FastAPI' },
|
|
155
|
+
{ title: 'Python + Django / Flask', value: 'Python + Django/Flask' },
|
|
156
|
+
{ title: 'Go (Gin / Chi)', value: 'Go' },
|
|
157
|
+
{ title: 'Bun + Elysia', value: 'Bun + Elysia' },
|
|
158
|
+
{ title: 'Other…', value: O },
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
{ type: o, name: 'backendCustom', message: 'Specify your backend/API layer', validate: req },
|
|
162
|
+
|
|
163
|
+
// ── Database ───────────────────────────────────────────────────────────
|
|
164
|
+
{
|
|
165
|
+
type: 'select',
|
|
166
|
+
name: 'database',
|
|
167
|
+
message: 'Database',
|
|
168
|
+
choices: [
|
|
169
|
+
{ title: 'Supabase (Postgres)', value: 'Supabase (Postgres)' },
|
|
170
|
+
{ title: 'Neon (Postgres)', value: 'Neon (Postgres)' },
|
|
171
|
+
{ title: 'MongoDB Atlas', value: 'MongoDB Atlas' },
|
|
172
|
+
{ title: 'PlanetScale / Vitess (MySQL)', value: 'PlanetScale (MySQL)' },
|
|
173
|
+
{ title: 'Firebase Firestore', value: 'Firebase Firestore' },
|
|
174
|
+
{ title: 'Turso (SQLite / libSQL)', value: 'Turso (SQLite)' },
|
|
175
|
+
{ title: 'Prisma + PostgreSQL', value: 'Prisma + PostgreSQL' },
|
|
176
|
+
{ title: 'Drizzle + D1 (SQLite)', value: 'Drizzle + Cloudflare D1' },
|
|
177
|
+
{ title: 'Upstash Redis', value: 'Upstash Redis' },
|
|
178
|
+
{ title: 'Other…', value: O },
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{ type: o, name: 'databaseCustom', message: 'Specify your database', validate: req },
|
|
182
|
+
|
|
183
|
+
// ── Authentication ─────────────────────────────────────────────────────
|
|
184
|
+
{
|
|
185
|
+
type: 'select',
|
|
186
|
+
name: 'auth',
|
|
187
|
+
message: 'Authentication',
|
|
188
|
+
choices: [
|
|
189
|
+
{ title: 'None / Custom', value: 'None' },
|
|
190
|
+
{ title: 'Clerk', value: 'Clerk' },
|
|
191
|
+
{ title: 'Supabase Auth', value: 'Supabase Auth' },
|
|
192
|
+
{ title: 'Auth.js (NextAuth.js)', value: 'Auth.js (NextAuth)' },
|
|
193
|
+
{ title: 'Better Auth', value: 'Better Auth' },
|
|
194
|
+
{ title: 'Firebase Auth', value: 'Firebase Auth' },
|
|
195
|
+
{ title: 'Auth0', value: 'Auth0' },
|
|
196
|
+
{ title: 'Lucia Auth', value: 'Lucia Auth' },
|
|
197
|
+
{ title: 'Kinde', value: 'Kinde' },
|
|
198
|
+
{ title: 'Other…', value: O },
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
{ type: o, name: 'authCustom', message: 'Specify your auth provider', validate: req },
|
|
202
|
+
|
|
203
|
+
// ── Deployment ─────────────────────────────────────────────────────────
|
|
204
|
+
{
|
|
205
|
+
type: 'select',
|
|
206
|
+
name: 'deployment',
|
|
207
|
+
message: 'Deployment target',
|
|
208
|
+
choices: [
|
|
209
|
+
{ title: 'Vercel', value: 'Vercel' },
|
|
210
|
+
{ title: 'Cloudflare Workers / Pages', value: 'Cloudflare Workers/Pages' },
|
|
211
|
+
{ title: 'Netlify', value: 'Netlify' },
|
|
212
|
+
{ title: 'Railway', value: 'Railway' },
|
|
213
|
+
{ title: 'Fly.io', value: 'Fly.io' },
|
|
214
|
+
{ title: 'Render', value: 'Render' },
|
|
215
|
+
{ title: 'AWS (Lambda / ECS)', value: 'AWS' },
|
|
216
|
+
{ title: 'Google Cloud Run', value: 'Google Cloud Run' },
|
|
217
|
+
{ title: 'Self-hosted / VPS', value: 'Self-hosted / VPS' },
|
|
218
|
+
{ title: 'Other…', value: O },
|
|
219
|
+
],
|
|
112
220
|
},
|
|
113
|
-
|
|
221
|
+
{ type: o, name: 'deploymentCustom', message: 'Specify your deployment target', validate: req },
|
|
114
222
|
|
|
115
|
-
|
|
223
|
+
// ── Styling / UI ───────────────────────────────────────────────────────
|
|
224
|
+
{
|
|
225
|
+
type: 'select',
|
|
226
|
+
name: 'styling',
|
|
227
|
+
message: 'Styling / UI library',
|
|
228
|
+
choices: [
|
|
229
|
+
{ title: 'Tailwind CSS', value: 'Tailwind CSS' },
|
|
230
|
+
{ title: 'shadcn/ui + Tailwind', value: 'shadcn/ui + Tailwind CSS' },
|
|
231
|
+
{ title: 'CSS Modules', value: 'CSS Modules' },
|
|
232
|
+
{ title: 'Material UI (MUI)', value: 'Material UI (MUI)' },
|
|
233
|
+
{ title: 'Chakra UI', value: 'Chakra UI' },
|
|
234
|
+
{ title: 'Styled Components / Emotion', value: 'Styled Components' },
|
|
235
|
+
{ title: 'Mantine', value: 'Mantine' },
|
|
236
|
+
{ title: 'Radix UI + Tailwind', value: 'Radix UI + Tailwind CSS' },
|
|
237
|
+
{ title: 'UnoCSS', value: 'UnoCSS' },
|
|
238
|
+
{ title: 'Other…', value: O },
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
{ type: o, name: 'stylingCustom', message: 'Specify your styling/UI library', validate: req },
|
|
242
|
+
], { onCancel });
|
|
243
|
+
|
|
244
|
+
function pick(val, custom) { return val === O ? (custom || 'Other') : val; }
|
|
245
|
+
|
|
246
|
+
const techStack = [
|
|
247
|
+
`- Frontend: ${pick(stackAnswers.frontend, stackAnswers.frontendCustom)}`,
|
|
248
|
+
`- Backend: ${pick(stackAnswers.backend, stackAnswers.backendCustom)}`,
|
|
249
|
+
`- Database: ${pick(stackAnswers.database, stackAnswers.databaseCustom)}`,
|
|
250
|
+
`- Auth: ${pick(stackAnswers.auth, stackAnswers.authCustom)}`,
|
|
251
|
+
`- Deployment: ${pick(stackAnswers.deployment, stackAnswers.deploymentCustom)}`,
|
|
252
|
+
`- Styling: ${pick(stackAnswers.styling, stackAnswers.stylingCustom)}`,
|
|
253
|
+
].join('\n');
|
|
254
|
+
|
|
255
|
+
console.log('');
|
|
116
256
|
const today = new Date().toISOString().split('T')[0];
|
|
117
257
|
|
|
118
258
|
const claudeMd = `# ${projectName} — SmashOS Harness Active
|