@leo-h/create-nodejs-app 1.0.65 → 1.0.67

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.
Files changed (32) hide show
  1. package/dist/src/validations/back-end-framework.validation.js +1 -1
  2. package/package.json +2 -2
  3. package/templates/clean/package.json +1 -1
  4. package/templates/clean/pnpm-lock.yaml +20 -20
  5. package/templates/elysia/.env.development +3 -0
  6. package/templates/elysia/.env.example +8 -0
  7. package/templates/elysia/.swcrc +19 -0
  8. package/templates/elysia/.vscode/settings.json +11 -0
  9. package/templates/elysia/biome.json +16 -0
  10. package/templates/elysia/gitignore +27 -0
  11. package/templates/elysia/npmrc +1 -0
  12. package/templates/elysia/package.json +40 -0
  13. package/templates/elysia/pnpm-lock.yaml +2599 -0
  14. package/templates/elysia/src/@types/zod-utils.ts +24 -0
  15. package/templates/elysia/src/env.ts +35 -0
  16. package/templates/elysia/src/http/app.ts +41 -0
  17. package/templates/elysia/src/http/controllers/hello-multipart.controller.spec.ts +85 -0
  18. package/templates/elysia/src/http/controllers/hello-multipart.controller.ts +52 -0
  19. package/templates/elysia/src/http/controllers/hello.controller.spec.ts +60 -0
  20. package/templates/elysia/src/http/controllers/hello.controller.ts +37 -0
  21. package/templates/elysia/src/http/controllers/index.ts +7 -0
  22. package/templates/elysia/src/http/errors.ts +138 -0
  23. package/templates/elysia/src/http/plugins/global-error-handler.plugin.ts +82 -0
  24. package/templates/elysia/src/http/server.ts +10 -0
  25. package/templates/elysia/test/integration/api-test-client.ts +4 -0
  26. package/templates/elysia/tsconfig.json +16 -0
  27. package/templates/elysia/vitest.config.integration.mts +9 -0
  28. package/templates/elysia/vitest.config.mts +17 -0
  29. package/templates/fastify/package.json +1 -1
  30. package/templates/fastify/pnpm-lock.yaml +23 -23
  31. package/templates/nest/package.json +1 -1
  32. package/templates/nest/pnpm-lock.yaml +22 -22
@@ -1 +1 @@
1
- const validation=require("../core/validation.js"),getValidOptionsFromPrompt=require("../utils/get-valid-options-from-prompt.js"),backEndFrameworks=[{title:"Fastify",value:"fastify"},{title:"Nest + SWC",value:"nest"},{title:"tRPC",value:"trpc",disabled:!0}],backEndValidFrameworks=getValidOptionsFromPrompt.getValidOptionsFromSelect(backEndFrameworks);class BackEndFrameworkValidation extends validation.Validation{static create(a){return new this().createValidation(a)}async validate(){let{framework:a}=this.params;return a=a.toLowerCase(),backEndValidFrameworks.includes(a)?{isValid:!0}:{isValid:!1,issue:`Invalid back-end framework, consider the options: ${backEndValidFrameworks.map(e=>`"${e}"`).join(", ")}.`}}}exports.BackEndFrameworkValidation=BackEndFrameworkValidation;exports.backEndFrameworks=backEndFrameworks;exports.backEndValidFrameworks=backEndValidFrameworks;
1
+ const validation=require("../core/validation.js"),getValidOptionsFromPrompt=require("../utils/get-valid-options-from-prompt.js"),backEndFrameworks=[{title:"Fastify",value:"fastify"},{title:"Nest + SWC",value:"nest"},{title:"Elysia",value:"elysia"}],backEndValidFrameworks=getValidOptionsFromPrompt.getValidOptionsFromSelect(backEndFrameworks);class BackEndFrameworkValidation extends validation.Validation{static create(a){return new this().createValidation(a)}async validate(){let{framework:a}=this.params;return a=a.toLowerCase(),backEndValidFrameworks.includes(a)?{isValid:!0}:{isValid:!1,issue:`Invalid back-end framework, consider the options: ${backEndValidFrameworks.map(e=>`"${e}"`).join(", ")}.`}}}exports.BackEndFrameworkValidation=BackEndFrameworkValidation;exports.backEndFrameworks=backEndFrameworks;exports.backEndValidFrameworks=backEndValidFrameworks;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leo-h/create-nodejs-app",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "packageManager": "pnpm@9.15.9",
5
5
  "author": "Leonardo Henrique <leonardo0507.business@gmail.com>",
