generator-kodly-react-app 1.0.15 → 1.0.16

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 (90) hide show
  1. package/generators/app/index.js +4 -0
  2. package/generators/app/templates/I18N_MIGRATION.md +13 -13
  3. package/generators/app/templates/STRUCTURE.md +26 -26
  4. package/generators/app/templates/index.html +6 -14
  5. package/generators/app/templates/openapi-ts.config.ts +12 -12
  6. package/generators/app/templates/postcss.config.js +0 -1
  7. package/generators/app/templates/src/app.tsx +20 -20
  8. package/generators/app/templates/src/components/layout/language-switcher.tsx +20 -16
  9. package/generators/app/templates/src/components/layout/page-layout.tsx +31 -0
  10. package/generators/app/templates/src/components/layout/theme-switcher.tsx +15 -14
  11. package/generators/app/templates/src/components/theme/theme-provider.tsx +20 -13
  12. package/generators/app/templates/src/components/ui/button.tsx +15 -14
  13. package/generators/app/templates/src/components/ui/card.tsx +23 -16
  14. package/generators/app/templates/src/components/ui/field.tsx +35 -35
  15. package/generators/app/templates/src/components/ui/form.tsx +66 -30
  16. package/generators/app/templates/src/components/ui/input-group.tsx +24 -24
  17. package/generators/app/templates/src/components/ui/input.tsx +8 -8
  18. package/generators/app/templates/src/components/ui/label.tsx +9 -9
  19. package/generators/app/templates/src/components/ui/select.tsx +0 -1
  20. package/generators/app/templates/src/components/ui/separator.tsx +10 -10
  21. package/generators/app/templates/src/components/ui/textarea.tsx +7 -7
  22. package/generators/app/templates/src/index.css +12 -2
  23. package/generators/app/templates/src/lib/i18n.ts +16 -14
  24. package/generators/app/templates/src/lib/routes.ts +2 -3
  25. package/generators/app/templates/src/lib/utils/error-handler.ts +21 -14
  26. package/generators/app/templates/src/lib/utils.ts +3 -3
  27. package/generators/app/templates/src/locales/index.ts +12 -12
  28. package/generators/app/templates/src/locales/ja/theme.json +0 -1
  29. package/generators/app/templates/src/main.tsx +10 -12
  30. package/generators/app/templates/src/modules/app/layouts/app-layout.tsx +14 -25
  31. package/generators/app/templates/src/modules/app/locales/app-en.json +0 -1
  32. package/generators/app/templates/src/modules/app/locales/app-ja.json +0 -1
  33. package/generators/app/templates/src/modules/auth/components/auth-form.tsx +83 -0
  34. package/generators/app/templates/src/modules/auth/components/forgot-password-form.tsx +27 -52
  35. package/generators/app/templates/src/modules/auth/components/login-form.tsx +42 -72
  36. package/generators/app/templates/src/modules/auth/components/login-link.tsx +12 -0
  37. package/generators/app/templates/src/modules/auth/components/reset-password-form.tsx +46 -92
  38. package/generators/app/templates/src/modules/auth/components/signup-form.tsx +35 -71
  39. package/generators/app/templates/src/modules/auth/contexts/auth-context.tsx +10 -6
  40. package/generators/app/templates/src/modules/auth/hooks/use-auth-hook.ts +51 -36
  41. package/generators/app/templates/src/modules/auth/layouts/auth-layout.tsx +12 -15
  42. package/generators/app/templates/src/modules/auth/locales/auth-en.json +0 -1
  43. package/generators/app/templates/src/modules/auth/locales/auth-ja.json +0 -1
  44. package/generators/app/templates/src/modules/auth/schemas/form-schemas.ts +14 -10
  45. package/generators/app/templates/src/modules/landing/components/auth-hero.tsx +20 -18
  46. package/generators/app/templates/src/modules/landing/components/welcome-hero.tsx +13 -11
  47. package/generators/app/templates/src/modules/landing/landing-page-layout.tsx +1 -24
  48. package/generators/app/templates/src/modules/landing/landing-page.tsx +11 -6
  49. package/generators/app/templates/src/modules/landing/layouts/landing-page-layout.tsx +2 -21
  50. package/generators/app/templates/src/modules/landing/locales/landing-en.json +0 -1
  51. package/generators/app/templates/src/openapi-client-config.ts +1 -1
  52. package/generators/app/templates/src/routeTree.gen.ts +188 -188
  53. package/generators/app/templates/src/router.tsx +2 -2
  54. package/generators/app/templates/src/routes/$.tsx +0 -1
  55. package/generators/app/templates/src/routes/__root.tsx +2 -2
  56. package/generators/app/templates/src/routes/_landing/index.tsx +3 -3
  57. package/generators/app/templates/src/routes/_landing/route.tsx +3 -3
  58. package/generators/app/templates/src/routes/app/index.tsx +6 -6
  59. package/generators/app/templates/src/routes/app/route.tsx +4 -4
  60. package/generators/app/templates/src/routes/auth/forgot-password.tsx +1 -1
  61. package/generators/app/templates/src/routes/auth/login.tsx +3 -3
  62. package/generators/app/templates/src/routes/auth/reset-password.tsx +3 -3
  63. package/generators/app/templates/src/routes/auth/route.tsx +12 -7
  64. package/generators/app/templates/src/routes/auth/signup.tsx +1 -2
  65. package/generators/app/templates/src/sdk/@tanstack/react-query.gen.ts +157 -76
  66. package/generators/app/templates/src/sdk/client/client.gen.ts +35 -37
  67. package/generators/app/templates/src/sdk/client/index.ts +8 -8
  68. package/generators/app/templates/src/sdk/client/types.gen.ts +22 -19
  69. package/generators/app/templates/src/sdk/client/utils.gen.ts +53 -45
  70. package/generators/app/templates/src/sdk/client.gen.ts +18 -5
  71. package/generators/app/templates/src/sdk/core/auth.gen.ts +6 -6
  72. package/generators/app/templates/src/sdk/core/bodySerializer.gen.ts +25 -27
  73. package/generators/app/templates/src/sdk/core/params.gen.ts +12 -12
  74. package/generators/app/templates/src/sdk/core/pathSerializer.gen.ts +40 -41
  75. package/generators/app/templates/src/sdk/core/queryKeySerializer.gen.ts +12 -29
  76. package/generators/app/templates/src/sdk/core/serverSentEvents.gen.ts +26 -24
  77. package/generators/app/templates/src/sdk/core/types.gen.ts +17 -15
  78. package/generators/app/templates/src/sdk/core/utils.gen.ts +18 -18
  79. package/generators/app/templates/src/sdk/index.ts +40 -2
  80. package/generators/app/templates/src/sdk/schemas.gen.ts +108 -166
  81. package/generators/app/templates/src/sdk/sdk.gen.ts +145 -63
  82. package/generators/app/templates/src/sdk/types.gen.ts +90 -84
  83. package/generators/app/templates/src/sdk/zod.gen.ts +57 -74
  84. package/generators/app/templates/src/types/i18n.d.ts +0 -1
  85. package/generators/app/templates/tailwind.config.js +0 -1
  86. package/generators/app/templates/tsconfig.app.json +0 -1
  87. package/generators/app/templates/tsconfig.json +0 -1
  88. package/generators/app/templates/tsr.config.json +4 -0
  89. package/generators/app/templates/vite.config.js +12 -12
  90. package/package.json +2 -4
