@qlover/create-app 0.7.8 → 0.7.10

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 (89) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/dist/index.cjs +3 -3
  3. package/dist/index.js +3 -3
  4. package/dist/templates/next-app/.env.template +8 -4
  5. package/dist/templates/next-app/config/IOCIdentifier.ts +4 -1
  6. package/dist/templates/next-app/config/Identifier/api.ts +20 -0
  7. package/dist/templates/next-app/config/Identifier/index.ts +2 -0
  8. package/dist/templates/next-app/config/Identifier/page.home.ts +7 -0
  9. package/dist/templates/next-app/config/Identifier/page.login.ts +2 -2
  10. package/dist/templates/next-app/config/Identifier/page.register.ts +43 -22
  11. package/dist/templates/next-app/config/Identifier/validator.ts +34 -0
  12. package/dist/templates/next-app/config/i18n/HomeI18n .ts +22 -0
  13. package/dist/templates/next-app/config/i18n/index.ts +1 -0
  14. package/dist/templates/next-app/config/i18n/register18n.ts +44 -0
  15. package/dist/templates/next-app/config/theme.ts +1 -0
  16. package/dist/templates/next-app/migrations/schema/UserSchema.ts +13 -0
  17. package/dist/templates/next-app/migrations/sql/1694244000000.sql +10 -0
  18. package/dist/templates/next-app/package.json +15 -6
  19. package/dist/templates/next-app/public/locales/en.json +17 -2
  20. package/dist/templates/next-app/public/locales/zh.json +17 -2
  21. package/dist/templates/next-app/src/app/[locale]/admin/layout.tsx +21 -0
  22. package/dist/templates/next-app/src/app/[locale]/admin/page.tsx +10 -0
  23. package/dist/templates/next-app/src/app/[locale]/layout.tsx +1 -7
  24. package/dist/templates/next-app/src/app/[locale]/login/LoginForm.tsx +28 -16
  25. package/dist/templates/next-app/src/app/[locale]/login/page.tsx +10 -17
  26. package/dist/templates/next-app/src/app/[locale]/page.tsx +94 -102
  27. package/dist/templates/next-app/src/app/[locale]/register/RegisterForm.tsx +176 -0
  28. package/dist/templates/next-app/src/app/[locale]/register/page.tsx +79 -0
  29. package/dist/templates/next-app/src/app/api/user/login/route.ts +50 -0
  30. package/dist/templates/next-app/src/app/api/user/logout/route.ts +27 -0
  31. package/dist/templates/next-app/src/app/api/user/register/route.ts +50 -0
  32. package/dist/templates/next-app/src/base/cases/AppConfig.ts +19 -0
  33. package/dist/templates/next-app/src/base/cases/DialogErrorPlugin.ts +35 -0
  34. package/dist/templates/next-app/src/base/cases/RequestEncryptPlugin.ts +70 -0
  35. package/dist/templates/next-app/src/base/cases/RouterService.ts +4 -0
  36. package/dist/templates/next-app/src/base/cases/StringEncryptor.ts +67 -0
  37. package/dist/templates/next-app/src/base/cases/UserServiceApi.ts +48 -0
  38. package/dist/templates/next-app/src/base/port/AppApiInterface.ts +14 -0
  39. package/dist/templates/next-app/src/base/port/AppUserApiInterface.ts +15 -0
  40. package/dist/templates/next-app/src/base/port/DBBridgeInterface.ts +18 -0
  41. package/dist/templates/next-app/src/base/port/DBMigrationInterface.ts +92 -0
  42. package/dist/templates/next-app/src/base/port/DBTableInterface.ts +3 -0
  43. package/dist/templates/next-app/src/base/port/I18nServiceInterface.ts +3 -2
  44. package/dist/templates/next-app/src/base/port/MigrationApiInterface.ts +3 -0
  45. package/dist/templates/next-app/src/base/port/ServerApiResponseInterface.ts +6 -0
  46. package/dist/templates/next-app/src/base/port/UserServiceInterface.ts +3 -2
  47. package/dist/templates/next-app/src/base/services/I18nService.ts +9 -45
  48. package/dist/templates/next-app/src/base/services/UserService.ts +9 -8
  49. package/dist/templates/next-app/src/base/services/appApi/AppApiPlugin.ts +63 -0
  50. package/dist/templates/next-app/src/base/services/appApi/AppUserApi.ts +72 -0
  51. package/dist/templates/next-app/src/base/services/appApi/AppUserApiBootstrap.ts +48 -0
  52. package/dist/templates/next-app/src/base/services/appApi/AppUserType.ts +51 -0
  53. package/dist/templates/next-app/src/base/services/migrations/MigrationsApi.ts +43 -0
  54. package/dist/templates/next-app/src/core/bootstraps/BootstrapServer.ts +30 -5
  55. package/dist/templates/next-app/src/core/bootstraps/BootstrapsRegistry.ts +4 -3
  56. package/dist/templates/next-app/src/server/AppErrorApi.ts +10 -0
  57. package/dist/templates/next-app/src/server/AppSuccessApi.ts +7 -0
  58. package/dist/templates/next-app/src/server/PasswordEncrypt.ts +12 -0
  59. package/dist/templates/next-app/src/server/ServerAuth.ts +50 -0
  60. package/dist/templates/next-app/src/server/SupabaseBridge.ts +124 -0
  61. package/dist/templates/next-app/src/server/UserCredentialToken.ts +49 -0
  62. package/dist/templates/next-app/src/server/port/CrentialTokenInterface.ts +5 -0
  63. package/dist/templates/next-app/src/server/port/ServerInterface.ts +22 -0
  64. package/dist/templates/next-app/src/server/port/UserAuthInterface.ts +9 -0
  65. package/dist/templates/next-app/src/server/port/UserRepositoryInterface.ts +15 -0
  66. package/dist/templates/next-app/src/server/port/UserServiceInterface.ts +8 -0
  67. package/dist/templates/next-app/src/server/port/ValidatorInterface.ts +23 -0
  68. package/dist/templates/next-app/src/server/repositorys/UserRepository.ts +63 -0
  69. package/dist/templates/next-app/src/server/services/UserService.ts +105 -0
  70. package/dist/templates/next-app/src/server/validators/LoginValidator.ts +79 -0
  71. package/dist/templates/next-app/src/styles/css/antd-themes/_default.css +12 -0
  72. package/dist/templates/next-app/src/styles/css/antd-themes/dark.css +26 -0
  73. package/dist/templates/next-app/src/styles/css/antd-themes/pink.css +16 -0
  74. package/dist/templates/next-app/src/styles/css/page.css +4 -3
  75. package/dist/templates/next-app/src/styles/css/themes/_default.css +1 -0
  76. package/dist/templates/next-app/src/styles/css/themes/dark.css +1 -0
  77. package/dist/templates/next-app/src/styles/css/themes/pink.css +1 -0
  78. package/dist/templates/next-app/src/uikit/components/BaseHeader.tsx +6 -11
  79. package/dist/templates/next-app/src/uikit/components/BaseLayout.tsx +27 -0
  80. package/dist/templates/next-app/src/uikit/components/BootstrapsProvider.tsx +8 -1
  81. package/dist/templates/next-app/src/uikit/components/LanguageSwitcher.tsx +49 -21
  82. package/dist/templates/next-app/src/uikit/components/LogoutButton.tsx +20 -10
  83. package/dist/templates/next-app/src/uikit/components/ThemeSwitcher.tsx +92 -48
  84. package/dist/templates/next-app/tsconfig.json +3 -1
  85. package/package.json +2 -2
  86. package/dist/templates/next-app/src/base/cases/ServerAuth.ts +0 -17
  87. package/dist/templates/next-app/src/base/port/ServerAuthInterface.ts +0 -3
  88. package/dist/templates/next-app/src/base/port/ServerInterface.ts +0 -12
  89. /package/dist/templates/next-app/src/{app/[locale]/login → uikit/components}/FeatureItem.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,145 @@