6
6
  "description": "Create a modern Node.js app with TypeScript using one command.",
@@ -49,7 +49,7 @@
49
49
  "devDependencies": {
50
50
  "@eslint/js": "9.23.0",
51
51
  "@faker-js/faker": "9.9.0",
52
- "@types/node": "22.18.11",
52
+ "@types/node": "22.19.0",
53
53
  "@types/prompts": "2.4.9",
54
54
  "@types/validate-npm-package-name": "4.0.2",
55
55
  "@vitest/eslint-plugin": "1.1.38",
@@ -23,7 +23,7 @@
23
23
  "devDependencies": {
24
24
  "@eslint/js": "9.23.0",
25
25
  "@faker-js/faker": "9.9.0",
26
- "@types/node": "22.18.11",
26
+ "@types/node": "22.19.0",
27
27
  "@vitest/eslint-plugin": "1.1.38",
28
28
  "eslint": "9.23.0",
29
29
  "eslint-config-prettier": "9.1.2",
@@ -22,11 +22,11 @@ importers:
22
22
  specifier: 9.9.0
23
23
  version: 9.9.0
24
24
  '@types/node':
25
- specifier: 22.18.11
26
- version: 22.18.11
25
+ specifier: 22.19.0
26
+ version: 22.19.0
27
27
  '@vitest/eslint-plugin':
28
28
  specifier: 1.1.38
29
- version: 1.1.38(@typescript-eslint/utils@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3)(vitest@1.6.1(@types/node@22.18.11))
29
+ version: 1.1.38(@typescript-eslint/utils@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3)(vitest@1.6.1(@types/node@22.19.0))
30
30
  eslint:
31
31
  specifier: 9.23.0
32
32
  version: 9.23.0(jiti@2.4.2)
@@ -62,10 +62,10 @@ importers:
62
62
  version: 3.5.0(typescript@5.8.3)
63
63
  vite-tsconfig-paths:
64
64
  specifier: 5.1.4
65
- version: 5.1.4(typescript@5.8.3)(vite@5.2.13(@types/node@22.18.11))
65
+ version: 5.1.4(typescript@5.8.3)(vite@5.2.13(@types/node@22.19.0))
66
66
  vitest:
67
67
  specifier: 1.6.1
68
- version: 1.6.1(@types/node@22.18.11)
68
+ version: 1.6.1(@types/node@22.19.0)
69
69
 
70
70
  packages:
71
71
 
@@ -852,8 +852,8 @@ packages:
852
852
  '@types/json-schema@7.0.15':
853
853
  resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
854
854
 
855
- '@types/node@22.18.11':
856
- resolution: {integrity: sha512-Gd33J2XIrXurb+eT2ktze3rJAfAp9ZNjlBdh4SVgyrKEOADwCbdUDaK7QgJno8Ue4kcajscsKqu6n8OBG3hhCQ==}
855
+ '@types/node@22.19.0':
856
+ resolution: {integrity: sha512-xpr/lmLPQEj+TUnHmR+Ab91/glhJvsqcjB+yY0Ix9GO70H6Lb4FHH5GeqdOE5btAx7eIMwuHkp4H2MSkLcqWbA==}
857
857
 
858
858
  '@types/resolve@1.20.2':
859
859
  resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
@@ -2815,7 +2815,7 @@ snapshots:
2815
2815
 
2816
2816
  '@types/json-schema@7.0.15': {}
2817
2817
 
2818
- '@types/node@22.18.11':
2818
+ '@types/node@22.19.0':
2819
2819
  dependencies:
2820
2820
  undici-types: 6.21.0
2821
2821
 
@@ -2898,13 +2898,13 @@ snapshots:
2898
2898
  '@typescript-eslint/types': 8.28.0
2899
2899
  eslint-visitor-keys: 4.2.0
2900
2900
 
2901
- '@vitest/eslint-plugin@1.1.38(@typescript-eslint/utils@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3)(vitest@1.6.1(@types/node@22.18.11))':
2901
+ '@vitest/eslint-plugin@1.1.38(@typescript-eslint/utils@8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3)(vitest@1.6.1(@types/node@22.19.0))':
2902
2902
  dependencies:
2903
2903
  '@typescript-eslint/utils': 8.28.0(eslint@9.23.0(jiti@2.4.2))(typescript@5.8.3)
2904
2904
  eslint: 9.23.0(jiti@2.4.2)
2905
2905
  optionalDependencies:
2906
2906
  typescript: 5.8.3
2907
- vitest: 1.6.1(@types/node@22.18.11)
2907
+ vitest: 1.6.1(@types/node@22.19.0)
2908
2908
 
2909
2909
  '@vitest/expect@1.6.1':
2910
2910
  dependencies:
@@ -4302,13 +4302,13 @@ snapshots:
4302
4302
 
4303
4303
  util-deprecate@1.0.2: {}
4304
4304
 
4305
- vite-node@1.6.1(@types/node@22.18.11):
4305
+ vite-node@1.6.1(@types/node@22.19.0):
4306
4306
  dependencies:
4307
4307
  cac: 6.7.14
4308
4308
  debug: 4.4.0
4309
4309
  pathe: 1.1.2
4310
4310
  picocolors: 1.0.1
4311
- vite: 5.2.13(@types/node@22.18.11)
4311
+ vite: 5.2.13(@types/node@22.19.0)
4312
4312
  transitivePeerDependencies:
4313
4313
  - '@types/node'
4314
4314
  - less
@@ -4319,27 +4319,27 @@ snapshots:
4319
4319
  - supports-color
4320
4320
  - terser
4321
4321
 
4322
- vite-tsconfig-paths@5.1.4(typescript@5.8.3)(vite@5.2.13(@types/node@22.18.11)):
4322
+ vite-tsconfig-paths@5.1.4(typescript@5.8.3)(vite@5.2.13(@types/node@22.19.0)):
4323
4323
  dependencies:
4324
4324
  debug: 4.4.0
4325
4325
  globrex: 0.1.2
4326
4326
  tsconfck: 3.1.0(typescript@5.8.3)
4327
4327
  optionalDependencies:
4328
- vite: 5.2.13(@types/node@22.18.11)
4328
+ vite: 5.2.13(@types/node@22.19.0)
4329
4329
  transitivePeerDependencies:
4330
4330
  - supports-color
4331
4331
  - typescript
4332
4332
 
4333
- vite@5.2.13(@types/node@22.18.11):
4333
+ vite@5.2.13(@types/node@22.19.0):
4334
4334
  dependencies:
4335
4335
  esbuild: 0.20.2
4336
4336
  postcss: 8.4.38
4337
4337
  rollup: 4.18.0
4338
4338
  optionalDependencies:
4339
- '@types/node': 22.18.11
4339
+ '@types/node': 22.19.0
4340
4340
  fsevents: 2.3.3
4341
4341
 
4342
- vitest@1.6.1(@types/node@22.18.11):
4342
+ vitest@1.6.1(@types/node@22.19.0):
4343
4343
  dependencies:
4344
4344
  '@vitest/expect': 1.6.1
4345
4345
  '@vitest/runner': 1.6.1
@@ -4358,11 +4358,11 @@ snapshots:
4358
4358
  strip-literal: 2.1.0
4359
4359
  tinybench: 2.8.0
4360
4360
  tinypool: 0.8.4
4361
- vite: 5.2.13(@types/node@22.18.11)
4362
- vite-node: 1.6.1(@types/node@22.18.11)
4361
+ vite: 5.2.13(@types/node@22.19.0)
4362
+ vite-node: 1.6.1(@types/node@22.19.0)
4363
4363
  why-is-node-running: 2.2.2
4364
4364
  optionalDependencies:
4365
- '@types/node': 22.18.11
4365
+ '@types/node': 22.19.0
4366
4366
  transitivePeerDependencies:
4367
4367
  - less
4368
4368
  - lightningcss
@@ -0,0 +1,3 @@
1
+ API_NAME="app-name-development"
2
+ API_PORT="3333"
3
+ API_ACCESS_PERMISSION_CLIENT_SIDE="https://my-client-app.com"
@@ -0,0 +1,8 @@
1
+ # example: "app-name"
2
+ API_NAME=
3
+
4
+ # example: "3333"
5
+ API_PORT=
6
+
7
+ # example: "https://my-client-app.com" (url - only constraint | regex - specific constraint | "*" - not constraint)
8
+ API_ACCESS_PERMISSION_CLIENT_SIDE=
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://swc.rs/schema.json",
3
+ "module": {
4
+ "type": "commonjs",
5
+ "strictMode": true
6
+ },
7
+ "jsc": {
8
+ "target": "esnext",
9
+ "parser": {
10
+ "syntax": "typescript",
11
+ "dynamicImport": true
12
+ },
13
+ "baseUrl": ".",
14
+ "paths": {
15
+ "@/*": ["./src/*"]
16
+ }
17
+ },
18
+ "minify": true
19
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.defaultFormatter": "biomejs.biome",
4
+ "editor.codeActionsOnSave": {
5
+ "source.organizeImports": "explicit",
6
+ "source.organizeImports.biome": "never",
7
+ "source.fixAll.biome": "explicit",
8
+ "source.action.useSortedKeys.biome": "explicit"
9
+ },
10
+ "eslint.enable": false
11
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.0/schema.json",
3
+ "files": {
4
+ "includes": ["**", "!dist"]
5
+ },
6
+ "formatter": {
7
+ "enabled": true,
8
+ "indentStyle": "space"
9
+ },
10
+ "linter": {
11
+ "enabled": true
12
+ },
13
+ "assist": {
14
+ "enabled": false
15
+ }
16
+ }
@@ -0,0 +1,27 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ .pnpm-debug.log*
6
+
7
+ # Coverage directory
8
+ coverage
9
+
10
+ # Dependency directories
11
+ node_modules/
12
+
13
+ # TypeScript cache
14
+ *.tsbuildinfo
15
+
16
+ # npm cache directory
17
+ .npm
18
+
19
+ # Build
20
+ dist
21
+
22
+ # Environment variable files
23
+ .env*
24
+ !.env.example
25
+
26
+ # Misc
27
+ .DS_Store
@@ -0,0 +1 @@
1
+ save-exact=true
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "app-name",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "start": "node --env-file=.env ./dist/src/http/server.js",
7
+ "start:dev": "tsx watch --env-file=.env.development ./src/http/server.ts",
8
+ "typecheck": "tsc --noEmit",
9
+ "lint": "biome lint",
10
+ "lint:fix": "biome lint --write",
11
+ "format": "biome format",
12
+ "format:fix": "biome format --write",
13
+ "check": "biome check",
14
+ "check:fix": "biome check --write",
15
+ "prebuild": "rimraf ./dist",
16
+ "build": "swc ./src ./package.json --copy-files --out-dir ./dist",
17
+ "test:integration": "vitest run --config ./vitest.config.integration.mts",
18
+ "test:integration:watch": "vitest --config ./vitest.config.integration.mts"
19
+ },
20
+ "dependencies": {
21
+ "@elysiajs/cors": "1.4.0",
22
+ "@elysiajs/node": "1.4.1",
23
+ "@elysiajs/openapi": "1.4.11",
24
+ "elysia": "1.4.13",
25
+ "zod": "4.1.12"
26
+ },
27
+ "devDependencies": {
28
+ "@biomejs/biome": "2.3.0",
29
+ "@elysiajs/eden": "^1.4.4",
30
+ "@faker-js/faker": "^10.1.0",
31
+ "@swc/cli": "0.7.8",
32
+ "@types/node": "24.9.1",
33
+ "rimraf": "6.0.1",
34
+ "tsx": "4.20.6",
35
+ "type-fest": "5.1.0",
36
+ "typescript": "5.9.3",
37
+ "vite-tsconfig-paths": "^5.1.4",
38
+ "vitest": "^4.0.6"
39
+ }
40
+ }