@@ -1,28 +1,25 @@
1
- import { LanguageSwitcher } from '@/components/layout/language-switcher';
2
- import { ThemeSwitcher } from '@/components/layout/theme-switcher';
3
- import { Button } from '@/components/ui/button';
4
- import { Home } from 'lucide-react';
5
- import { Link } from '@tanstack/react-router';
6
- import { DEFAULT_NON_LOGGED_IN_ROUTE } from '@/lib/routes';
1
+ import { LanguageSwitcher } from "@/components/layout/language-switcher";
2
+ import { ThemeSwitcher } from "@/components/layout/theme-switcher";
3
+ import { Button } from "@/components/ui/button";
4
+ import { Home } from "lucide-react";
5
+ import { Link } from "@tanstack/react-router";
6
+ import { DEFAULT_NON_LOGGED_IN_ROUTE } from "@/lib/routes";
7
7
 
8
8
  export function AuthLayout({ children }: { children: React.ReactNode }) {
9
9
  return (
10
- <div className='flex h-screen items-center justify-center bg-background relative'>
11
- <div className='absolute top-4 left-4'>
10
+ <div className="flex h-screen items-center justify-center bg-background relative">
11
+ <div className="absolute top-4 left-4">
12
12
  <Link to={DEFAULT_NON_LOGGED_IN_ROUTE}>
13
- <Button
14
- variant='outline'
15
- size='icon'
16
- aria-label='Go to home'>
17
- <Home className='h-4 w-4' />
13
+ <Button variant="outline" size="icon" aria-label="Go to home">
14
+ <Home className="h-4 w-4" />
18
15
  </Button>
19
16
  </Link>
20
17
  </div>
21
- <div className='absolute top-4 right-4 flex gap-2'>
18
+ <div className="absolute top-4 right-4 flex gap-2">
22
19
  <ThemeSwitcher />
23
20
  <LanguageSwitcher />
24
21
  </div>
25
- <div className='w-full max-w-md p-8'>{children}</div>
22
+ <div className="w-full max-w-md p-8">{children}</div>
26
23
  </div>
27
24
  );
28
25
  }
