@qlover/create-app 0.12.0 → 1.0.1

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 (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/templates/next-app/next.config.ts +4 -3
  5. package/dist/templates/next-app/package.json +12 -9
  6. package/dist/templates/next-app/src/app/[locale]/login/LoginForm.tsx +2 -3
  7. package/dist/templates/next-app/src/base/cases/DialogErrorPlugin.ts +6 -4
  8. package/dist/templates/next-app/src/base/cases/RequestEncryptPlugin.ts +14 -10
  9. package/dist/templates/next-app/src/base/cases/StringEncryptor.ts +2 -2
  10. package/dist/templates/next-app/src/base/port/I18nServiceInterface.ts +1 -4
  11. package/dist/templates/next-app/src/base/services/I18nService.ts +6 -2
  12. package/dist/templates/next-app/src/base/services/adminApi/AdminApiRequester.ts +11 -7
  13. package/dist/templates/next-app/src/base/services/adminApi/AdminLocalesApi.ts +11 -10
  14. package/dist/templates/next-app/src/base/services/adminApi/AdminUserApi.ts +16 -12
  15. package/dist/templates/next-app/src/base/services/appApi/AppApiPlugin.ts +19 -19
  16. package/dist/templates/next-app/src/base/services/appApi/AppApiRequester.ts +26 -21
  17. package/dist/templates/next-app/src/base/services/appApi/AppUserApi.ts +15 -6
  18. package/dist/templates/next-app/src/base/services/appApi/AppUserApiBootstrap.ts +12 -14
  19. package/dist/templates/next-app/src/core/bootstraps/BootstrapServer.ts +34 -17
  20. package/dist/templates/next-app/src/server/NextApiServer.ts +10 -4
  21. package/dist/templates/next-app/src/server/PasswordEncrypt.ts +2 -2
  22. package/dist/templates/next-app/src/server/controllers/UserController.ts +2 -2
  23. package/dist/templates/next-app/src/server/port/ServerInterface.ts +2 -2
  24. package/dist/templates/next-app/src/server/services/AdminAuthPlugin.ts +6 -7
  25. package/dist/templates/next-app/src/server/services/UserService.ts +2 -2
  26. package/dist/templates/next-app/src/uikit/components/BootstrapsProvider.tsx +11 -47
  27. package/dist/templates/react-app/__tests__/__mocks__/MockDialogHandler.ts +3 -2
  28. package/dist/templates/react-app/__tests__/__mocks__/createMockGlobals.ts +6 -1
  29. package/dist/templates/react-app/__tests__/src/base/cases/I18nKeyErrorPlugin.test.ts +21 -61
  30. package/dist/templates/react-app/__tests__/src/base/cases/RequestLogger.test.ts +29 -51
  31. package/dist/templates/react-app/__tests__/src/core/bootstraps/BootstrapClient.test.ts +8 -26
  32. package/dist/templates/react-app/__tests__/src/main.test.tsx +2 -2
  33. package/dist/templates/react-app/config/IOCIdentifier.ts +1 -1
  34. package/dist/templates/react-app/docs/en/test-guide.md +5 -5
  35. package/dist/templates/react-app/docs/zh/test-guide.md +5 -5
  36. package/dist/templates/react-app/package.json +2 -1
  37. package/dist/templates/react-app/src/base/apis/AiApi.ts +20 -12
  38. package/dist/templates/react-app/src/base/apis/feApi/FeApi.ts +14 -5
  39. package/dist/templates/react-app/src/base/apis/feApi/FeApiBootstarp.ts +26 -13
  40. package/dist/templates/react-app/src/base/apis/userApi/UserApi.ts +30 -34
  41. package/dist/templates/react-app/src/base/apis/userApi/UserApiBootstarp.ts +20 -17
  42. package/dist/templates/react-app/src/base/cases/I18nKeyErrorPlugin.ts +11 -5
  43. package/dist/templates/react-app/src/base/cases/RequestLanguages.ts +19 -6
  44. package/dist/templates/react-app/src/base/cases/RequestLogger.ts +11 -11
  45. package/dist/templates/react-app/src/base/services/BaseLayoutService.ts +11 -5
  46. package/dist/templates/react-app/src/base/services/UserBootstrap.ts +6 -7
  47. package/dist/templates/react-app/src/base/services/UserService.ts +1 -5
  48. package/dist/templates/react-app/src/core/clientIoc/ClientIOCRegister.ts +6 -7
  49. package/dist/templates/react-app/src/main.tsx +1 -1
  50. package/dist/templates/react-app/src/pages/auth/LoginPage.tsx +5 -5
  51. package/dist/templates/react-app/src/pages/base/ExecutorPage.tsx +3 -1
  52. package/dist/templates/react-app/src/pages/base/JSONStoragePage.tsx +6 -2
  53. package/dist/templates/react-app/src/pages/base/MessagePage.tsx +34 -3
  54. package/dist/templates/react-app/src/uikit/bridges/ExecutorPageBridge.ts +13 -7
  55. package/dist/templates/react-app/src/uikit/components/LogoutButton.tsx +6 -1
  56. package/dist/templates/react-app/src/uikit/components/MessageBaseList.tsx +26 -11
  57. package/dist/templates/react-app/src/uikit/components/chatMessage/ChatMessageBridge.ts +1 -1
  58. package/dist/templates/react-app/src/uikit/components/chatMessage/FocusBar.tsx +3 -1
  59. package/dist/templates/react-app/src/uikit/components/chatMessage/MessageApi.ts +16 -7
  60. package/dist/templates/react-app/src/vite-env.d.ts +1 -1
  61. package/dist/templates/react-app/tsconfig.e2e.json +5 -2
  62. package/dist/templates/react-app/tsconfig.json +7 -0
  63. package/dist/templates/react-app/tsconfig.node.json +4 -2
  64. package/dist/templates/react-app/tsconfig.test.json +4 -1
  65. package/package.json +3 -3
  66. package/dist/templates/react-app/src/base/cases/AppError.ts +0 -10
  67. package/dist/templates/react-app/src/base/port/ProcesserExecutorInterface.ts +0 -20
  68. package/dist/templates/react-app/src/base/services/UserGatewayPlugin.ts +0 -20
@@ -1 +1 @@
1
- // / <reference types="vite/client" />
1
+ /// <reference types="vite/client" />
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "module": "ESNext",
5
5
  "moduleResolution": "bundler",
6
- "lib": ["ES2023"],
6
+ "lib": ["ES2023", "DOM", "DOM.Iterable"],
7
7
  "types": ["node", "@playwright/test"],
8
8
  "noEmit": true,
9
9
  "skipLibCheck": true,
@@ -11,11 +11,14 @@
11
11
  "resolveJsonModule": true,
12
12
  "isolatedModules": true,
13
13
  "esModuleInterop": true,
14
+ "experimentalDecorators": true,
15
+ "emitDecoratorMetadata": true,
14
16
  "baseUrl": ".",
15
17
  "paths": {
18
+ "@/*": ["./src/*"],
16
19
  "@config/*": ["./config/*"]
17
20
  }
18
21
  },
