@leo-h/create-nodejs-app 1.0.20 → 1.0.22

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 (53) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/package.json.js +1 -1
  3. package/dist/src/compose-app/replace-content-in-file.compose.js +1 -1
  4. package/dist/src/core/validation.js +1 -1
  5. package/dist/src/validations/back-end-framework.validation.js +1 -0
  6. package/dist/src/validations/front-end-framework.validation.js +1 -0
  7. package/dist/src/validations/project-name-validation.js +1 -1
  8. package/dist/src/validations/template.validation.js +1 -1
  9. package/package.json +2 -2
  10. package/templates/clean/package.json +1 -1
  11. package/templates/clean/pnpm-lock.yaml +24 -24
  12. package/templates/fastify/package.json +1 -1
  13. package/templates/fastify/pnpm-lock.yaml +28 -28
  14. package/templates/nest/package.json +1 -1
  15. package/templates/nest/pnpm-lock.yaml +26 -26
  16. package/templates/react-vite/.env.example +8 -0
  17. package/templates/react-vite/.husky/pre-commit +1 -0
  18. package/templates/react-vite/.lintstagedrc.json +4 -0
  19. package/templates/react-vite/.prettierignore +7 -0
  20. package/templates/react-vite/.prettierrc.json +6 -0
  21. package/templates/react-vite/eslint.config.js +36 -0
  22. package/templates/react-vite/gitignore +24 -0
  23. package/templates/react-vite/index.html +12 -0
  24. package/templates/react-vite/npmrc +1 -0
  25. package/templates/react-vite/orval.config.ts +51 -0
  26. package/templates/react-vite/package.json +50 -0
  27. package/templates/react-vite/pnpm-lock.yaml +5412 -0
  28. package/templates/react-vite/public/vite.svg +1 -0
  29. package/templates/react-vite/scripts/orval-generate-api-definition.ts +90 -0
  30. package/templates/react-vite/src/@types/routes.ts +24 -0
  31. package/templates/react-vite/src/api/errors/api-error.ts +7 -0
  32. package/templates/react-vite/src/api/errors/api-unexpected-response-error.ts +8 -0
  33. package/templates/react-vite/src/api/swr-fetcher.ts +41 -0
  34. package/templates/react-vite/src/app.tsx +14 -0
  35. package/templates/react-vite/src/env.ts +19 -0
  36. package/templates/react-vite/src/hooks/use-current-route-handle-params.ts +16 -0
  37. package/templates/react-vite/src/index.css +29 -0
  38. package/templates/react-vite/src/lib/zod-i18n-translation-for-end-users.json +103 -0
  39. package/templates/react-vite/src/lib/zod-i18n.ts +20 -0
  40. package/templates/react-vite/src/main.tsx +13 -0
  41. package/templates/react-vite/src/pages/_layouts/app.tsx +17 -0
  42. package/templates/react-vite/src/pages/_layouts/auth.tsx +17 -0
  43. package/templates/react-vite/src/pages/app/dashboard/dashboard.tsx +12 -0
  44. package/templates/react-vite/src/pages/app/dashboard/styles.css +40 -0
  45. package/templates/react-vite/src/pages/auth/sign-in/index.tsx +83 -0
  46. package/templates/react-vite/src/pages/auth/sign-in/styles.css +92 -0
  47. package/templates/react-vite/src/routes.tsx +65 -0
  48. package/templates/react-vite/src/vite-env.d.ts +1 -0
  49. package/templates/react-vite/tsconfig.app.json +32 -0
  50. package/templates/react-vite/tsconfig.json +13 -0
  51. package/templates/react-vite/tsconfig.node.json +24 -0
  52. package/templates/react-vite/vite.config.ts +9 -0
  53. package/dist/src/validations/framework.validation.js +0 -1