@@ -102,4 +102,3 @@
102
102
  "passwordResetFailed": "Failed to reset password"
103
103
  }
104
104
  }
105
-
@@ -102,4 +102,3 @@
102
102
  "passwordResetFailed": "パスワードのリセットに失敗しました"
103
103
  }
104
104
  }
105
-
@@ -1,26 +1,30 @@
1
- import type { z } from 'zod';
2
- import { zUserLoginDto, zUserSignupDto, zUserResetPasswordDto } from '@/sdk/zod.gen';
1
+ import type { z } from "zod";
2
+ import {
3
+ zUserLoginDto,
4
+ zUserSignupDto,
5
+ zUserResetPasswordDto,
6
+ } from "@/sdk/zod.gen";
3
7
 
4
8
  type LoginFormData = z.infer<typeof zUserLoginDto>;
5
9
  type SignupFormData = z.infer<typeof zUserSignupDto>;
6
10
  type ResetPasswordFormData = z.infer<typeof zUserResetPasswordDto>;
7
11
 
8
12
  export const loginFormDefaults: LoginFormData = {
9
- email: '',
10
- password: '',
13
+ email: "",
14
+ password: "",
11
15
  };
12
16
 
13
17
  export const signupFormDefaults: SignupFormData = {
14
- email: '',
15
- password: '',
18
+ email: "",
19
+ password: "",
16
20
  };
17
21
 
18
22
  export const forgotPasswordFormDefaults = {
19
- email: '',
23
+ email: "",
20
24
  };
21
25
 
22
26
  export const resetPasswordFormDefaults: ResetPasswordFormData = {
23
- email: '',
24
- password: '',
25
- otp: '',
27
+ email: "",
28
+ password: "",
29
+ otp: "",
26
30
  };
@@ -1,34 +1,36 @@
1
- import { Link } from '@tanstack/react-router';
2
- import { Button } from '@/components/ui/button';
3
- import { useTranslation } from 'react-i18next';
4
- import { Route as LoginRoute } from '@/routes/auth/login';
5
- import { Route as SignupRoute } from '@/routes/auth/signup';
1
+ import { Link } from "@tanstack/react-router";
2
+ import { Button } from "@/components/ui/button";
3
+ import { useTranslation } from "react-i18next";
4
+ import { Route as LoginRoute } from "@/routes/auth/login";
5
+ import { Route as SignupRoute } from "@/routes/auth/signup";
6
6
 