1
1
  # @qlover/create-app
2
2
 
3
+ ## 0.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ #### ✨ Features
8
+
9
+ - **next-app:** integrate Supabase for database interactions and enhance configuration ([bd3a557](https://github.com/qlover/fe-base/commit/bd3a557998ae1d77db5a5ff5ea145c067eba0cc8)) ([#510](https://github.com/qlover/fe-base/pull/510))
10
+ - Added Supabase dependencies to package.json for authentication and database management.
11
+ - Introduced DBBridgeInterface for defining database operations and implemented SupabaseBridge for handling database interactions.
12
+ - Updated AppConfig to include Supabase URL and anon key for configuration.
13
+ - Created AdminPage component to demonstrate database bridge usage within the application.
14
+
15
+ These changes aim to enhance the application's data management capabilities and streamline interactions with the Supabase backend.
16
+
17
+ - **next-app:** implement migration system and integrate Supabase for database management ([5732fbf](https://github.com/qlover/fe-base/commit/5732fbfb97960162cddd8d35602d09141e8a805a)) ([#510](https://github.com/qlover/fe-base/pull/510))
18
+ - Added Supabase dependency to package.json for enhanced database interactions.
19
+ - Created migration logs table in a new SQL migration file to track migration history.
20
+ - Developed AdminLayout and AdminMigrationsPage components for managing database migrations.
21
+ - Introduced MigrationExecutor and SupabaseMigration classes to handle migration operations.
22
+ - Updated DBBridgeInterface and added DBMigrationInterface for improved database operation definitions.
23
+
24
+ These changes aim to streamline database management and provide a robust migration system within the application.
25
+
26
+ - **next-app:** enhance user management and database schema ([d2457a8](https://github.com/qlover/fe-base/commit/d2457a82e1c028be3d2da4dd5c163adde19ee778)) ([#510](https://github.com/qlover/fe-base/pull/510))
27
+ - Updated tsconfig.json to include new path mappings for migrations.
28
+ - Added UserSchema interface for defining user attributes in migrations.
29
+ - Created UserRepository and UserService for handling user-related operations, including registration and login.
30
+ - Implemented PasswordEncrypt class for password hashing.
31
+ - Developed API constants for user-related error messages.
32
+ - Refactored SupabaseBridge to support dynamic where conditions in database operations.
33
+ - Introduced new SQL migration for user table creation.
34
+
35
+ These changes aim to improve user management functionality and streamline interactions with the database.
36
+
37
+ - **next-app:** enhance user management and localization support ([f182328](https://github.com/qlover/fe-base/commit/f182328779cf5db569d3d5d43562ca990c59f2de)) ([#510](https://github.com/qlover/fe-base/pull/510))
38
+ - Added `credential_token` field to the `fe_users` table in the SQL migration for improved user authentication.
39
+ - Updated English and Chinese localization files to include new error messages for user-related operations: "User not found" and "User already exists".
40
+ - Refactored the user login API to utilize a new error handling structure, improving response consistency and clarity.
41
+ - Introduced `AppApiResponse` interface for standardized API response handling across the application.
42
+
43
+ These changes aim to strengthen user management features and enhance localization for better user experience.
44
+
45
+ - **next-app:** enhance user service and error handling ([a7627d7](https://github.com/qlover/fe-base/commit/a7627d7c9a73f584b6940f4cd406b4ba55168474)) ([#510](https://github.com/qlover/fe-base/pull/510))
46
+ - Refactored user service to utilize new `UserServiceApi` for improved API interactions.
47
+ - Introduced `AppErrorApi` and `AppSuccessApi` classes for standardized API response handling.
48
+ - Added `DialogErrorPlugin` for enhanced error dialog management in the application.
49
+ - Updated localization files to include new error messages and response handling keys.
50
+ - Improved logging in the `LoginForm` component by integrating a logger service.
51
+
52
+ These changes aim to strengthen user management features, improve error handling, and enhance localization support across the application.
53
+
54
+ - **next-app:** enhance login validation and localization support ([506c42c](https://github.com/qlover/fe-base/commit/506c42c0bc3b4b75b4af168524bfece09eaddfd9)) ([#510](https://github.com/qlover/fe-base/pull/510))
55
+ - Added `zod` for improved validation handling in the login process.
56
+ - Introduced `LoginValidator` class to validate email and password inputs with detailed error messages.
57
+ - Updated localization files to reflect changes in validation messages for both English and Chinese.
58
+ - Enhanced `LoginForm` component to utilize the new validation logic, ensuring better user feedback on input errors.
59
+
60
+ These changes aim to strengthen the login functionality by providing robust validation and clearer user guidance through localization.
61
+
62
+ - **next-app:** implement registration page and enhance localization support ([bc67534](https://github.com/qlover/fe-base/commit/bc67534dd7864172fa0d7b3d447e62d8bef62dae)) ([#510](https://github.com/qlover/fe-base/pull/510))
63
+ - Created a new registration page with a corresponding RegisterForm component for user sign-up.
64
+ - Added localization keys for registration page content, keywords, and features in both English and Chinese.
65
+ - Introduced a new i18n interface for the registration page to manage translations effectively.
66
+ - Updated API routes to handle user registration with improved error handling and response structure.
67
+ - Enhanced the RouterService to support navigation to the login page from the registration form.
68
+
69
+ These changes aim to provide a seamless user experience for account creation and improve localization for better accessibility.
70
+
71
+ - **next-app:** implement password encryption and enhance API error handling ([afb9bdb](https://github.com/qlover/fe-base/commit/afb9bdbc7da975bf10e63a2ac8da3308d74456d4)) ([#510](https://github.com/qlover/fe-base/pull/510))
72
+ - Introduced StringEncryptor for encrypting and decrypting passwords in user login and registration processes.
73
+ - Updated API routes for user login and registration to handle encrypted passwords, improving security.
74
+ - Enhanced error handling in the DialogErrorPlugin to prioritize runtime errors.
75
+ - Added RequestEncryptPlugin to automatically encrypt specified properties in API requests.
76
+ - Updated AppConfig to include a key for the StringEncryptor, ensuring secure configuration.
77
+
78
+ These changes aim to strengthen user authentication security and improve error management across the application.
79
+
80
+ - **next-app:** enhance authentication and user management features ([e67dc6d](https://github.com/qlover/fe-base/commit/e67dc6d05f41c329bbebf26653ea5374529c009c)) ([#510](https://github.com/qlover/fe-base/pull/510))
81
+ - Updated .env.template to include JWT_SECRET for token management.
82
+ - Refactored UserSchema to rename reauthentication_token to credential_token for clarity.
83
+ - Introduced ServerAuth class for managing user authentication and token handling.
84
+ - Enhanced UserService to generate and manage user credential tokens during login and registration.
85
+ - Updated API routes for user login and registration to return user data with credential tokens.
86
+ - Improved error handling and response structure in user-related API interactions.
87
+
88
+ These changes aim to strengthen user authentication processes and improve overall user management within the application.
89
+
90
+ - **next-app:** implement logout functionality and enhance user interface ([7765694](https://github.com/qlover/fe-base/commit/776569462d5488c07dfe13cca6f825cf610bd200)) ([#510](https://github.com/qlover/fe-base/pull/510))
91
+ - Added a new API route for user logout, handling session termination and response management.
92
+ - Refactored UserService to implement the logout method, clearing user credentials and updating the repository.
93
+ - Updated AppUserApi to include a logout method for API interaction.
94
+ - Enhanced the LogoutButton component to trigger the logout process with a confirmation dialog.
95
+ - Modified BaseHeader to conditionally display the logout button based on user authentication state.
96
+
97
+ These changes aim to improve user experience by providing a seamless logout process and enhancing the overall user interface.
98
+
99
+ - **next-app:** enhance server authentication with user credential token integration ([bcb8bdc](https://github.com/qlover/fe-base/commit/bcb8bdc846ffa7c1c6f89f1395f9756241b031b4)) ([#510](https://github.com/qlover/fe-base/pull/510))
100
+ - Updated ServerAuth class to include UserCredentialToken for improved token parsing and validation.
101
+ - Refactored hasAuth method to utilize the new user credential token for authentication checks.
102
+ - Minor adjustments in UserCredentialToken file for consistency and clarity.
103
+
104
+ These changes aim to strengthen the authentication process by ensuring more reliable token management and validation.
105
+
106
+ #### ♻️ Refactors
107
+
108
+ - **bootstraps:** remove unused StringEncryptor import from BootstrapsRegistry.ts ([d7000ea](https://github.com/qlover/fe-base/commit/d7000ea93a5c7cc53a2ccb244424b41ba3ce6fb5)) ([#510](https://github.com/qlover/fe-base/pull/510))
109
+ - Eliminated the import of StringEncryptor as it is no longer utilized in the BootstrapsRegistry file.
110
+
111
+ This change aims to clean up the code by removing unnecessary dependencies, improving maintainability.
112
+
113
+ ## 0.7.9
114
+
115
+ ### Patch Changes
116
+
117
+ #### ✨ Features
118
+
119
+ - **next-app:** enhance home page internationalization and SEO support ([54d7714](https://github.com/qlover/fe-base/commit/54d77146f26ce132ddd20edace52a1a10eb03149)) ([#508](https://github.com/qlover/fe-base/pull/508))
120
+ - Added PAGE_HOME_KEYWORDS constant to improve SEO with relevant keywords for the home page.
121
+ - Created HomeI18nInterface to manage internationalization for the home page, incorporating keywords and welcome messages.
122
+ - Updated English and Chinese localization files to include new keywords for the home page, enhancing multilingual support.
123
+ - Refactored Home component to utilize the new i18n structure for better localization handling.
124
+
125
+ These changes aim to improve the user experience by providing comprehensive localization and SEO enhancements for the home page.
126
+
127
+ - **next-app:** enhance login components and improve styling consistency ([59b8b85](https://github.com/qlover/fe-base/commit/59b8b85179e78f29f1eca5b8e7e375b6b8c660eb)) ([#508](https://github.com/qlover/fe-base/pull/508))
128
+ - Updated LoginForm component to use new border color variable for improved styling consistency.
129
+ - Simplified LocaleLink components in LoginForm for cleaner code and better readability.
130
+ - Refactored LoginPage to remove unnecessary elements, streamlining the layout.
131
+ - Enhanced CSS variables in page.css for better color management across the application.
132
+
133
+ These changes aim to improve the user interface and maintain a consistent design across the login components.
134
+
135
+ - **next-app:** update scripts, enhance theme support, and improve styling ([aebcdfa](https://github.com/qlover/fe-base/commit/aebcdfaeb5bae706ac96dc410056f3064eb1e8e9)) ([#508](https://github.com/qlover/fe-base/pull/508))
136
+ - Updated package.json scripts to specify ports for development and production environments.
137
+ - Added new CSS variables for hover states and improved theme management in various CSS files.
138
+ - Enhanced the LanguageSwitcher and ThemeSwitcher components to utilize dropdowns for better user experience.
139
+ - Refactored BaseLayout to include a background color for the main content area.
140
+
141
+ These changes aim to improve the application's usability and maintainability by enhancing the theme management and user interface components.
142
+
3
143
  ## 0.7.8
4
144
 
5
145
  ### Patch Changes