start-it-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.
@@ -0,0 +1,447 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nodeTemplates = void 0;
4
+ exports.nodeTemplates = {
5
+ "Express API": {
6
+ name: "Express API",
7
+ description: "An Express.js REST API",
8
+ files: [
9
+ {
10
+ path: "package.json",
11
+ content: `{
12
+ "name": "express-api",
13
+ "version": "1.0.0",
14
+ "description": "Express.js REST API",
15
+ "main": "dist/index.js",
16
+ "scripts": {
17
+ "start": "node dist/index.js",
18
+ "dev": "ts-node src/index.ts",
19
+ "build": "tsc",
20
+ "test": "jest"
21
+ },
22
+ "keywords": ["express", "api", "rest"],
23
+ "author": "",
24
+ "license": "MIT",
25
+ "dependencies": {
26
+ "express": "^4.18.2",
27
+ "cors": "^2.8.5"
28
+ },
29
+ "devDependencies": {
30
+ "@types/express": "^4.17.17",
31
+ "@types/node": "^20.0.0",
32
+ "typescript": "^5.0.0",
33
+ "ts-node": "^10.9.0",
34
+ "@types/jest": "^29.5.0",
35
+ "jest": "^29.5.0",
36
+ "ts-jest": "^29.1.0"
37
+ }
38
+ }
39
+ `,
40
+ },
41
+ {
42
+ path: "tsconfig.json",
43
+ content: `{
44
+ "compilerOptions": {
45
+ "target": "ES2020",
46
+ "module": "commonjs",
47
+ "lib": ["ES2020"],
48
+ "outDir": "./dist",
49
+ "rootDir": "./src",
50
+ "strict": true,
51
+ "esModuleInterop": true,
52
+ "skipLibCheck": true,
53
+ "forceConsistentCasingInFileNames": true,
54
+ "resolveJsonModule": true
55
+ },
56
+ "include": ["src/**/*"],
57
+ "exclude": ["node_modules", "dist"]
58
+ }
59
+ `,
60
+ },
61
+ {
62
+ path: "src/index.ts",
63
+ content: `import express from 'express';
64
+ import cors from 'cors';
65
+
66
+ const app = express();
67
+ const PORT = process.env.PORT || 3000;
68
+
69
+ app.use(cors());
70
+ app.use(express.json());
71
+
72
+ app.get('/health', (req, res) => {
73
+ res.json({ status: 'ok' });
74
+ });
75
+
76
+ app.get('/api/hello', (req, res) => {
77
+ res.json({ message: 'Hello from Express!' });
78
+ });
79
+
80
+ app.post('/api/echo', (req, res) => {
81
+ res.json(req.body);
82
+ });
83
+
84
+ app.listen(PORT, () => {
85
+ console.log(\`Server running on port \${PORT}\`);
86
+ });
87
+ `,
88
+ },
89
+ {
90
+ path: "README.md",
91
+ content: `# Express API
92
+
93
+ A RESTful API built with Express.js and TypeScript.
94
+
95
+ ## Setup
96
+
97
+ \`\`\`bash
98
+ npm install
99
+ \`\`\`
100
+
101
+ ## Development
102
+
103
+ \`\`\`bash
104
+ npm run dev
105
+ \`\`\`
106
+
107
+ ## Build
108
+
109
+ \`\`\`bash
110
+ npm run build
111
+ \`\`\`
112
+
113
+ ## Run
114
+
115
+ \`\`\`bash
116
+ npm start
117
+ \`\`\`
118
+
119
+ The API will be available at \`http://localhost:3000\`
120
+
121
+ ## Endpoints
122
+
123
+ - \`GET /health\` - Health check
124
+ - \`GET /api/hello\` - Hello endpoint
125
+ - \`POST /api/echo\` - Echo endpoint
126
+ `,
127
+ },
128
+ {
129
+ path: ".gitignore",
130
+ content: `node_modules/
131
+ dist/
132
+ .env
133
+ .env.local
134
+ npm-debug.log
135
+ .DS_Store
136
+ .vscode/
137
+ .idea/
138
+ *.swp
139
+ `,
140
+ },
141
+ ],
142
+ },
143
+ "Next.js": {
144
+ name: "Next.js",
145
+ description: "A Next.js application",
146
+ files: [
147
+ {
148
+ path: "package.json",
149
+ content: `{
150
+ "name": "nextjs-app",
151
+ "version": "1.0.0",
152
+ "private": true,
153
+ "scripts": {
154
+ "dev": "next dev",
155
+ "build": "next build",
156
+ "start": "next start",
157
+ "lint": "next lint"
158
+ },
159
+ "dependencies": {
160
+ "next": "^14.0.0",
161
+ "react": "^18.2.0",
162
+ "react-dom": "^18.2.0"
163
+ },
164
+ "devDependencies": {
165
+ "@types/node": "^20.0.0",
166
+ "@types/react": "^18.2.0",
167
+ "@types/react-dom": "^18.2.0",
168
+ "typescript": "^5.0.0",
169
+ "eslint": "^8.0.0",
170
+ "eslint-config-next": "^14.0.0"
171
+ }
172
+ }
173
+ `,
174
+ },
175
+ {
176
+ path: "tsconfig.json",
177
+ content: `{
178
+ "compilerOptions": {
179
+ "target": "es5",
180
+ "lib": ["dom", "dom.iterable", "esnext"],
181
+ "jsx": "preserve",
182
+ "module": "esnext",
183
+ "moduleResolution": "bundler",
184
+ "allowJs": true,
185
+ "skipLibCheck": true,
186
+ "strict": true,
187
+ "forceConsistentCasingInFileNames": true,
188
+ "noEmit": true,
189
+ "esModuleInterop": true,
190
+ "resolveJsonModule": true,
191
+ "isolatedModules": true,
192
+ "incremental": true,
193
+ "plugins": [
194
+ {
195
+ "name": "next"
196
+ }
197
+ ],
198
+ "paths": {
199
+ "@/*": ["./*"]
200
+ }
201
+ },
202
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
203
+ "exclude": ["node_modules"]
204
+ }
205
+ `,
206
+ },
207
+ {
208
+ path: "next.config.js",
209
+ content: `/** @type {import('next').NextConfig} */
210
+ const nextConfig = {}
211
+
212
+ module.exports = nextConfig
213
+ `,
214
+ },
215
+ {
216
+ path: "app/page.tsx",
217
+ content: `export default function Home() {
218
+ return (
219
+ <main style={{ padding: '2rem' }}>
220
+ <h1>Welcome to Next.js</h1>
221
+ <p>Edit app/page.tsx to get started</p>
222
+ </main>
223
+ )
224
+ }
225
+ `,
226
+ },
227
+ {
228
+ path: "app/layout.tsx",
229
+ content: `import type { Metadata } from 'next'
230
+
231
+ export const metadata: Metadata = {
232
+ title: 'Next.js App',
233
+ description: 'Generated by create next app',
234
+ }
235
+
236
+ export default function RootLayout({
237
+ children,
238
+ }: {
239
+ children: React.ReactNode
240
+ }) {
241
+ return (
242
+ <html lang="en">
243
+ <body>{children}</body>
244
+ </html>
245
+ )
246
+ }
247
+ `,
248
+ },
249
+ {
250
+ path: "README.md",
251
+ content: `# Next.js Application
252
+
253
+ A modern web application built with Next.js.
254
+
255
+ ## Getting Started
256
+
257
+ \`\`\`bash
258
+ npm install
259
+ npm run dev
260
+ \`\`\`
261
+
262
+ Open [http://localhost:3000](http://localhost:3000) in your browser.
263
+
264
+ ## Build
265
+
266
+ \`\`\`bash
267
+ npm run build
268
+ npm start
269
+ \`\`\`
270
+
271
+ ## Learn More
272
+
273
+ - [Next.js Documentation](https://nextjs.org/docs)
274
+ - [React Documentation](https://react.dev)
275
+ `,
276
+ },
277
+ {
278
+ path: ".gitignore",
279
+ content: `# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
280
+
281
+ # dependencies
282
+ /node_modules
283
+ /.pnp
284
+ .pnp.js
285
+
286
+ # testing
287
+ /coverage
288
+
289
+ # next.js
290
+ /.next/
291
+ /out/
292
+
293
+ # production
294
+ /build
295
+
296
+ # misc
297
+ .DS_Store
298
+ *.pem
299
+
300
+ # debug
301
+ npm-debug.log*
302
+ yarn-debug.log*
303
+ yarn-error.log*
304
+
305
+ # local env files
306
+ .env*.local
307
+
308
+ # vercel
309
+ .vercel
310
+
311
+ # typescript
312
+ *.tsbuildinfo
313
+ next-env.d.ts
314
+ `,
315
+ },
316
+ ],
317
+ },
318
+ "TypeScript Project": {
319
+ name: "TypeScript Project",
320
+ description: "A TypeScript project",
321
+ files: [
322
+ {
323
+ path: "package.json",
324
+ content: `{
325
+ "name": "typescript-project",
326
+ "version": "1.0.0",
327
+ "description": "A TypeScript project",
328
+ "main": "dist/index.js",
329
+ "scripts": {
330
+ "build": "tsc",
331
+ "dev": "ts-node src/index.ts",
332
+ "start": "node dist/index.js",
333
+ "test": "jest"
334
+ },
335
+ "keywords": ["typescript"],
336
+ "author": "",
337
+ "license": "MIT",
338
+ "dependencies": {},
339
+ "devDependencies": {
340
+ "@types/node": "^20.0.0",
341
+ "typescript": "^5.0.0",
342
+ "ts-node": "^10.9.0",
343
+ "@types/jest": "^29.5.0",
344
+ "jest": "^29.5.0",
345
+ "ts-jest": "^29.1.0"
346
+ }
347
+ }
348
+ `,
349
+ },
350
+ {
351
+ path: "tsconfig.json",
352
+ content: `{
353
+ "compilerOptions": {
354
+ "target": "ES2020",
355
+ "module": "commonjs",
356
+ "lib": ["ES2020"],
357
+ "outDir": "./dist",
358
+ "rootDir": "./src",
359
+ "strict": true,
360
+ "esModuleInterop": true,
361
+ "skipLibCheck": true,
362
+ "forceConsistentCasingInFileNames": true,
363
+ "resolveJsonModule": true,
364
+ "declaration": true,
365
+ "declarationMap": true,
366
+ "sourceMap": true
367
+ },
368
+ "include": ["src/**/*"],
369
+ "exclude": ["node_modules", "dist", "**/*.test.ts"]
370
+ }
371
+ `,
372
+ },
373
+ {
374
+ path: "src/index.ts",
375
+ content: `function greet(name: string): string {
376
+ return \`Hello, \${name}!\`;
377
+ }
378
+
379
+ console.log(greet('World'));
380
+ `,
381
+ },
382
+ {
383
+ path: "src/utils.ts",
384
+ content: `export function add(a: number, b: number): number {
385
+ return a + b;
386
+ }
387
+
388
+ export function subtract(a: number, b: number): number {
389
+ return a - b;
390
+ }
391
+ `,
392
+ },
393
+ {
394
+ path: "README.md",
395
+ content: `# TypeScript Project
396
+
397
+ A TypeScript project template.
398
+
399
+ ## Setup
400
+
401
+ \`\`\`bash
402
+ npm install
403
+ \`\`\`
404
+
405
+ ## Development
406
+
407
+ \`\`\`bash
408
+ npm run dev
409
+ \`\`\`
410
+
411
+ ## Build
412
+
413
+ \`\`\`bash
414
+ npm run build
415
+ \`\`\`
416
+
417
+ ## Run
418
+
419
+ \`\`\`bash
420
+ npm start
421
+ \`\`\`
422
+
423
+ ## Testing
424
+
425
+ \`\`\`bash
426
+ npm test
427
+ \`\`\`
428
+ `,
429
+ },
430
+ {
431
+ path: ".gitignore",
432
+ content: `node_modules/
433
+ dist/
434
+ .env
435
+ .env.local
436
+ npm-debug.log
437
+ .DS_Store
438
+ .vscode/
439
+ .idea/
440
+ *.swp
441
+ coverage/
442
+ `,
443
+ },
444
+ ],
445
+ },
446
+ };
447
+ //# sourceMappingURL=node.js.map