7
7
  export function AuthHero() {
8
- const { t } = useTranslation('landing');
8
+ const { t } = useTranslation("landing");
9
9
 
10
10
  return (
11
11
  <>
12
- <h1 className='text-4xl md:text-5xl lg:text-6xl font-bold mb-6'>{t('hero.title')}</h1>
13
- <p className='text-xl md:text-2xl text-muted-foreground mb-12 max-w-2xl mx-auto'>{t('hero.description')}</p>
14
- <div className='flex flex-col sm:flex-row gap-4 justify-center items-center'>
12
+ <h1 className="text-4xl md:text-5xl lg:text-6xl font-bold mb-6">
13
+ {t("hero.title")}
14
+ </h1>
15
+ <p className="text-xl md:text-2xl text-muted-foreground mb-12 max-w-2xl mx-auto">
16
+ {t("hero.description")}
17
+ </p>
18
+ <div className="flex flex-col sm:flex-row gap-4 justify-center items-center">
15
19
  <Link to={LoginRoute.to}>
16
- <Button
17
- size='lg'
18
- className='w-full sm:w-auto min-w-[150px]'>
19
- {t('hero.loginButton')}
20
+ <Button size="lg" className="w-full sm:w-auto min-w-[150px]">
21
+ {t("hero.loginButton")}
20
22
  </Button>
21
23
  </Link>
22
24
  <Link to={SignupRoute.to}>
23
25
  <Button
24
- size='lg'
25
- variant='outline'
26
- className='w-full sm:w-auto min-w-[150px]'>
27
- {t('hero.signupButton')}
26
+ size="lg"
27
+ variant="outline"
28
+ className="w-full sm:w-auto min-w-[150px]"
29
+ >
30
+ {t("hero.signupButton")}
28
31
  </Button>
29
32
  </Link>
30
33
  </div>
31
34
  </>
32
35
  );
33
36
  }
34
-
@@ -1,21 +1,23 @@
1
- import { Link } from '@tanstack/react-router';
2
- import { Button } from '@/components/ui/button';
3
- import { useTranslation } from 'react-i18next';
4
- import { DEFAULT_LOGGED_IN_ROUTE } from '@/lib/routes';
1
+ import { Link } from "@tanstack/react-router";
2
+ import { Button } from "@/components/ui/button";
3
+ import { useTranslation } from "react-i18next";
4
+ import { DEFAULT_LOGGED_IN_ROUTE } from "@/lib/routes";
5
5
 
