@leo-h/create-nodejs-app 1.0.68 → 1.0.70

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 (41) hide show
  1. package/dist/src/validations/front-end-framework.validation.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/elysia/biome.json +1 -1
  4. package/templates/elysia/package.json +2 -2
  5. package/templates/elysia/pnpm-lock.yaml +27 -27
  6. package/templates/elysia/src/http/controllers/hello-multipart.controller.ts +0 -1
  7. package/templates/elysia/src/http/controllers/hello.controller.ts +0 -1
  8. package/templates/elysia/src/http/errors.ts +6 -12
  9. package/templates/react-vite-tanstack-router/.env.development +5 -0
  10. package/templates/react-vite-tanstack-router/.env.example +5 -0
  11. package/templates/react-vite-tanstack-router/.vscode/settings.json +12 -0
  12. package/templates/react-vite-tanstack-router/README.md +73 -0
  13. package/templates/react-vite-tanstack-router/biome.json +16 -0
  14. package/templates/react-vite-tanstack-router/gitignore +24 -0
  15. package/templates/react-vite-tanstack-router/index.html +12 -0
  16. package/templates/react-vite-tanstack-router/kubb.config.ts +43 -0
  17. package/templates/react-vite-tanstack-router/npmrc +1 -0
  18. package/templates/react-vite-tanstack-router/package.json +47 -0
  19. package/templates/react-vite-tanstack-router/pnpm-lock.yaml +3773 -0
  20. package/templates/react-vite-tanstack-router/public/vite.svg +1 -0
  21. package/templates/react-vite-tanstack-router/src/api/errors.ts +17 -0
  22. package/templates/react-vite-tanstack-router/src/api/swr-fetcher.ts +100 -0
  23. package/templates/react-vite-tanstack-router/src/env.ts +16 -0
  24. package/templates/react-vite-tanstack-router/src/index.css +29 -0
  25. package/templates/react-vite-tanstack-router/src/lib/swr-config.ts +8 -0
  26. package/templates/react-vite-tanstack-router/src/lib/tanstack-router-instance.ts +16 -0
  27. package/templates/react-vite-tanstack-router/src/lib/zod-config.ts +97 -0
  28. package/templates/react-vite-tanstack-router/src/lib/zod-custom-error-map.ts +259 -0
  29. package/templates/react-vite-tanstack-router/src/main.tsx +20 -0
  30. package/templates/react-vite-tanstack-router/src/pages/__root.tsx +12 -0
  31. package/templates/react-vite-tanstack-router/src/pages/_app/index.tsx +24 -0
  32. package/templates/react-vite-tanstack-router/src/pages/_app/layout.tsx +15 -0
  33. package/templates/react-vite-tanstack-router/src/pages/_app/styles.css +40 -0
  34. package/templates/react-vite-tanstack-router/src/pages/_auth/layout.tsx +15 -0
  35. package/templates/react-vite-tanstack-router/src/pages/_auth/sign-in/index.tsx +94 -0
  36. package/templates/react-vite-tanstack-router/src/pages/_auth/sign-in/styles.css +92 -0
  37. package/templates/react-vite-tanstack-router/src/route-tree.gen.ts +127 -0
  38. package/templates/react-vite-tanstack-router/tsconfig.app.json +34 -0
  39. package/templates/react-vite-tanstack-router/tsconfig.json +7 -0
  40. package/templates/react-vite-tanstack-router/tsconfig.node.json +32 -0
  41. package/templates/react-vite-tanstack-router/vite.config.ts +23 -0
