@qlover/create-app 0.7.10 → 0.7.12

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 (92) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/index.cjs +6 -6
  3. package/dist/index.js +6 -6
  4. package/dist/templates/next-app/config/Identifier/api.ts +14 -0
  5. package/dist/templates/next-app/config/Identifier/common.ts +7 -0
  6. package/dist/templates/next-app/eslint.config.mjs +17 -0
  7. package/dist/templates/next-app/migrations/schema/UserSchema.ts +21 -10
  8. package/dist/templates/next-app/next.config.ts +1 -0
  9. package/dist/templates/next-app/package.json +1 -0
  10. package/dist/templates/next-app/public/locales/en.json +4 -1
  11. package/dist/templates/next-app/public/locales/zh.json +4 -1
  12. package/dist/templates/next-app/src/app/[locale]/admin/layout.tsx +4 -7
  13. package/dist/templates/next-app/src/app/[locale]/admin/page.tsx +16 -4
  14. package/dist/templates/next-app/src/app/[locale]/admin/users/page.tsx +62 -0
  15. package/dist/templates/next-app/src/app/[locale]/layout.tsx +1 -1
  16. package/dist/templates/next-app/src/app/[locale]/login/LoginForm.tsx +1 -1
  17. package/dist/templates/next-app/src/app/[locale]/login/page.tsx +1 -1
  18. package/dist/templates/next-app/src/app/[locale]/page.tsx +3 -3
  19. package/dist/templates/next-app/src/app/[locale]/register/RegisterForm.tsx +1 -1
  20. package/dist/templates/next-app/src/app/[locale]/register/page.tsx +1 -1
  21. package/dist/templates/next-app/src/app/api/admin/users/route.ts +39 -0
  22. package/dist/templates/next-app/src/base/cases/AdminPageManager.ts +40 -0
  23. package/dist/templates/next-app/src/base/cases/AppConfig.ts +1 -1
  24. package/dist/templates/next-app/src/base/cases/DialogErrorPlugin.ts +13 -2
  25. package/dist/templates/next-app/src/base/cases/PageParams.ts +1 -1
  26. package/dist/templates/next-app/src/base/cases/RequestState.ts +20 -0
  27. package/dist/templates/next-app/src/base/cases/UserServiceApi.ts +1 -1
  28. package/dist/templates/next-app/src/base/port/AdminLayoutInterface.ts +26 -0
  29. package/dist/templates/next-app/src/base/port/AdminPageInterface.ts +87 -0
  30. package/dist/templates/next-app/src/base/port/AppApiInterface.ts +1 -1
  31. package/dist/templates/next-app/src/base/port/AppUserApiInterface.ts +4 -4
  32. package/dist/templates/next-app/src/base/port/AsyncStateInterface.ts +7 -0
  33. package/dist/templates/next-app/src/base/port/DBBridgeInterface.ts +3 -0
  34. package/dist/templates/next-app/src/base/port/PaginationInterface.ts +6 -0
  35. package/dist/templates/next-app/src/base/services/AdminUserService.ts +45 -0
  36. package/dist/templates/next-app/src/base/services/UserService.ts +1 -1
  37. package/dist/templates/next-app/src/base/services/adminApi/AdminApiRequester.ts +21 -0
  38. package/dist/templates/next-app/src/base/services/adminApi/AdminUserApi.ts +34 -0
  39. package/dist/templates/next-app/src/base/services/appApi/AppApiPlugin.ts +2 -2
  40. package/dist/templates/next-app/src/base/services/appApi/AppApiRequester.ts +56 -0
  41. package/dist/templates/next-app/src/base/services/appApi/AppUserApi.ts +30 -31
  42. package/dist/templates/next-app/src/base/services/appApi/AppUserApiBootstrap.ts +5 -4
  43. package/dist/templates/next-app/src/core/bootstraps/BootstrapClient.ts +1 -1
  44. package/dist/templates/next-app/src/core/bootstraps/BootstrapServer.ts +3 -14
  45. package/dist/templates/next-app/src/core/bootstraps/BootstrapsRegistry.ts +2 -2
  46. package/dist/templates/next-app/src/core/bootstraps/PrintBootstrap.ts +1 -1
  47. package/dist/templates/next-app/src/core/clientIoc/ClientIOC.ts +1 -1
  48. package/dist/templates/next-app/src/core/clientIoc/ClientIOCRegister.ts +1 -1
  49. package/dist/templates/next-app/src/core/globals.ts +1 -1
  50. package/dist/templates/next-app/src/core/serverIoc/ServerIOC.ts +1 -1
  51. package/dist/templates/next-app/src/core/serverIoc/ServerIOCRegister.ts +1 -1
  52. package/dist/templates/next-app/src/server/ServerAuth.ts +13 -3
  53. package/dist/templates/next-app/src/server/SupabaseBridge.ts +37 -2
  54. package/dist/templates/next-app/src/server/UserCredentialToken.ts +1 -1
  55. package/dist/templates/next-app/src/server/port/DBTableInterface.ts +10 -0
  56. package/dist/templates/next-app/src/server/port/{UserAuthInterface.ts → ServerAuthInterface.ts} +3 -1
  57. package/dist/templates/next-app/src/server/port/UserRepositoryInterface.ts +1 -1
  58. package/dist/templates/next-app/src/server/repositorys/UserRepository.ts +32 -1
  59. package/dist/templates/next-app/src/server/services/AdminAuthPlugin.ts +19 -0
  60. package/dist/templates/next-app/src/server/services/ApiUserService.ts +26 -0
  61. package/dist/templates/next-app/src/server/services/UserService.ts +3 -3
  62. package/dist/templates/next-app/src/server/validators/PaginationValidator.ts +48 -0
  63. package/dist/templates/next-app/src/styles/css/antd-themes/{_default.css → _common/_default.css} +74 -1
  64. package/dist/templates/next-app/src/styles/css/antd-themes/{dark.css → _common/dark.css} +73 -0
  65. package/dist/templates/next-app/src/styles/css/antd-themes/_common/index.css +3 -0
  66. package/dist/templates/next-app/src/styles/css/antd-themes/{pink.css → _common/pink.css} +70 -0
  67. package/dist/templates/next-app/src/styles/css/antd-themes/index.css +4 -3
  68. package/dist/templates/next-app/src/styles/css/antd-themes/menu/_default.css +108 -0
  69. package/dist/templates/next-app/src/styles/css/antd-themes/menu/dark.css +67 -0
  70. package/dist/templates/next-app/src/styles/css/antd-themes/menu/index.css +3 -0
  71. package/dist/templates/next-app/src/styles/css/antd-themes/menu/pink.css +67 -0
  72. package/dist/templates/next-app/src/styles/css/antd-themes/pagination/_default.css +33 -0
  73. package/dist/templates/next-app/src/styles/css/antd-themes/pagination/dark.css +32 -0
  74. package/dist/templates/next-app/src/styles/css/antd-themes/pagination/index.css +3 -0
  75. package/dist/templates/next-app/src/styles/css/antd-themes/pagination/pink.css +35 -0
  76. package/dist/templates/next-app/src/styles/css/antd-themes/table/_default.css +44 -0
  77. package/dist/templates/next-app/src/styles/css/antd-themes/table/dark.css +43 -0
  78. package/dist/templates/next-app/src/styles/css/antd-themes/table/index.css +3 -0
  79. package/dist/templates/next-app/src/styles/css/antd-themes/table/pink.css +43 -0
  80. package/dist/templates/next-app/src/uikit/components/AdminLayout.tsx +106 -0
  81. package/dist/templates/next-app/src/uikit/components/BaseHeader.tsx +68 -17
  82. package/dist/templates/next-app/src/uikit/components/BaseLayout.tsx +6 -1
  83. package/dist/templates/next-app/src/uikit/components/BootstrapsProvider.tsx +1 -1
  84. package/dist/templates/next-app/src/uikit/components/ComboProvider.tsx +11 -3
  85. package/dist/templates/next-app/src/uikit/components/LanguageSwitcher.tsx +1 -1
  86. package/dist/templates/next-app/src/uikit/components/LogoutButton.tsx +1 -1
  87. package/dist/templates/next-app/src/uikit/hook/useIOC.ts +1 -1
  88. package/dist/templates/next-app/src/uikit/hook/useMountedClient.ts +7 -1
  89. package/package.json +1 -1
  90. package/dist/templates/next-app/src/base/cases/ServerErrorHandler.ts +0 -27
  91. package/dist/templates/next-app/src/base/port/DBTableInterface.ts +0 -3
  92. package/dist/templates/next-app/src/base/services/appApi/AppUserType.ts +0 -51
