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

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 (35) hide show
  1. package/dist/src/validations/front-end-framework.validation.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/react-vite-tanstack-router/.env.development +5 -0
  4. package/templates/react-vite-tanstack-router/.env.example +5 -0
  5. package/templates/react-vite-tanstack-router/.vscode/settings.json +12 -0
  6. package/templates/react-vite-tanstack-router/README.md +73 -0
  7. package/templates/react-vite-tanstack-router/biome.json +16 -0
  8. package/templates/react-vite-tanstack-router/gitignore +24 -0
  9. package/templates/react-vite-tanstack-router/index.html +12 -0
  10. package/templates/react-vite-tanstack-router/kubb.config.ts +43 -0
  11. package/templates/react-vite-tanstack-router/npmrc +1 -0
  12. package/templates/react-vite-tanstack-router/package.json +47 -0
  13. package/templates/react-vite-tanstack-router/pnpm-lock.yaml +3773 -0
  14. package/templates/react-vite-tanstack-router/public/vite.svg +1 -0
  15. package/templates/react-vite-tanstack-router/src/api/errors.ts +17 -0
  16. package/templates/react-vite-tanstack-router/src/api/swr-fetcher.ts +100 -0
  17. package/templates/react-vite-tanstack-router/src/env.ts +16 -0
  18. package/templates/react-vite-tanstack-router/src/index.css +29 -0
  19. package/templates/react-vite-tanstack-router/src/lib/swr-config.ts +8 -0
  20. package/templates/react-vite-tanstack-router/src/lib/tanstack-router-instance.ts +16 -0
  21. package/templates/react-vite-tanstack-router/src/lib/zod-config.ts +97 -0
  22. package/templates/react-vite-tanstack-router/src/lib/zod-custom-error-map.ts +259 -0
  23. package/templates/react-vite-tanstack-router/src/main.tsx +20 -0
  24. package/templates/react-vite-tanstack-router/src/pages/__root.tsx +12 -0
  25. package/templates/react-vite-tanstack-router/src/pages/_app/index.tsx +24 -0
  26. package/templates/react-vite-tanstack-router/src/pages/_app/layout.tsx +15 -0
  27. package/templates/react-vite-tanstack-router/src/pages/_app/styles.css +40 -0
  28. package/templates/react-vite-tanstack-router/src/pages/_auth/layout.tsx +15 -0
  29. package/templates/react-vite-tanstack-router/src/pages/_auth/sign-in/index.tsx +94 -0
  30. package/templates/react-vite-tanstack-router/src/pages/_auth/sign-in/styles.css +92 -0
  31. package/templates/react-vite-tanstack-router/src/route-tree.gen.ts +127 -0
  32. package/templates/react-vite-tanstack-router/tsconfig.app.json +34 -0
  33. package/templates/react-vite-tanstack-router/tsconfig.json +7 -0
  34. package/templates/react-vite-tanstack-router/tsconfig.node.json +32 -0
  35. 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.69",
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,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
+ }