@@ -1 +1 @@
1
- const validation=require("../core/validation.js"),getValidOptionsFromPrompt=require("../utils/get-valid-options-from-prompt.js"),frontEndFrameworks=[{title:"React + Vite (includes: React Router v7, SWR + Orval, React Hook Form + Zod)",value:"react-vite"},{title:"Next.js",value:"next",disabled:!0}],frontEndValidFrameworks=getValidOptionsFromPrompt.getValidOptionsFromSelect(frontEndFrameworks);class FrontEndFrameworkValidation extends validation.Validation{static create(t){return new this().createValidation(t)}async validate(){let{framework:t}=this.params;return t=t.toLowerCase(),frontEndValidFrameworks.includes(t)?{isValid:!0}:{isValid:!1,issue:`Invalid front-end framework, consider the options: ${frontEndValidFrameworks.map(e=>`"${e}"`).join(", ")}.`}}}exports.FrontEndFrameworkValidation=FrontEndFrameworkValidation;exports.frontEndFrameworks=frontEndFrameworks;exports.frontEndValidFrameworks=frontEndValidFrameworks;
1
+ const validation=require("../core/validation.js"),getValidOptionsFromPrompt=require("../utils/get-valid-options-from-prompt.js"),frontEndFrameworks=[{title:"React + Vite (includes: React Router v7 Declarative, SWR + Orval, React Hook Form + Zod)",value:"react-vite"},{title:"React + Vite (includes: Tanstack Router, SWR + Kubb, React Hook Form + Zod v4)",value:"react-vite-tanstack-router"},{title:"Next.js",value:"next",disabled:!0}],frontEndValidFrameworks=getValidOptionsFromPrompt.getValidOptionsFromSelect(frontEndFrameworks);class FrontEndFrameworkValidation extends validation.Validation{static create(t){return new this().createValidation(t)}async validate(){let{framework:t}=this.params;return t=t.toLowerCase(),frontEndValidFrameworks.includes(t)?{isValid:!0}:{isValid:!1,issue:`Invalid front-end framework, consider the options: ${frontEndValidFrameworks.map(e=>`"${e}"`).join(", ")}.`}}}exports.FrontEndFrameworkValidation=FrontEndFrameworkValidation;exports.frontEndFrameworks=frontEndFrameworks;exports.frontEndValidFrameworks=frontEndValidFrameworks;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leo-h/create-nodejs-app",
3
- "version": "1.0.68",
3
+ "version": "1.0.70",
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.",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.3.0/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.3.5/schema.json",
3
3
  "files": {
4
4
  "includes": ["**", "!dist"]
5
5
  },
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@elysiajs/cors": "1.4.0",
22
- "@elysiajs/node": "1.4.1",
22
+ "@elysiajs/node": "1.4.2",
23
23
  "@elysiajs/openapi": "1.4.11",
24
- "elysia": "1.4.13",
24
+ "elysia": "1.4.16",
25
25
  "zod": "4.1.12"
26
26
  },