19
- "include": ["e2e/**/*.ts", "playwright.config.ts"],
22
+ "include": ["src", "config", "e2e/**/*.ts", "playwright.config.ts"],
20
23
  "exclude": ["node_modules", "dist"]
21
24
  }
@@ -2,7 +2,14 @@
2
2
  "files": [],
3
3
  "compilerOptions": {
4
4
  "baseUrl": ".",
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "jsx": "react-jsx",
8
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
9
+ "experimentalDecorators": true,
10
+ "emitDecoratorMetadata": true,
5
11
  "paths": {
12
+ "@/*": ["./src/*"],
6
13
  "@config/*": ["./config/*"]
7
14
  }
8
15
  },
@@ -2,7 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
4
  "target": "ES2022",
5
- "lib": ["ES2023"],
5
+ "lib": ["ES2023", "DOM", "DOM.Iterable"],
6
6
  "module": "ESNext",
7
7
  "skipLibCheck": true,
8
8
 
@@ -18,7 +18,9 @@
18
18
  "noUnusedLocals": true,
19
19
  "noUnusedParameters": true,
20
20
  "noFallthroughCasesInSwitch": true,
21
- "noUncheckedSideEffectImports": true
21
+ "noUncheckedSideEffectImports": true,
22
+ "experimentalDecorators": true,
23
+ "emitDecoratorMetadata": true
22
24
  },