6
6
  export function WelcomeHero() {
7
7
  const { t } = useTranslation();
8
8
 
9
9
  return (
10
10
  <>
11
- <h1 className='text-4xl md:text-5xl lg:text-6xl font-bold mb-6'>{t('landing.hero.welcomeTitle')}</h1>
12
- <p className='text-xl md:text-2xl text-muted-foreground mb-12 max-w-2xl mx-auto'>{t('landing.hero.welcomeDescription')}</p>
13
- <div className='flex justify-center items-center'>
11
+ <h1 className="text-4xl md:text-5xl lg:text-6xl font-bold mb-6">
12
+ {t("landing.hero.welcomeTitle")}
13
+ </h1>
14
+ <p className="text-xl md:text-2xl text-muted-foreground mb-12 max-w-2xl mx-auto">
15
+ {t("landing.hero.welcomeDescription")}
16
+ </p>
17
+ <div className="flex justify-center items-center">
14
18
  <Link to={DEFAULT_LOGGED_IN_ROUTE}>
15
- <Button
16
- size='lg'
17
- className='w-full sm:w-auto min-w-[150px]'>
18
- {t('landing.hero.getStartedButton')}
19
+ <Button size="lg" className="w-full sm:w-auto min-w-[150px]">
20
+ {t("landing.hero.getStartedButton")}
19
21
  </Button>
20
22
  </Link>
21
23
  </div>
@@ -1,24 +1 @@
1
- import { LanguageSwitcher } from '@/components/layout/language-switcher';
2
- import { ThemeSwitcher } from '@/components/layout/theme-switcher';
3
- import { useTranslation } from 'react-i18next';
4
-
5
- export function LandingPageLayout({ children }: { children: React.ReactNode }) {
6
- const { t } = useTranslation();
7
-
8
- return (
9
- <div className='min-h-screen bg-background'>
10
- <header className='border-b'>
11
- <div className='container mx-auto flex h-16 items-center justify-between px-4'>
12
- <div className='flex items-center gap-4'>
13
- <h1 className='text-xl font-semibold'>{t('app.title')}</h1>
14
- </div>
15
- <div className='flex items-center gap-4'>
16
- <ThemeSwitcher />
17
- <LanguageSwitcher />
18
- </div>
19
- </div>
20
- </header>
21
- <main>{children}</main>
22
- </div>
23
- );
24
- }
1
+ export { LandingPageLayout } from "./layouts/landing-page-layout";
@@ -1,7 +1,10 @@
1
- import { useAtomValue } from 'jotai';
2
- import { authTokenAtom, currentUserDetailsAtom } from '@/modules/auth/hooks/use-auth-hook';
3
- import { WelcomeHero } from './components/welcome-hero';
4
- import { AuthHero } from './components/auth-hero';
1
+ import { useAtomValue } from "jotai";
2
+ import {
3
+ authTokenAtom,
4
+ currentUserDetailsAtom,
5
+ } from "@/modules/auth/hooks/use-auth-hook";
6
+ import { WelcomeHero } from "./components/welcome-hero";
7
+ import { AuthHero } from "./components/auth-hero";
5
8
 
6
9
  export function LandingPage() {
7
10
  const token = useAtomValue(authTokenAtom);
@@ -10,8 +13,10 @@ export function LandingPage() {
10
13
  const isAuthenticated = token && userData;
11
14
 
12
15
  return (
13
- <div className='container mx-auto px-4 py-16'>
14
- <div className='max-w-4xl mx-auto text-center'>{isAuthenticated ? <WelcomeHero /> : <AuthHero />}</div>
16
+ <div className="container mx-auto px-4 py-16">
17
+ <div className="max-w-4xl mx-auto text-center">
18
+ {isAuthenticated ? <WelcomeHero /> : <AuthHero />}
19
+ </div>
15
20
  </div>
16
21
  );
17
22
  }
@@ -1,24 +1,5 @@
1
- import { LanguageSwitcher } from '@/components/layout/language-switcher';
2
- import { ThemeSwitcher } from '@/components/layout/theme-switcher';
3
- import { useTranslation } from 'react-i18next';
1
+ import { PageLayout } from "@/components/layout/page-layout";
4
2
 
5
3
  export function LandingPageLayout({ children }: { children: React.ReactNode }) {
6
- const { t } = useTranslation();
7
-
8
- return (
9
- <div className='min-h-screen bg-background'>
10
- <header className='border-b'>
11
- <div className='container mx-auto flex h-16 items-center justify-between px-4'>
12
- <div className='flex items-center gap-4'>
13
- <h1 className='text-xl font-semibold'>{t('app.title')}</h1>
14
- </div>
15
- <div className='flex items-center gap-4'>
16
- <ThemeSwitcher />
17
- <LanguageSwitcher />
18
- </div>
19
- </div>
20
- </header>
21
- <main>{children}</main>
22
- </div>
23
- );
4
+ return <PageLayout>{children}</PageLayout>;
24
5
  }
@@ -9,4 +9,3 @@
9
9
  "getStartedButton": "Get Started"
10
10
  }
11
11
  }
12
-
@@ -1,4 +1,4 @@
1
- import type { CreateClientConfig } from '@/sdk/client.gen';
1
+ import type { CreateClientConfig } from "@/sdk/client.gen";
2
2
 
3
3
  export const createClientConfig: CreateClientConfig = (config) => ({
4
4
  ...config,