generator-mico-cli 0.2.10 → 0.2.11

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.
@@ -37,7 +37,7 @@ const createLogger = (prefix: string) => ({
37
37
 
38
38
  ## 常量定义
39
39
 
40
- 集中管理魔法字符串,位于 `src/common/constants.ts`。
40
+ 集中管理魔法字符串,位于 `src/constants/index.ts`。
41
41
 
42
42
  ### ROUTES
43
43
 
@@ -95,7 +95,7 @@ export const STORAGE_KEYS = {
95
95
  | 文件 | 说明 |
96
96
  | ------------------------------------ | ------------- |
97
97
  | `src/common/logger.ts` | Logger 工具 |
98
- | `src/common/constants.ts` | 常量定义 |
98
+ | `src/constants/index.ts` | 常量定义 |
99
99
  | `apps/homepage/src/common/logger.ts` | 子应用 Logger |
100
100
 
101
101
  ## 注意事项
@@ -129,7 +129,7 @@ const ThemeToggle: React.FC = () => {
129
129
  ### 常量定义
130
130
 
131
131
  ```typescript
132
- // src/common/constants.ts
132
+ // src/constants/index.ts
133
133
  export const THEME = {
134
134
  STORAGE_KEY: '<%= ProjectName %>-theme',
135
135
  DEFAULT: 'light' as const,
@@ -7,7 +7,7 @@ import {
7
7
  maybePersistTokens,
8
8
  setStoredAuthToken,
9
9
  } from '@/common/auth/auth-manager';
10
- import { ROUTES } from '@/common/constants';
10
+ import { ROUTES } from '@/constants';
11
11
  import {
12
12
  getTicketParam,
13
13
  resolveAuthToken,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 应用常量定义
3
3
  */
4
- export const DEFAULT_NAME = 'Mico';
4
+ export const DEFAULT_NAME = '<%= projectName %>';
5
5
  /**
6
6
  * 路由路径常量
7
7
  */
@@ -1,6 +1,7 @@
1
1
  import { useTheme } from '@/hooks/useTheme';
2
2
  import { logout } from '@/common/auth';
3
- import { ROUTES } from '@/common/constants';
3
+ import { DEFAULT_NAME } from '@/constants';
4
+ import { ROUTES } from '@/constants';
4
5
  import {
5
6
  Avatar,
6
7
  Divider,
@@ -57,7 +58,7 @@ const LayoutHeader: React.FC = () => {
57
58
  {/* Logo */}
58
59
  <div className="layout-header-logo">
59
60
  <span className="logo-text">
60
- {window.__MICO_MENUS__?.appName || '<%= projectName %>'}
61
+ {window.__MICO_CONFIG__?.appName || DEFAULT_NAME}
61
62
  </span>
62
63
  </div>
63
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-mico-cli",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Yeoman generator for Mico CLI projects",
5
5
  "keywords": [
6
6
  "yeoman-generator",
@@ -1,38 +0,0 @@
1
- /**
2
- * 应用常量定义
3
- */
4
-
5
- /**
6
- * 路由路径常量
7
- */
8
- export const ROUTES = {
9
- /** 登录页 */
10
- LOGIN: '/user/login',
11
- /** 注册页 */
12
- REGISTER: '/user/register',
13
- /** 注册结果页 */
14
- REGISTER_RESULT: '/user/register-result',
15
- /** 无需认证的路由列表 */
16
- NO_AUTH_ROUTES: ['/user/login', '/user/register', '/user/register-result'],
17
- } as const;
18
-
19
- /**
20
- * 主题相关常量
21
- */
22
- export const THEME = {
23
- /** localStorage 存储键 */
24
- STORAGE_KEY: '<%= projectName %>-theme',
25
- /** 默认主题 */
26
- DEFAULT: 'light' as const,
27
- /** 可选主题值 */
28
- VALUES: ['light', 'dark'] as const,
29
- } as const;
30
-
31
- /**
32
- * 存储键常量
33
- */
34
- export const STORAGE_KEYS = {
35
- APP_INFO: 'appInfo',
36
- IS_SUPERUSER: 'is_superuser',
37
- GROUPS: 'groups',
38
- } as const;