27
27
  "devDependencies": {
@@ -10,16 +10,16 @@ importers:
10
10
  dependencies:
11
11
  '@elysiajs/cors':
12
12
  specifier: 1.4.0
13
- version: 1.4.0(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
13
+ version: 1.4.0(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
14
14
  '@elysiajs/node':
15
- specifier: 1.4.1
16
- version: 1.4.1(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
15
+ specifier: 1.4.2
16
+ version: 1.4.2(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
17
17
  '@elysiajs/openapi':
18
18
  specifier: 1.4.11
19
- version: 1.4.11(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
19
+ version: 1.4.11(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
20
20
  elysia:
21
- specifier: 1.4.13
22
- version: 1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
21
+ specifier: 1.4.16
22
+ version: 1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
23
23
  zod:
24
24
  specifier: 4.1.12
25
25
  version: 4.1.12
@@ -29,7 +29,7 @@ importers:
29
29
  version: 2.3.5
30
30
  '@elysiajs/eden':
31
31
  specifier: ^1.4.4
32
- version: 1.4.4(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
32
+ version: 1.4.4(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))
33
33
  '@faker-js/faker':
34
34
  specifier: ^10.1.0
35
35
  version: 10.1.0
@@ -126,8 +126,8 @@ packages:
126
126
  peerDependencies:
127
127
  elysia: '>= 1.4.0-exp.0'
128
128
 
129
- '@elysiajs/node@1.4.1':
130
- resolution: {integrity: sha512-2wAALwHK3IYi1XJPnxfp1xJsvps5FqqcQqe+QXjYlGQvsmSG+vI5wNDIuvIlB+6p9NE/laLbqV0aFromf3X7yg==}
129
+ '@elysiajs/node@1.4.2':
130
+ resolution: {integrity: sha512-zqeBAV4/faCcmIEjCp3g6jRwsbaWsd5HqmlEf3CirD9HkTWQNo4T+GN/qGZi7zgd84D3Kzxsny7ZTMXEfrDSXQ==}
131
131
  peerDependencies:
132
132
  elysia: '>= 1.4.0'
133
133
 
@@ -851,8 +851,8 @@ packages:
851
851
  eastasianwidth@0.2.0:
852
852
  resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
853
853
 
854
- elysia@1.4.13:
855
- resolution: {integrity: sha512-6QaWQEm7QN1UCo1TPpEjaRJPHUmnM7R29y6LY224frDGk5PrpAnWmdHkoZxkcv+JRWp1j2ROr2IHbxHbG/jRjw==}
854
+ elysia@1.4.16:
855
+ resolution: {integrity: sha512-KZtKN160/bdWVKg2hEgyoNXY8jRRquc+m6PboyisaLZL891I+Ufb7Ja6lDAD7vMQur8sLEWIcidZOzj5lWw9UA==}
856
856
  peerDependencies:
857
857
  '@sinclair/typebox': '>= 0.34.0 < 1'
858
858
  '@types/bun': '>= 1.2.0'
@@ -1210,8 +1210,8 @@ packages:
1210
1210
  resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==}
1211
1211
  engines: {node: '>= 12'}
1212
1212
 
1213
- srvx@0.8.16:
1214
- resolution: {integrity: sha512-hmcGW4CgroeSmzgF1Ihwgl+Ths0JqAJ7HwjP2X7e3JzY7u4IydLMcdnlqGQiQGUswz+PO9oh/KtCpOISIvs9QQ==}
1213
+ srvx@0.9.6:
1214
+ resolution: {integrity: sha512-5L4rT6qQqqb+xcoDoklUgCNdmzqJ6vbcDRwPVGRXewF55IJH0pqh0lQlrJ266ZWTKJ4mfeioqHQJeAYesS+RrQ==}
1215
1215
  engines: {node: '>=20.16.0'}
1216
1216
  hasBin: true
1217
1217
 
@@ -1462,23 +1462,23 @@ snapshots:
1462
1462
 
1463
1463
  '@borewit/text-codec@0.1.1': {}
1464
1464
 
1465
- '@elysiajs/cors@1.4.0(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1465
+ '@elysiajs/cors@1.4.0(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1466
1466
  dependencies:
1467
- elysia: 1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1467
+ elysia: 1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1468
1468
 
1469
- '@elysiajs/eden@1.4.4(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1469
+ '@elysiajs/eden@1.4.4(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1470
1470
  dependencies:
1471
- elysia: 1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1471
+ elysia: 1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1472
1472
 
1473
- '@elysiajs/node@1.4.1(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1473
+ '@elysiajs/node@1.4.2(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1474
1474
  dependencies:
1475
- crossws: 0.4.1(srvx@0.8.16)
1476
- elysia: 1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1477
- srvx: 0.8.16
1475
+ crossws: 0.4.1(srvx@0.9.6)
1476
+ elysia: 1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1477
+ srvx: 0.9.6
1478
1478
 
1479
- '@elysiajs/openapi@1.4.11(elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1479
+ '@elysiajs/openapi@1.4.11(elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3))':
1480
1480
  dependencies:
1481
- elysia: 1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1481
+ elysia: 1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3)
1482
1482
 
1483
1483
  '@esbuild/aix-ppc64@0.25.11':
1484
1484
  optional: true
@@ -2033,9 +2033,9 @@ snapshots:
2033
2033
  shebang-command: 2.0.0
2034
2034
  which: 2.0.2
2035
2035
 
2036
- crossws@0.4.1(srvx@0.8.16):
2036
+ crossws@0.4.1(srvx@0.9.6):
2037
2037
  optionalDependencies:
2038
- srvx: 0.8.16
2038
+ srvx: 0.9.6
2039
2039
 
2040
2040
  debug@4.4.3:
2041
2041
  dependencies:
@@ -2051,7 +2051,7 @@ snapshots:
2051
2051
 
2052
2052
  eastasianwidth@0.2.0: {}
2053
2053
 
2054
- elysia@1.4.13(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3):
2054
+ elysia@1.4.16(@sinclair/typebox@0.34.41)(exact-mirror@0.2.2(@sinclair/typebox@0.34.41))(file-type@20.5.0)(openapi-types@12.1.3)(typescript@5.9.3):
2055
2055
  dependencies:
2056
2056
  '@sinclair/typebox': 0.34.41
2057
2057
  cookie: 1.0.2
@@ -2400,7 +2400,7 @@ snapshots:
2400
2400
 
2401
2401
  source-map@0.7.6: {}
2402
2402
 
2403
- srvx@0.8.16: {}
2403
+ srvx@0.9.6: {}
2404
2404
 
2405
2405
  stackback@0.0.2: {}
2406
2406
 
@@ -41,7 +41,6 @@ export const helloMultipartController = new Elysia().post(
41
41
  parse: "multipart/form-data",
42
42
  response: {
43
43
  ...globalErrorHandlerPlugin.getErrorSchemas(),
44
- "422": new ValidationError().toZodSchema({ isMessageLiteral: false }),
45
44
  },
46
45
  detail: {
47
46
  operationId: "helloMultipartController",
@@ -26,7 +26,6 @@ export const helloController = new Elysia().get(
26
26
  }),
27
27
  response: {
28
28
  ...globalErrorHandlerPlugin.getErrorSchemas(),
29
- "422": new ValidationError().toZodSchema({ isMessageLiteral: false }),
30
29
  },
31
30
  detail: {
32
31
  operationId: "helloController",
@@ -65,27 +65,21 @@ export abstract class BaseError<
65
65
  {
66
66
  name: Name;
67
67
  statusCode: StatusCode;
68
- message: Message;
68
+ message: string;
69
69
  }
70
70
  > {
71
71
  return status(this.statusCode, this.toSerialize());
72
72
  }
73
73
 
74
- public toZodSchema(options?: {
75
- isNameLiteral?: boolean;
76
- isStatusCodeLiteral?: boolean;
77
- isMessageLiteral?: boolean;
78
- }) {
79
- const { isNameLiteral, isStatusCodeLiteral, isMessageLiteral } = {
80
- isNameLiteral: true,
81
- isStatusCodeLiteral: true,
82
- isMessageLiteral: true,
74
+ public toZodSchema(options?: { isMessageLiteral?: boolean }) {
75
+ const { isMessageLiteral } = {
76
+ isMessageLiteral: false,
83
77
  ...options,
84
78
  };
85
79
 
86
80
  return z.object({
87
- name: isNameLiteral ? z.literal(this.name) : z.string(),
88
- statusCode: isStatusCodeLiteral ? z.literal(this.statusCode) : z.number(),
81
+ name: z.literal(this.name),
82
+ statusCode: z.literal(this.statusCode),
89
83
  message: isMessageLiteral ? z.literal(this.message) : z.string(),
90
84
  });
91
85
  }
@@ -0,0 +1,5 @@
1
+ # example: "app-name"
2
+ PUBLIC_APP_NAME="app-name"
3
+
4
+ # example: "http://localhost:3333"
5
+ PUBLIC_API_BASE_URL="http://localhost:3333"
@@ -0,0 +1,5 @@
1
+ # example: "app-name"
2
+ PUBLIC_APP_NAME=
3
+
4
+ # example: "http://localhost:3333"
5
+ PUBLIC_API_BASE_URL=
@@ -0,0 +1,12 @@
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
+ "css.lint.unknownAtRules": "ignore"
12
+ }
@@ -0,0 +1,73 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## React Compiler
11
+
12
+ The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
+
14
+ ## Expanding the ESLint configuration
15
+
16
+ If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
17
+
18
+ ```js
19
+ export default defineConfig([
20
+ globalIgnores(['dist']),
21
+ {
22
+ files: ['**/*.{ts,tsx}'],
23
+ extends: [
24
+ // Other configs...
25
+
26
+ // Remove tseslint.configs.recommended and replace with this
27
+ tseslint.configs.recommendedTypeChecked,
28
+ // Alternatively, use this for stricter rules
29
+ tseslint.configs.strictTypeChecked,
30
+ // Optionally, add this for stylistic rules
31
+ tseslint.configs.stylisticTypeChecked,
32
+
33
+ // Other configs...
34
+ ],
35
+ languageOptions: {
36
+ parserOptions: {
37
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
+ tsconfigRootDir: import.meta.dirname,
39
+ },
40
+ // other options...
41
+ },
42
+ },
43
+ ])
44
+ ```
45
+
46
+ You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
+
48
+ ```js
49
+ // eslint.config.js
50
+ import reactX from 'eslint-plugin-react-x'
51
+ import reactDom from 'eslint-plugin-react-dom'
52
+
53
+ export default defineConfig([
54
+ globalIgnores(['dist']),
55
+ {
56
+ files: ['**/*.{ts,tsx}'],
57
+ extends: [
58
+ // Other configs...
59
+ // Enable lint rules for React
60
+ reactX.configs['recommended-typescript'],
61
+ // Enable lint rules for React DOM
62
+ reactDom.configs.recommended,
63
+ ],
64
+ languageOptions: {
65
+ parserOptions: {
66
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
+ tsconfigRootDir: import.meta.dirname,
68
+ },
69
+ // other options...
70
+ },
71
+ },
72
+ ])
73
+ ```
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.4/schema.json",
3
+ "files": {
4
+ "includes": ["**", "!dist", "!src/route-tree.gen.ts"]
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,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -0,0 +1,12 @@
1
+ <html lang="pt-BR">
2
+ <head>
3
+ <meta charset="UTF-8" />
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ </head>
7
+
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,43 @@
1
+ import { defineConfig } from "@kubb/core";
2
+ import { pluginOas, type Options } from "@kubb/plugin-oas";
3
+ import { pluginSwr } from "@kubb/plugin-swr";
4
+ import { pluginTs } from "@kubb/plugin-ts";
5
+ import { pluginZod } from "@kubb/plugin-zod";
6
+
7
+ const pluginsGlobalOptions = {
8
+ group: {
9
+ type: "tag",
10
+ name: ({ group }) => group.replace(/\s/g, "-").toLowerCase(),
11
+ },
12
+ } satisfies Options;
13
+
14
+ export default defineConfig(() => {
15
+ return {
16
+ root: ".",
17
+ input: {
18
+ path: "http://localhost:3333/openapi/json",
19
+ },
20
+ output: {
21
+ path: "./src/api/generated",
22
+ clean: true,
23
+ format: "biome",
24
+ lint: "biome",
25
+ },
26
+ plugins: [
27
+ pluginOas(),
28
+ pluginTs({
29
+ ...pluginsGlobalOptions,
30
+ }),
31
+ pluginZod({
32
+ ...pluginsGlobalOptions,
33
+ }),
34
+ pluginSwr({
35
+ ...pluginsGlobalOptions,
36
+ client: {
37
+ importPath: "@/api/swr-fetcher.ts",
38
+ dataReturnType: "full",
39
+ },
40
+ }),
41
+ ],
42
+ };
43
+ });
@@ -0,0 +1 @@
1
+ save-exact=true
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "react-vite-tanstack-router",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "start:dev": "vite",
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
+ "build": "tsc -b && vite build",
16
+ "preview": "vite preview",
17
+ "api:generate": "kubb generate"
18
+ },
19
+ "dependencies": {
20
+ "@hookform/resolvers": "5.2.2",
21
+ "@tanstack/react-router": "1.134.13",
22
+ "pretty-bytes": "7.1.0",
23
+ "react": "^19.1.1",
24
+ "react-dom": "^19.1.1",
25
+ "react-hook-form": "7.66.0",
26
+ "swr": "^2.3.6",
27
+ "zod": "4.1.12"
28
+ },
29
+ "devDependencies": {
30
+ "@biomejs/biome": "2.3.4",
31
+ "@kubb/cli": "^4.5.9",
32
+ "@kubb/core": "^4.5.9",
33
+ "@kubb/plugin-oas": "^4.5.9",
34
+ "@kubb/plugin-swr": "^4.5.9",
35
+ "@kubb/plugin-ts": "^4.5.9",
36
+ "@kubb/plugin-zod": "^4.5.9",
37
+ "@tanstack/router-plugin": "1.134.14",
38
+ "@types/node": "^24.6.0",
39
+ "@types/react": "^19.1.16",
40
+ "@types/react-dom": "^19.1.9",
41
+ "@vitejs/plugin-react": "^5.0.4",
42
+ "type-fest": "^5.2.0",
43
+ "typescript": "~5.9.3",
44
+ "vite": "^7.1.7",
45
+ "vite-tsconfig-paths": "5.1.4"
46
+ }
47
+ }