@leo-h/create-nodejs-app 1.0.21 → 1.0.23
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.
- package/dist/index.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/compose-app/replace-content-in-file.compose.js +1 -1
- package/dist/src/core/validation.js +1 -1
- package/dist/src/validations/back-end-framework.validation.js +1 -0
- package/dist/src/validations/front-end-framework.validation.js +1 -0
- package/dist/src/validations/project-name-validation.js +1 -1
- package/dist/src/validations/template.validation.js +1 -1
- package/package.json +1 -1
- package/templates/react-vite/.env.example +8 -0
- package/templates/react-vite/.husky/pre-commit +1 -0
- package/templates/react-vite/.lintstagedrc.json +4 -0
- package/templates/react-vite/.prettierignore +7 -0
- package/templates/react-vite/.prettierrc.json +6 -0
- package/templates/react-vite/eslint.config.js +36 -0
- package/templates/react-vite/gitignore +24 -0
- package/templates/react-vite/index.html +12 -0
- package/templates/react-vite/npmrc +1 -0
- package/templates/react-vite/orval.config.ts +51 -0
- package/templates/react-vite/package.json +50 -0
- package/templates/react-vite/pnpm-lock.yaml +5412 -0
- package/templates/react-vite/public/vite.svg +1 -0
- package/templates/react-vite/scripts/orval-generate-api-definition.ts +90 -0
- package/templates/react-vite/src/@types/routes.ts +24 -0
- package/templates/react-vite/src/api/errors/api-error.ts +7 -0
- package/templates/react-vite/src/api/errors/api-unexpected-response-error.ts +8 -0
- package/templates/react-vite/src/api/swr-fetcher.ts +41 -0
- package/templates/react-vite/src/app.tsx +14 -0
- package/templates/react-vite/src/env.ts +19 -0
- package/templates/react-vite/src/hooks/use-current-route-handle-params.ts +16 -0
- package/templates/react-vite/src/index.css +29 -0
- package/templates/react-vite/src/lib/zod-i18n-translation-for-end-users.json +103 -0
- package/templates/react-vite/src/lib/zod-i18n.ts +20 -0
- package/templates/react-vite/src/main.tsx +13 -0
- package/templates/react-vite/src/pages/_layouts/app.tsx +17 -0
- package/templates/react-vite/src/pages/_layouts/auth.tsx +17 -0
- package/templates/react-vite/src/pages/app/dashboard/dashboard.tsx +12 -0
- package/templates/react-vite/src/pages/app/dashboard/styles.css +40 -0
- package/templates/react-vite/src/pages/auth/sign-in/index.tsx +83 -0
- package/templates/react-vite/src/pages/auth/sign-in/styles.css +92 -0
- package/templates/react-vite/src/routes.tsx +65 -0
- package/templates/react-vite/src/vite-env.d.ts +1 -0
- package/templates/react-vite/tsconfig.app.json +32 -0
- package/templates/react-vite/tsconfig.json +13 -0
- package/templates/react-vite/tsconfig.node.json +24 -0
- package/templates/react-vite/vite.config.ts +9 -0
- package/dist/src/validations/framework.validation.js +0 -1
@@ -0,0 +1,65 @@
|
|
1
|
+
import { createBrowserRouter } from "react-router";
|
2
|
+
import {
|
3
|
+
CustomRouteDefinition,
|
4
|
+
ReactRouterRouteDefinition,
|
5
|
+
} from "./@types/routes";
|
6
|
+
import { AppLayout } from "./pages/_layouts/app";
|
7
|
+
import { AuthLayout } from "./pages/_layouts/auth";
|
8
|
+
import { SignIn } from "./pages/auth/sign-in";
|
9
|
+
import { Dashboard } from "./pages/app/dashboard/dashboard";
|
10
|
+
|
11
|
+
export const authNavigationRoutes = [
|
12
|
+
{
|
13
|
+
path: "/sign-in",
|
14
|
+
label: "Sign In",
|
15
|
+
},
|
16
|
+
] as const satisfies CustomRouteDefinition[];
|
17
|
+
|
18
|
+
export const appNavigationRoutes = [
|
19
|
+
{
|
20
|
+
path: "/dashboard",
|
21
|
+
label: "Dashboard",
|
22
|
+
},
|
23
|
+
] as const satisfies CustomRouteDefinition[];
|
24
|
+
|
25
|
+
export const router = createBrowserRouter([
|
26
|
+
{
|
27
|
+
element: <AuthLayout />,
|
28
|
+
children: [
|
29
|
+
{
|
30
|
+
path: "*",
|
31
|
+
element: <SignIn />,
|
32
|
+
index: true,
|
33
|
+
handle: {
|
34
|
+
metadata: {
|
35
|
+
title: "Sign In",
|
36
|
+
},
|
37
|
+
},
|
38
|
+
},
|
39
|
+
{
|
40
|
+
path: "/sign-in",
|
41
|
+
element: <SignIn />,
|
42
|
+
index: true,
|
43
|
+
handle: {
|
44
|
+
metadata: {
|
45
|
+
title: "Sign In",
|
46
|
+
},
|
47
|
+
},
|
48
|
+
},
|
49
|
+
] satisfies ReactRouterRouteDefinition<typeof authNavigationRoutes>[],
|
50
|
+
},
|
51
|
+
{
|
52
|
+
element: <AppLayout />,
|
53
|
+
children: [
|
54
|
+
{
|
55
|
+
path: "/dashboard",
|
56
|
+
element: <Dashboard />,
|
57
|
+
handle: {
|
58
|
+
metadata: {
|
59
|
+
title: "Dashboard",
|
60
|
+
},
|
61
|
+
},
|
62
|
+
},
|
63
|
+
] satisfies ReactRouterRouteDefinition<typeof appNavigationRoutes>[],
|
64
|
+
},
|
65
|
+
]);
|
@@ -0,0 +1 @@
|
|
1
|
+
/// <reference types="vite/client" />
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
4
|
+
"target": "ES2020",
|
5
|
+
"useDefineForClassFields": true,
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
7
|
+
"module": "ESNext",
|
8
|
+
"skipLibCheck": true,
|
9
|
+
|
10
|
+
/* Bundler mode */
|
11
|
+
"moduleResolution": "bundler",
|
12
|
+
"allowImportingTsExtensions": true,
|
13
|
+
"isolatedModules": true,
|
14
|
+
"moduleDetection": "force",
|
15
|
+
"noEmit": true,
|
16
|
+
"jsx": "react-jsx",
|
17
|
+
|
18
|
+
/* Linting */
|
19
|
+
"strict": true,
|
20
|
+
"noUnusedLocals": true,
|
21
|
+
"noUnusedParameters": true,
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
23
|
+
"noUncheckedSideEffectImports": true,
|
24
|
+
|
25
|
+
/* Custom */
|
26
|
+
"baseUrl": ".",
|
27
|
+
"paths": {
|
28
|
+
"@/*": ["./src/*"]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
"include": ["src"]
|
32
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
4
|
+
"target": "ES2022",
|
5
|
+
"lib": ["ES2023"],
|
6
|
+
"module": "ESNext",
|
7
|
+
"skipLibCheck": true,
|
8
|
+
|
9
|
+
/* Bundler mode */
|
10
|
+
"moduleResolution": "bundler",
|
11
|
+
"allowImportingTsExtensions": true,
|
12
|
+
"isolatedModules": true,
|
13
|
+
"moduleDetection": "force",
|
14
|
+
"noEmit": true,
|
15
|
+
|
16
|
+
/* Linting */
|
17
|
+
"strict": true,
|
18
|
+
"noUnusedLocals": true,
|
19
|
+
"noUnusedParameters": true,
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
21
|
+
"noUncheckedSideEffectImports": true
|
22
|
+
},
|
23
|
+
"include": ["vite.config.ts"]
|
24
|
+
}
|
@@ -1 +0,0 @@
|
|
1
|
-
const validation=require("../core/validation.js"),getValidOptionsFromPrompt=require("../utils/get-valid-options-from-prompt.js"),frameworks=[{title:"Fastify",value:"fastify"},{title:"Nest + SWC",value:"nest"},{title:"tRPC",value:"trpc",disabled:!0}],validFrameworks=getValidOptionsFromPrompt.getValidOptionsFromSelect(frameworks);class FrameworkValidation extends validation.Validation{static create(t){return new this().createValidation(t)}async validate(){let{framework:t}=this.params;return t=t.toLowerCase(),validFrameworks.includes(t)?{isValid:!0}:{isValid:!1,issue:`Invalid framework, consider the options: ${validFrameworks.map(e=>`"${e}"`).join(", ")}.`}}}exports.FrameworkValidation=FrameworkValidation;exports.frameworks=frameworks;exports.validFrameworks=validFrameworks;
|