@leo-h/create-nodejs-app 1.0.64 → 1.0.66

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 (28) hide show
  1. package/dist/src/validations/back-end-framework.validation.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/elysia/.env.development +3 -0
  4. package/templates/elysia/.env.example +8 -0
  5. package/templates/elysia/.swcrc +19 -0
  6. package/templates/elysia/.vscode/settings.json +11 -0
  7. package/templates/elysia/biome.json +16 -0
  8. package/templates/elysia/gitignore +27 -0
  9. package/templates/elysia/npmrc +1 -0
  10. package/templates/elysia/package.json +40 -0
  11. package/templates/elysia/pnpm-lock.yaml +2599 -0
  12. package/templates/elysia/src/@types/zod-utils.ts +24 -0
  13. package/templates/elysia/src/env.ts +35 -0
  14. package/templates/elysia/src/http/app.ts +41 -0
  15. package/templates/elysia/src/http/controllers/hello-multipart.controller.spec.ts +85 -0
  16. package/templates/elysia/src/http/controllers/hello-multipart.controller.ts +52 -0
  17. package/templates/elysia/src/http/controllers/hello.controller.spec.ts +60 -0
  18. package/templates/elysia/src/http/controllers/hello.controller.ts +37 -0
  19. package/templates/elysia/src/http/controllers/index.ts +7 -0
  20. package/templates/elysia/src/http/errors.ts +138 -0
  21. package/templates/elysia/src/http/plugins/global-error-handler.plugin.ts +82 -0
  22. package/templates/elysia/src/http/server.ts +10 -0
  23. package/templates/elysia/test/integration/api-test-client.ts +4 -0
  24. package/templates/elysia/tsconfig.json +16 -0
  25. package/templates/elysia/vitest.config.integration.mts +9 -0
  26. package/templates/elysia/vitest.config.mts +17 -0
  27. package/templates/react-vite/package.json +1 -1
  28. package/templates/react-vite/pnpm-lock.yaml +5 -5
@@ -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.64",
3
+ "version": "1.0.66",
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.",
@@ -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
+ }