package/CHANGELOG.md CHANGED
@@ -1,5 +1,93 @@
1
1
  # @qlover/create-app
2
2
 
3
+ ## 0.7.12
4
+
5
+ ### Patch Changes
6
+
7
+ #### ♻️ Refactors
8
+
9
+ - **create-app:** structure and update entry points ([ea404c7](https://github.com/qlover/fe-base/commit/ea404c74fdea09a3122a10e0e0c649cfc5510b97)) ([#514](https://github.com/qlover/fe-base/pull/514))
10
+ - Changed the entry point in tsup.config.ts from 'src/index.ts' to 'src/index.mts' for better module support.
11
+ - Introduced a new CLI interface in src/cli.ts to handle command-line arguments and application logic.
12
+ - Created a new entry file src/index.mts that imports and executes the main function from the CLI, enhancing modularity and clarity.
13
+ - Removed the old main function from src/index.ts, streamlining the codebase and improving maintainability.
14
+
15
+ These changes aim to improve the application's structure and facilitate better command-line interactions.
16
+
17
+ ## 0.7.11
18
+
19
+ ### Patch Changes
20
+
21
+ #### ✨ Features
22
+
23
+ - **next-app:** enhance admin layout and localization support ([35badca](https://github.com/qlover/fe-base/commit/35badcacbe2aec0af4b91641b89ac621456e2ee7)) ([#512](https://github.com/qlover/fe-base/pull/512))
24
+ - Introduced AdminLayout component for improved admin page structure and navigation.
25
+ - Added PAGE_HEAD_ADMIN_TITLE constant for localization of the admin page title in English and Chinese.
26
+ - Updated localization files to include new keys for the admin page title.
27
+ - Refactored AdminPage component to simplify its structure and enhance readability.
28
+ - Created AdminPageManager for managing admin page state, including sidebar collapse functionality.
29
+
30
+ These changes aim to improve the user experience in the admin section by providing a structured layout and better localization support.
31
+
32
+ - **next-app:** enhance user management and API integration ([2123e76](https://github.com/qlover/fe-base/commit/2123e76cc856c145e8f5a3772e3ac150fb617ed7)) ([#512](https://github.com/qlover/fe-base/pull/512))
33
+ - Added new API constants for user-related error messages, including not authorized and page number invalid.
34
+ - Introduced UserRoleType for better role management in the UserSchema.
35
+ - Created UsersPage component for admin user management, integrating AdminUserService for user initialization.
36
+ - Implemented pagination support in UserRepository and ApiUserService for user data retrieval.
37
+ - Developed AdminAuthPlugin for server-side authentication checks before executing requests.
38
+
39
+ These changes aim to improve user management functionality, enhance API interactions, and streamline the admin interface for better usability.
40
+
41
+ - **next-app:** enhance admin user management and layout features ([e9f8a20](https://github.com/qlover/fe-base/commit/e9f8a203ef1078724e9774d3eb32b5daf0a99a79)) ([#512](https://github.com/qlover/fe-base/pull/512))
42
+ - Updated UsersPage component to include loading state and improved user interface with a spinner.
43
+ - Enhanced BaseLayout to conditionally display an admin button for better navigation.
44
+ - Refactored AdminPageManager to initialize navigation items for the admin layout.
45
+ - Introduced AdminApiRequester for streamlined API requests related to admin functionalities.
46
+ - Updated AdminUserService to utilize new API structure for fetching user data.
47
+
48
+ These changes aim to improve the user experience in the admin section by providing better loading indicators and navigation options, while also enhancing the underlying API interactions.
49
+
50
+ - **next-app:** improve admin user service and component structure ([c9c31d8](https://github.com/qlover/fe-base/commit/c9c31d8a96323057ff33b43fa47c433c07dcfa81)) ([#512](https://github.com/qlover/fe-base/pull/512))
51
+ - Refactored UsersPage component to streamline user initialization logic.
52
+ - Enhanced AdminUserService to manage loading states and error handling during user data fetching.
53
+ - Updated AdminUserApi to return a more structured response for user list requests.
54
+ - Introduced safeFields in UserRepository for better data handling during pagination.
55
+ - Added useMountedClient hook to ensure components render only after client initialization.
56
+
57
+ These changes aim to enhance the user management experience in the admin section by improving data handling, error management, and component rendering logic.
58
+
59
+ - **next-app:** enhance ESLint configuration and user schema validation ([c00639f](https://github.com/qlover/fe-base/commit/c00639f470caf6480e34b41bd912faa76c3356c7)) ([#512](https://github.com/qlover/fe-base/pull/512))
60
+ - Added TypeScript resolver settings to ESLint configuration for improved module resolution.
61
+ - Introduced new import patterns for migrations and configuration in ESLint rules.
62
+ - Refactored UserSchema to utilize Zod for validation, enhancing type safety and data integrity.
63
+ - Updated UsersPage component to integrate the new user schema and improve data handling.
64
+ - Enhanced pagination and table components with new CSS variables for better theming support.
65
+
66
+ These changes aim to improve code quality, validation processes, and user interface consistency in the admin section.
67
+
68
+ - **next-app:** enhance Ant Design theme support with menu styles ([1431f73](https://github.com/qlover/fe-base/commit/1431f73ea98ec97254b553b56dde9896623dbc79)) ([#512](https://github.com/qlover/fe-base/pull/512))
69
+ - Added new CSS variables for Ant Design layout components in common theme files.
70
+ - Introduced menu styles for default, dark, and pink themes, enhancing customization options.
71
+ - Updated AdminLayout component to utilize the new menu styles, improving the overall UI consistency.
72
+
73
+ These changes aim to provide a more cohesive theming experience across the application, particularly for the menu component.
74
+
75
+ - **next-app:** refactor imports and enhance component structure ([61539d3](https://github.com/qlover/fe-base/commit/61539d348595e04a8b8cafa5d8ec7cf25d8cdd32)) ([#512](https://github.com/qlover/fe-base/pull/512))
76
+ - Reorganized imports across various components to improve clarity and maintainability.
77
+ - Updated layout and page components to include necessary configurations for internationalization and theming.
78
+ - Enhanced AdminPage structure by introducing a client component for better separation of concerns.
79
+ - Improved CSS variable formatting in theme files for better readability and consistency.
80
+
81
+ These changes aim to streamline the codebase, enhance component organization, and improve the overall theming experience in the application.
82
+
83
+ #### ♻️ Refactors
84
+
85
+ - **create-app:** update context imports and enhance type definitions ([be587b4](https://github.com/qlover/fe-base/commit/be587b40d04785309bc34fe41ffb5054c6698818)) ([#512](https://github.com/qlover/fe-base/pull/512))
86
+ - Replaced FeScriptContext with ScriptContext in Generator class for consistency with updated context structure.
87
+ - Modified GeneratorOptions to extend ScriptSharedInterface, improving type safety and integration with the scripts context.
88
+
89
+ These changes aim to streamline the codebase and ensure better alignment with the latest context definitions.
90
+
3
91
  ## 0.7.10
4
92
 
5
93
  ### Patch Changes