create-reactivite 1.4.0 → 1.7.0
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/README.md +326 -290
- package/index.js +77 -2
- package/package.json +4 -2
- package/template/.storybook/main.ts +20 -0
- package/template/.storybook/preview.tsx +55 -0
- package/template/_gitignore +3 -0
- package/template/index.html +1 -1
- package/template/package.json +29 -23
- package/template/src/components/author-credit.tsx +25 -25
- package/template/src/components/ui-lib/auth-form.stories.tsx +26 -0
- package/template/src/components/ui-lib/auth-form.tsx +116 -0
- package/template/src/components/ui-lib/empty-state.stories.tsx +32 -0
- package/template/src/components/ui-lib/empty-state.tsx +54 -0
- package/template/src/components/ui-lib/feature-card.stories.tsx +45 -0
- package/template/src/components/ui-lib/feature-card.tsx +52 -0
- package/template/src/components/ui-lib/index.ts +13 -0
- package/template/src/components/ui-lib/page-header.stories.tsx +49 -0
- package/template/src/components/ui-lib/page-header.tsx +46 -0
- package/template/src/components/ui-lib/pricing-card.stories.tsx +58 -0
- package/template/src/components/ui-lib/pricing-card.tsx +86 -0
- package/template/src/components/ui-lib/stat-card.stories.tsx +55 -0
- package/template/src/components/ui-lib/stat-card.tsx +73 -0
- package/template/src/components/ui-lib/themes.stories.tsx +68 -0
- package/template/src/global.css +122 -0
- package/template2/.env.example +8 -8
- package/template2/.husky/pre-commit +4 -4
- package/template2/.prettierrc +5 -5
- package/template2/README.md +73 -73
- package/template2/__tests__/example.test.ts +20 -20
- package/template2/_gitignore +37 -37
- package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -52
- package/template2/app/[locale]/(public)/login/page.tsx +83 -83
- package/template2/app/[locale]/layout.tsx +58 -58
- package/template2/app/[locale]/locales.ts +10 -10
- package/template2/app/[locale]/page.tsx +38 -38
- package/template2/app/api/clear-session/route.ts +10 -10
- package/template2/app/globals.css +127 -127
- package/template2/app/layout.tsx +7 -7
- package/template2/app/page.tsx +6 -6
- package/template2/components/AuthEventListener.tsx +22 -22
- package/template2/components/author-credit.tsx +25 -25
- package/template2/components/theme-provider.tsx +78 -78
- package/template2/components/ui/button.tsx +60 -60
- package/template2/components/ui/card.tsx +92 -92
- package/template2/components/ui/input.tsx +21 -21
- package/template2/components/ui/label.tsx +24 -24
- package/template2/components/ui/sonner.tsx +40 -40
- package/template2/components.json +22 -22
- package/template2/config/constants.ts +7 -7
- package/template2/config/env.ts +5 -5
- package/template2/contexts/translation-context.tsx +70 -70
- package/template2/eslint.config.mjs +18 -18
- package/template2/hoc/provider.tsx +27 -27
- package/template2/lib/paramsSerializer.ts +40 -40
- package/template2/lib/utils.ts +6 -6
- package/template2/locales/az.json +20 -20
- package/template2/locales/en.json +20 -20
- package/template2/next-env.d.ts +1 -1
- package/template2/next.config.ts +17 -17
- package/template2/orval.config.ts +66 -66
- package/template2/package.json +62 -62
- package/template2/postcss.config.mjs +7 -7
- package/template2/scripts/fix-generated-types.mjs +13 -13
- package/template2/services/generated/.gitkeep +2 -2
- package/template2/services/httpClient/httpClient.ts +70 -70
- package/template2/services/httpClient/orvalMutator.ts +10 -10
- package/template2/store/example-store.tsx +16 -16
- package/template2/store/user-store.tsx +29 -29
- package/template2/testing/msw/handlers/index.ts +6 -6
- package/template2/testing/msw/server.ts +4 -4
- package/template2/tsconfig.json +34 -34
- package/template2/vitest.config.ts +17 -17
- package/template2/vitest.setup.ts +7 -7
- package/template3/README.md +34 -34
- package/template3/_gitignore +16 -16
- package/template3/components.json +21 -0
- package/template3/index.html +8 -2
- package/template3/package.json +48 -22
- package/template3/postcss.config.mjs +5 -0
- package/template3/rspack.config.mjs +59 -51
- package/template3/src/App.tsx +16 -11
- package/template3/src/components/author-credit.tsx +42 -42
- package/template3/src/components/layout.tsx +59 -0
- package/template3/src/components/matrix-rain.tsx +71 -0
- package/template3/src/components/ui/accordion.tsx +64 -0
- package/template3/src/components/ui/alert-dialog.tsx +196 -0
- package/template3/src/components/ui/alert.tsx +66 -0
- package/template3/src/components/ui/aspect-ratio.tsx +11 -0
- package/template3/src/components/ui/avatar.tsx +107 -0
- package/template3/src/components/ui/badge.tsx +48 -0
- package/template3/src/components/ui/breadcrumb.tsx +109 -0
- package/template3/src/components/ui/button-group.tsx +83 -0
- package/template3/src/components/ui/button.tsx +64 -0
- package/template3/src/components/ui/calendar.tsx +218 -0
- package/template3/src/components/ui/card.tsx +92 -0
- package/template3/src/components/ui/carousel.tsx +241 -0
- package/template3/src/components/ui/chart.tsx +372 -0
- package/template3/src/components/ui/checkbox.tsx +32 -0
- package/template3/src/components/ui/collapsible.tsx +31 -0
- package/template3/src/components/ui/combobox.tsx +310 -0
- package/template3/src/components/ui/command.tsx +184 -0
- package/template3/src/components/ui/context-menu.tsx +252 -0
- package/template3/src/components/ui/dialog.tsx +156 -0
- package/template3/src/components/ui/direction.tsx +22 -0
- package/template3/src/components/ui/drawer.tsx +133 -0
- package/template3/src/components/ui/dropdown-menu.tsx +257 -0
- package/template3/src/components/ui/empty.tsx +104 -0
- package/template3/src/components/ui/field.tsx +248 -0
- package/template3/src/components/ui/form.tsx +165 -0
- package/template3/src/components/ui/hover-card.tsx +42 -0
- package/template3/src/components/ui/input-group.tsx +168 -0
- package/template3/src/components/ui/input-otp.tsx +77 -0
- package/template3/src/components/ui/input.tsx +21 -0
- package/template3/src/components/ui/item.tsx +193 -0
- package/template3/src/components/ui/kbd.tsx +28 -0
- package/template3/src/components/ui/label.tsx +22 -0
- package/template3/src/components/ui/menubar.tsx +276 -0
- package/template3/src/components/ui/native-select.tsx +62 -0
- package/template3/src/components/ui/navigation-menu.tsx +168 -0
- package/template3/src/components/ui/pagination.tsx +127 -0
- package/template3/src/components/ui/popover.tsx +87 -0
- package/template3/src/components/ui/progress.tsx +31 -0
- package/template3/src/components/ui/radio-group.tsx +43 -0
- package/template3/src/components/ui/resizable.tsx +53 -0
- package/template3/src/components/ui/scroll-area.tsx +56 -0
- package/template3/src/components/ui/select.tsx +190 -0
- package/template3/src/components/ui/separator.tsx +26 -0
- package/template3/src/components/ui/sheet.tsx +143 -0
- package/template3/src/components/ui/sidebar.tsx +724 -0
- package/template3/src/components/ui/skeleton.tsx +13 -0
- package/template3/src/components/ui/slider.tsx +61 -0
- package/template3/src/components/ui/sonner.tsx +40 -0
- package/template3/src/components/ui/spinner.tsx +16 -0
- package/template3/src/components/ui/switch.tsx +33 -0
- package/template3/src/components/ui/table.tsx +116 -0
- package/template3/src/components/ui/tabs.tsx +89 -0
- package/template3/src/components/ui/textarea.tsx +18 -0
- package/template3/src/components/ui/toggle-group.tsx +83 -0
- package/template3/src/components/ui/toggle.tsx +47 -0
- package/template3/src/components/ui/tooltip.tsx +55 -0
- package/template3/src/hooks/use-mobile.ts +19 -0
- package/template3/src/index.css +175 -32
- package/template3/src/lib/utils.ts +6 -0
- package/template3/src/main.tsx +10 -10
- package/template3/src/pages/about.tsx +113 -0
- package/template3/src/pages/contact.tsx +111 -0
- package/template3/src/pages/home.tsx +81 -0
- package/template3/tsconfig.json +24 -20
- package/template/pnpm-lock.yaml +0 -3274
- package/template2/tsconfig.tsbuildinfo +0 -1
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { createContext, useContext, ReactNode, useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
type MessageValue = string | Record<string, string>;
|
|
6
|
-
type Messages = Record<string, MessageValue>;
|
|
7
|
-
|
|
8
|
-
interface TranslationContextType {
|
|
9
|
-
locale: string;
|
|
10
|
-
messages: Messages;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const TranslationContext = createContext<TranslationContextType | undefined>(
|
|
14
|
-
undefined,
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
interface TranslationProviderProps {
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
locale: string;
|
|
20
|
-
messages: Messages;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function TranslationProvider({
|
|
24
|
-
children,
|
|
25
|
-
locale,
|
|
26
|
-
messages,
|
|
27
|
-
}: Readonly<TranslationProviderProps>) {
|
|
28
|
-
const value = useMemo(() => ({ locale, messages }), [locale, messages]);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<TranslationContext.Provider value={value}>
|
|
32
|
-
{children}
|
|
33
|
-
</TranslationContext.Provider>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function useTranslations(namespace?: string) {
|
|
38
|
-
const context = useContext(TranslationContext);
|
|
39
|
-
|
|
40
|
-
if (!context) {
|
|
41
|
-
throw new Error('useTranslations must be used within TranslationProvider');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return (key: string): string => {
|
|
45
|
-
const { messages } = context;
|
|
46
|
-
|
|
47
|
-
if (!namespace) {
|
|
48
|
-
const value = messages[key];
|
|
49
|
-
return typeof value === 'string' ? value : key;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const ns = messages[namespace];
|
|
53
|
-
|
|
54
|
-
if (!ns || typeof ns !== 'object') {
|
|
55
|
-
return key;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return ns[key] ?? key;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function useLocale(): string {
|
|
63
|
-
const context = useContext(TranslationContext);
|
|
64
|
-
|
|
65
|
-
if (!context) {
|
|
66
|
-
throw new Error('useLocale must be used within TranslationProvider');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return context.locale;
|
|
70
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, ReactNode, useMemo } from 'react';
|
|
4
|
+
|
|
5
|
+
type MessageValue = string | Record<string, string>;
|
|
6
|
+
type Messages = Record<string, MessageValue>;
|
|
7
|
+
|
|
8
|
+
interface TranslationContextType {
|
|
9
|
+
locale: string;
|
|
10
|
+
messages: Messages;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const TranslationContext = createContext<TranslationContextType | undefined>(
|
|
14
|
+
undefined,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
interface TranslationProviderProps {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
locale: string;
|
|
20
|
+
messages: Messages;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function TranslationProvider({
|
|
24
|
+
children,
|
|
25
|
+
locale,
|
|
26
|
+
messages,
|
|
27
|
+
}: Readonly<TranslationProviderProps>) {
|
|
28
|
+
const value = useMemo(() => ({ locale, messages }), [locale, messages]);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<TranslationContext.Provider value={value}>
|
|
32
|
+
{children}
|
|
33
|
+
</TranslationContext.Provider>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function useTranslations(namespace?: string) {
|
|
38
|
+
const context = useContext(TranslationContext);
|
|
39
|
+
|
|
40
|
+
if (!context) {
|
|
41
|
+
throw new Error('useTranslations must be used within TranslationProvider');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (key: string): string => {
|
|
45
|
+
const { messages } = context;
|
|
46
|
+
|
|
47
|
+
if (!namespace) {
|
|
48
|
+
const value = messages[key];
|
|
49
|
+
return typeof value === 'string' ? value : key;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const ns = messages[namespace];
|
|
53
|
+
|
|
54
|
+
if (!ns || typeof ns !== 'object') {
|
|
55
|
+
return key;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return ns[key] ?? key;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function useLocale(): string {
|
|
63
|
+
const context = useContext(TranslationContext);
|
|
64
|
+
|
|
65
|
+
if (!context) {
|
|
66
|
+
throw new Error('useLocale must be used within TranslationProvider');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return context.locale;
|
|
70
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
-
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
3
|
-
import nextTs from "eslint-config-next/typescript";
|
|
4
|
-
|
|
5
|
-
const eslintConfig = defineConfig([
|
|
6
|
-
...nextVitals,
|
|
7
|
-
...nextTs,
|
|
8
|
-
globalIgnores([
|
|
9
|
-
".next/**",
|
|
10
|
-
"out/**",
|
|
11
|
-
"build/**",
|
|
12
|
-
"next-env.d.ts",
|
|
13
|
-
// Auto-generated by orval — do not lint
|
|
14
|
-
"services/generated/**",
|
|
15
|
-
]),
|
|
16
|
-
]);
|
|
17
|
-
|
|
18
|
-
export default eslintConfig;
|
|
1
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
+
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
3
|
+
import nextTs from "eslint-config-next/typescript";
|
|
4
|
+
|
|
5
|
+
const eslintConfig = defineConfig([
|
|
6
|
+
...nextVitals,
|
|
7
|
+
...nextTs,
|
|
8
|
+
globalIgnores([
|
|
9
|
+
".next/**",
|
|
10
|
+
"out/**",
|
|
11
|
+
"build/**",
|
|
12
|
+
"next-env.d.ts",
|
|
13
|
+
// Auto-generated by orval — do not lint
|
|
14
|
+
"services/generated/**",
|
|
15
|
+
]),
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
export default eslintConfig;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
|
-
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
5
|
-
import { useState } from 'react';
|
|
6
|
-
|
|
7
|
-
export function QueryProvider({
|
|
8
|
-
children,
|
|
9
|
-
}: Readonly<{ children: React.ReactNode }>) {
|
|
10
|
-
const [queryClient] = useState(
|
|
11
|
-
() =>
|
|
12
|
-
new QueryClient({
|
|
13
|
-
defaultOptions: {
|
|
14
|
-
queries: {
|
|
15
|
-
staleTime: 0,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
}),
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<QueryClientProvider client={queryClient}>
|
|
23
|
-
{children}
|
|
24
|
-
<ReactQueryDevtools initialIsOpen={false} />
|
|
25
|
-
</QueryClientProvider>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
|
+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
|
|
7
|
+
export function QueryProvider({
|
|
8
|
+
children,
|
|
9
|
+
}: Readonly<{ children: React.ReactNode }>) {
|
|
10
|
+
const [queryClient] = useState(
|
|
11
|
+
() =>
|
|
12
|
+
new QueryClient({
|
|
13
|
+
defaultOptions: {
|
|
14
|
+
queries: {
|
|
15
|
+
staleTime: 0,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<QueryClientProvider client={queryClient}>
|
|
23
|
+
{children}
|
|
24
|
+
<ReactQueryDevtools initialIsOpen={false} />
|
|
25
|
+
</QueryClientProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flattens one level of nested objects before serializing to a query string.
|
|
3
|
-
* Useful when a backend (e.g. Spring Boot Pageable / @ModelAttribute) expects
|
|
4
|
-
* flat params (page=0&size=10) instead of Axios's default bracket notation
|
|
5
|
-
* (pageable[page]=0&pageable[size]=10).
|
|
6
|
-
*
|
|
7
|
-
* Arrays at any level are repeated: sort=name,asc&sort=id,desc
|
|
8
|
-
* null/undefined values are omitted.
|
|
9
|
-
*/
|
|
10
|
-
export const paramsSerializer = (params: Record<string, unknown>): string => {
|
|
11
|
-
const parts: string[] = [];
|
|
12
|
-
for (const [key, value] of Object.entries(params)) {
|
|
13
|
-
if (value === undefined || value === null) continue;
|
|
14
|
-
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
15
|
-
for (const [k, v] of Object.entries(value as Record<string, unknown>)) {
|
|
16
|
-
if (v === undefined || v === null) continue;
|
|
17
|
-
if (Array.isArray(v)) {
|
|
18
|
-
for (const item of v)
|
|
19
|
-
parts.push(
|
|
20
|
-
`${encodeURIComponent(k)}=${encodeURIComponent(String(item))}`,
|
|
21
|
-
);
|
|
22
|
-
} else {
|
|
23
|
-
parts.push(
|
|
24
|
-
`${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`,
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
} else if (Array.isArray(value)) {
|
|
29
|
-
for (const item of value)
|
|
30
|
-
parts.push(
|
|
31
|
-
`${encodeURIComponent(key)}=${encodeURIComponent(String(item))}`,
|
|
32
|
-
);
|
|
33
|
-
} else {
|
|
34
|
-
parts.push(
|
|
35
|
-
`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`,
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return parts.join('&');
|
|
40
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Flattens one level of nested objects before serializing to a query string.
|
|
3
|
+
* Useful when a backend (e.g. Spring Boot Pageable / @ModelAttribute) expects
|
|
4
|
+
* flat params (page=0&size=10) instead of Axios's default bracket notation
|
|
5
|
+
* (pageable[page]=0&pageable[size]=10).
|
|
6
|
+
*
|
|
7
|
+
* Arrays at any level are repeated: sort=name,asc&sort=id,desc
|
|
8
|
+
* null/undefined values are omitted.
|
|
9
|
+
*/
|
|
10
|
+
export const paramsSerializer = (params: Record<string, unknown>): string => {
|
|
11
|
+
const parts: string[] = [];
|
|
12
|
+
for (const [key, value] of Object.entries(params)) {
|
|
13
|
+
if (value === undefined || value === null) continue;
|
|
14
|
+
if (typeof value === 'object' && !Array.isArray(value)) {
|
|
15
|
+
for (const [k, v] of Object.entries(value as Record<string, unknown>)) {
|
|
16
|
+
if (v === undefined || v === null) continue;
|
|
17
|
+
if (Array.isArray(v)) {
|
|
18
|
+
for (const item of v)
|
|
19
|
+
parts.push(
|
|
20
|
+
`${encodeURIComponent(k)}=${encodeURIComponent(String(item))}`,
|
|
21
|
+
);
|
|
22
|
+
} else {
|
|
23
|
+
parts.push(
|
|
24
|
+
`${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
} else if (Array.isArray(value)) {
|
|
29
|
+
for (const item of value)
|
|
30
|
+
parts.push(
|
|
31
|
+
`${encodeURIComponent(key)}=${encodeURIComponent(String(item))}`,
|
|
32
|
+
);
|
|
33
|
+
} else {
|
|
34
|
+
parts.push(
|
|
35
|
+
`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return parts.join('&');
|
|
40
|
+
};
|
package/template2/lib/utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { clsx, type ClassValue } from "clsx"
|
|
2
|
-
import { twMerge } from "tailwind-merge"
|
|
3
|
-
|
|
4
|
-
export function cn(...inputs: ClassValue[]) {
|
|
5
|
-
return twMerge(clsx(inputs))
|
|
6
|
-
}
|
|
1
|
+
import { clsx, type ClassValue } from "clsx"
|
|
2
|
+
import { twMerge } from "tailwind-merge"
|
|
3
|
+
|
|
4
|
+
export function cn(...inputs: ClassValue[]) {
|
|
5
|
+
return twMerge(clsx(inputs))
|
|
6
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"home": {
|
|
3
|
-
"title": "Nextivite-ə xoş gəlmisən",
|
|
4
|
-
"subtitle": "Next.js 16, Tailwind v4, TanStack Query, Zustand, orval və husky ilə hazır boilerplate.",
|
|
5
|
-
"login": "Daxil ol",
|
|
6
|
-
"dashboard": "Panelə keç"
|
|
7
|
-
},
|
|
8
|
-
"login": {
|
|
9
|
-
"title": "Daxil ol",
|
|
10
|
-
"email": "E-poçt",
|
|
11
|
-
"password": "Şifrə",
|
|
12
|
-
"submit": "Daxil ol",
|
|
13
|
-
"success": "Uğurla daxil oldun"
|
|
14
|
-
},
|
|
15
|
-
"dashboard": {
|
|
16
|
-
"title": "Panel",
|
|
17
|
-
"welcome": "Xoş gəldin",
|
|
18
|
-
"logout": "Çıxış"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"home": {
|
|
3
|
+
"title": "Nextivite-ə xoş gəlmisən",
|
|
4
|
+
"subtitle": "Next.js 16, Tailwind v4, TanStack Query, Zustand, orval və husky ilə hazır boilerplate.",
|
|
5
|
+
"login": "Daxil ol",
|
|
6
|
+
"dashboard": "Panelə keç"
|
|
7
|
+
},
|
|
8
|
+
"login": {
|
|
9
|
+
"title": "Daxil ol",
|
|
10
|
+
"email": "E-poçt",
|
|
11
|
+
"password": "Şifrə",
|
|
12
|
+
"submit": "Daxil ol",
|
|
13
|
+
"success": "Uğurla daxil oldun"
|
|
14
|
+
},
|
|
15
|
+
"dashboard": {
|
|
16
|
+
"title": "Panel",
|
|
17
|
+
"welcome": "Xoş gəldin",
|
|
18
|
+
"logout": "Çıxış"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"home": {
|
|
3
|
-
"title": "Welcome to Nextivite",
|
|
4
|
-
"subtitle": "A ready-to-go boilerplate with Next.js 16, Tailwind v4, TanStack Query, Zustand, orval and husky.",
|
|
5
|
-
"login": "Sign in",
|
|
6
|
-
"dashboard": "Go to dashboard"
|
|
7
|
-
},
|
|
8
|
-
"login": {
|
|
9
|
-
"title": "Sign in",
|
|
10
|
-
"email": "Email",
|
|
11
|
-
"password": "Password",
|
|
12
|
-
"submit": "Sign in",
|
|
13
|
-
"success": "Signed in successfully"
|
|
14
|
-
},
|
|
15
|
-
"dashboard": {
|
|
16
|
-
"title": "Dashboard",
|
|
17
|
-
"welcome": "Welcome",
|
|
18
|
-
"logout": "Log out"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"home": {
|
|
3
|
+
"title": "Welcome to Nextivite",
|
|
4
|
+
"subtitle": "A ready-to-go boilerplate with Next.js 16, Tailwind v4, TanStack Query, Zustand, orval and husky.",
|
|
5
|
+
"login": "Sign in",
|
|
6
|
+
"dashboard": "Go to dashboard"
|
|
7
|
+
},
|
|
8
|
+
"login": {
|
|
9
|
+
"title": "Sign in",
|
|
10
|
+
"email": "Email",
|
|
11
|
+
"password": "Password",
|
|
12
|
+
"submit": "Sign in",
|
|
13
|
+
"success": "Signed in successfully"
|
|
14
|
+
},
|
|
15
|
+
"dashboard": {
|
|
16
|
+
"title": "Dashboard",
|
|
17
|
+
"welcome": "Welcome",
|
|
18
|
+
"logout": "Log out"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/template2/next-env.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/types/routes.d.ts";
|
|
3
|
+
import "./.next/dev/types/routes.d.ts";
|
|
4
4
|
|
|
5
5
|
// NOTE: This file should not be edited
|
|
6
6
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
package/template2/next.config.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { NextConfig } from "next";
|
|
2
|
-
|
|
3
|
-
const nextConfig: NextConfig = {
|
|
4
|
-
async rewrites() {
|
|
5
|
-
const backendUrl = process.env.API_BASE_URL;
|
|
6
|
-
if (!backendUrl) return [];
|
|
7
|
-
return [
|
|
8
|
-
{
|
|
9
|
-
source: "/api/backend/:path*",
|
|
10
|
-
destination: `${backendUrl}/:path*`,
|
|
11
|
-
},
|
|
12
|
-
];
|
|
13
|
-
},
|
|
14
|
-
output: "standalone",
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default nextConfig;
|
|
1
|
+
import type { NextConfig } from "next";
|
|
2
|
+
|
|
3
|
+
const nextConfig: NextConfig = {
|
|
4
|
+
async rewrites() {
|
|
5
|
+
const backendUrl = process.env.API_BASE_URL;
|
|
6
|
+
if (!backendUrl) return [];
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
source: "/api/backend/:path*",
|
|
10
|
+
destination: `${backendUrl}/:path*`,
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
},
|
|
14
|
+
output: "standalone",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default nextConfig;
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { defineConfig } from 'orval';
|
|
2
|
-
|
|
3
|
-
const SKIP = new Set(['public', 'api', 'v1', 'v2', 'v3']);
|
|
4
|
-
const VERB_PREFIX: Record<string, string> = {
|
|
5
|
-
get: 'get',
|
|
6
|
-
post: 'create',
|
|
7
|
-
put: 'update',
|
|
8
|
-
patch: 'patch',
|
|
9
|
-
delete: 'delete',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// Converts path + HTTP verb → semantic camelCase name.
|
|
13
|
-
// GET /users/public/{id}/posts → getUsersByIdPosts
|
|
14
|
-
// POST /public/auth/login → createAuthLogin
|
|
15
|
-
export function buildOperationName(
|
|
16
|
-
_operation: unknown,
|
|
17
|
-
route: string,
|
|
18
|
-
verb: string,
|
|
19
|
-
): string {
|
|
20
|
-
const prefix = VERB_PREFIX[verb] ?? verb;
|
|
21
|
-
const parts = route
|
|
22
|
-
.replace(/\{([^}]+)\}/g, (_, p) =>
|
|
23
|
-
'By' + p.charAt(0).toUpperCase() + p.slice(1),
|
|
24
|
-
)
|
|
25
|
-
.split('/')
|
|
26
|
-
.filter((s) => s && !SKIP.has(s))
|
|
27
|
-
.map((s) =>
|
|
28
|
-
s
|
|
29
|
-
.charAt(0)
|
|
30
|
-
.toUpperCase()
|
|
31
|
-
.concat(s.slice(1))
|
|
32
|
-
.replace(/-([a-z])/g, (_, c) => c.toUpperCase()),
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const deduped = parts.filter((p, i) => p !== parts[i - 1]);
|
|
36
|
-
return prefix + deduped.join('');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default defineConfig({
|
|
40
|
-
api: {
|
|
41
|
-
input: {
|
|
42
|
-
// Replace with your OpenAPI/Swagger schema URL or local file path.
|
|
43
|
-
target: process.env.OPENAPI_TARGET ?? 'http://localhost:8080/v3/api-docs',
|
|
44
|
-
},
|
|
45
|
-
output: {
|
|
46
|
-
mode: 'tags-split',
|
|
47
|
-
target: 'services/generated',
|
|
48
|
-
schemas: 'services/generated/model',
|
|
49
|
-
client: 'react-query',
|
|
50
|
-
httpClient: 'axios',
|
|
51
|
-
baseUrl: process.env.NEXT_PUBLIC_API_BASE_URL,
|
|
52
|
-
override: {
|
|
53
|
-
operationName: buildOperationName,
|
|
54
|
-
mutator: {
|
|
55
|
-
path: 'services/httpClient/orvalMutator.ts',
|
|
56
|
-
name: 'customMutator',
|
|
57
|
-
},
|
|
58
|
-
query: {
|
|
59
|
-
useQuery: true,
|
|
60
|
-
useMutation: true,
|
|
61
|
-
signal: true,
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
});
|
|
1
|
+
import { defineConfig } from 'orval';
|
|
2
|
+
|
|
3
|
+
const SKIP = new Set(['public', 'api', 'v1', 'v2', 'v3']);
|
|
4
|
+
const VERB_PREFIX: Record<string, string> = {
|
|
5
|
+
get: 'get',
|
|
6
|
+
post: 'create',
|
|
7
|
+
put: 'update',
|
|
8
|
+
patch: 'patch',
|
|
9
|
+
delete: 'delete',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Converts path + HTTP verb → semantic camelCase name.
|
|
13
|
+
// GET /users/public/{id}/posts → getUsersByIdPosts
|
|
14
|
+
// POST /public/auth/login → createAuthLogin
|
|
15
|
+
export function buildOperationName(
|
|
16
|
+
_operation: unknown,
|
|
17
|
+
route: string,
|
|
18
|
+
verb: string,
|
|
19
|
+
): string {
|
|
20
|
+
const prefix = VERB_PREFIX[verb] ?? verb;
|
|
21
|
+
const parts = route
|
|
22
|
+
.replace(/\{([^}]+)\}/g, (_, p) =>
|
|
23
|
+
'By' + p.charAt(0).toUpperCase() + p.slice(1),
|
|
24
|
+
)
|
|
25
|
+
.split('/')
|
|
26
|
+
.filter((s) => s && !SKIP.has(s))
|
|
27
|
+
.map((s) =>
|
|
28
|
+
s
|
|
29
|
+
.charAt(0)
|
|
30
|
+
.toUpperCase()
|
|
31
|
+
.concat(s.slice(1))
|
|
32
|
+
.replace(/-([a-z])/g, (_, c) => c.toUpperCase()),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const deduped = parts.filter((p, i) => p !== parts[i - 1]);
|
|
36
|
+
return prefix + deduped.join('');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default defineConfig({
|
|
40
|
+
api: {
|
|
41
|
+
input: {
|
|
42
|
+
// Replace with your OpenAPI/Swagger schema URL or local file path.
|
|
43
|
+
target: process.env.OPENAPI_TARGET ?? 'http://localhost:8080/v3/api-docs',
|
|
44
|
+
},
|
|
45
|
+
output: {
|
|
46
|
+
mode: 'tags-split',
|
|
47
|
+
target: 'services/generated',
|
|
48
|
+
schemas: 'services/generated/model',
|
|
49
|
+
client: 'react-query',
|
|
50
|
+
httpClient: 'axios',
|
|
51
|
+
baseUrl: process.env.NEXT_PUBLIC_API_BASE_URL,
|
|
52
|
+
override: {
|
|
53
|
+
operationName: buildOperationName,
|
|
54
|
+
mutator: {
|
|
55
|
+
path: 'services/httpClient/orvalMutator.ts',
|
|
56
|
+
name: 'customMutator',
|
|
57
|
+
},
|
|
58
|
+
query: {
|
|
59
|
+
useQuery: true,
|
|
60
|
+
useMutation: true,
|
|
61
|
+
signal: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|