@@ -0,0 +1,7 @@
1
+ node_modules
2
+ package-lock.json
3
+ yarn.lock
4
+ pnpm-lock.yaml
5
+ .husky
6
+ coverage
7
+ dist
@@ -0,0 +1,6 @@
1
+ {
2
+ "arrowParens": "avoid",
3
+ "semi": true,
4
+ "singleQuote": false,
5
+ "tabWidth": 2
6
+ }
@@ -0,0 +1,36 @@
1
+ import js from "@eslint/js";
2
+ import prettierEslint from "eslint-config-prettier";
3
+ import reactHooks from "eslint-plugin-react-hooks";
4
+ import reactRefresh from "eslint-plugin-react-refresh";
5
+ import globals from "globals";
6
+ import typescriptEslint from "typescript-eslint";
7
+
8
+ export default typescriptEslint.config(
9
+ {
10
+ ignores: ["dist", "src/api/orval"],
11
+ },
12
+ {
13
+ extends: [
14
+ js.configs.recommended,
15
+ ...typescriptEslint.configs.recommended,
16
+ prettierEslint,
17
+ ],
18
+ files: ["**/*.{ts,tsx}"],
19
+ languageOptions: {
20
+ ecmaVersion: 2020,
21
+ globals: globals.browser,
22
+ },
23
+ plugins: {
24
+ "react-hooks": reactHooks,
25
+ "react-refresh": reactRefresh,
26
+ },
27
+ rules: {
28
+ ...reactHooks.configs.recommended.rules,
29
+ "react-refresh/only-export-components": [
30
+ "warn",
31
+ { allowConstantExport: true },
32
+ ],
33
+ "@typescript-eslint/no-unused-vars": "warn",
34
+ },
35
+ },
36
+ );
@@ -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 @@
1
+ save-exact=true
@@ -0,0 +1,51 @@
1
+ import { defineConfig } from "orval";
2
+ import { OrvalCustomConfig } from "./scripts/orval-generate-api-definition";
3
+
4
+ export const orvalCustomConfig: OrvalCustomConfig = {
5
+ apiDocs: {
6
+ outputPath: "./src/api/docs.json",
7
+ },
8
+ endpoints: {
9
+ outputPath: "./src/api/orval/endpoints",
10
+ replaceVoidTypeToAnyOnResponse: true,
11
+ },
12
+ zodSchemas: {
13
+ outputPath: "./src/api/orval/schemas",
14
+ },
15
+ };
16
+
17
+ export default defineConfig({
18
+ api: {
19
+ input: orvalCustomConfig.apiDocs.outputPath,
20
+ output: {
21
+ target: orvalCustomConfig.endpoints.outputPath,
22
+ client: "swr",
23
+ httpClient: "fetch",
24
+ baseUrl: new URL(process.env.APP_API_BASE_URL!).toString(),
25
+ mode: "tags",
26
+ clean: true,
27
+ override: {
28
+ mutator: {
29
+ path: "./src/api/swr-fetcher.ts",
30
+ name: "swrFetcher",
31
+ },
32
+ swr: {
33
+ swrOptions: {
34
+ errorRetryCount: 3,
35
+ errorRetryInterval: 3500,
36
+ revalidateOnFocus: false,
37
+ },
38
+ },
39
+ },
40
+ },
41
+ },
42
+ apiZod: {
43
+ input: orvalCustomConfig.apiDocs.outputPath,
44
+ output: {
45
+ target: orvalCustomConfig.zodSchemas.outputPath,
46
+ client: "zod",
47
+ mode: "tags",
48
+ clean: true,
49
+ },
50
+ },
51
+ });
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "app-name",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "prepare": "husky",
8
+ "start:dev": "vite",
9
+ "typecheck": "tsc --noEmit",
10
+ "lint": "eslint . --max-warnings 0 --cache",
11
+ "lint:fix": "pnpm lint --fix",
12
+ "format": "prettier . --write --cache",
13
+ "build": "tsc -b && vite build",
14
+ "preview": "vite preview",
15
+ "orval:generate": "tsx --env-file=.env ./scripts/orval-generate-api-definition.ts"
16
+ },
17
+ "dependencies": {
18
+ "@hookform/resolvers": "3.10.0",
19
+ "i18next": "24.2.1",
20
+ "react": "18.3.1",
21
+ "react-dom": "18.3.1",
22
+ "react-helmet-async": "2.0.5",
23
+ "react-hook-form": "7.54.2",
24
+ "react-router": "7.1.1",
25
+ "swr": "2.3.0",
26
+ "zod": "3.24.1",
27
+ "zod-i18n-map": "2.27.0"
28
+ },
29
+ "devDependencies": {
30
+ "@eslint/js": "9.17.0",
31
+ "@types/react": "18.3.18",
32
+ "@types/react-dom": "18.3.5",
33
+ "@vitejs/plugin-react": "4.3.4",
34
+ "eslint": "9.17.0",
35
+ "eslint-config-prettier": "9.1.0",
36
+ "eslint-plugin-react-hooks": "5.0.0",
37
+ "eslint-plugin-react-refresh": "0.4.16",
38
+ "globals": "15.14.0",
39
+ "husky": "9.1.7",
40
+ "lint-staged": "15.3.0",
41
+ "orval": "7.4.1",
42
+ "prettier": "3.4.2",
43
+ "tsx": "4.19.2",
44
+ "type-fest": "4.32.0",
45
+ "typescript": "~5.6.2",
46
+ "typescript-eslint": "8.18.2",
47
+ "vite": "6.0.7",
48
+ "vite-tsconfig-paths": "5.1.3"
49
+ }
50
+ }