23
25
  "include": ["vite.config.ts", "makes"],
24
26
  "exclude": ["node_modules", "dist"]
@@ -2,7 +2,10 @@
2
2
  "extends": "./tsconfig.app.json",
3
3
  "compilerOptions": {
4
4
  "jsx": "react-jsx",
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
5
6
  "types": ["vitest/globals", "vite/client"],
7
+ "experimentalDecorators": true,
8
+ "emitDecoratorMetadata": true,
6
9
  "paths": {
7
10
  "@/*": ["./src/*"],
8
11
  "@config/*": ["./config/*"],
@@ -10,6 +13,6 @@
10
13
  "@__mocks__/*": ["./__tests__/__mocks__/*"]
11
14
  }
12
15
  },
13
- "include": ["__tests__/**/*"],
16
+ "include": ["src", "config", "__tests__/**/*"],
14
17
  "exclude": ["node_modules", "dist"]
15
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlover/create-app",
3
- "version": "0.12.0",
3
+ "version": "1.0.1",
4
4
  "description": "Create a new app with a single command",
5
5
  "private": false,
6
6
  "type": "module",
@@ -33,12 +33,12 @@
33
33
  "ignore": "^7.0.3",
34
34
  "lodash": "^4.17.21",
35
35
  "ora": "^8.1.1",
36
- "@qlover/logger": "0.4.0"
36
+ "@qlover/logger": "1.0.0"
37
37
  },
38
38
  "dependencies": {
39
39
  "commander": "^13.1.0",
40
40
  "inquirer": "^12.3.2",
41
- "@qlover/scripts-context": "1.3.0"
41
+ "@qlover/scripts-context": "2.0.0"
42
42
  },
43
43
  "scripts": {
44
44
  "lint": "eslint src --fix",
@@ -1,10 +0,0 @@
1
- import { ExecutorError } from '@qlover/fe-corekit';
2
-
3
- export class AppError extends ExecutorError {
4
- constructor(
5
- public readonly id: string,
6
- public readonly source?: string | Error
7
- ) {
8
- super(id, source);
9
- }
10
- }
@@ -1,20 +0,0 @@
1
- import type { ExecutorPlugin } from '@qlover/fe-corekit';
2
-
3
- export interface ProcesserExecutorInterface extends ExecutorPlugin {
4
- /**
5
- * 使用插件
6
- *
7
- * @param plugin - 插件
8
- */
9
- use(plugin: ExecutorPlugin): this;
10
-
11
- /**
12
- * 处理函数
13
- */
14
- handler(): Promise<{ success: boolean }>;
15
-
16
- /**
17
- * 启动
18
- */
19
- starup(): Promise<unknown>;
20
- }
@@ -1,20 +0,0 @@
1
- import type { UserInfo, UserCredential } from '@/base/apis/userApi/UserApiType';
2
- import type { RouteServiceInterface } from '../port/RouteServiceInterface';
3
- import type { UserServicePluginInterface } from '@qlover/corekit-bridge';
4
-
5
- export class UserGatewayPlugin implements UserServicePluginInterface<
6
- UserInfo,
7
- UserCredential
8
- > {
9
- public readonly pluginName = 'UserGatewayPlugin';
10
-
11
- constructor(protected routerService: RouteServiceInterface) {}
12
-
13
- /**
14
- * @override
15
- */
16
- public onLogoutSuccess(): void {
17
- this.routerService.reset();
18
- this.routerService.gotoLogin();
19
- }
20
- }