generator-mico-cli 0.2.34 → 1.0.0

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 (24) hide show
  1. package/README.md +1 -1
  2. package/generators/micro-react/templates/apps/layout/docs/feature-/344/270/273/351/242/230/350/211/262/345/210/207/346/215/242.md +1 -1
  3. package/generators/micro-react/templates/apps/layout/docs/feature-/345/276/256/345/211/215/347/253/257/346/250/241/345/274/217.md +1 -1
  4. package/generators/micro-react/templates/apps/layout/package.json +1 -0
  5. package/generators/micro-react/templates/apps/layout/src/app.tsx +5 -3
  6. package/generators/micro-react/templates/apps/layout/src/components/AppTabs/index.less +4 -4
  7. package/generators/micro-react/templates/apps/layout/src/components/MicroAppLoader/index.tsx +1 -1
  8. package/generators/micro-react/templates/apps/layout/src/components/RightContent/avatar-dropdown.less +5 -5
  9. package/generators/micro-react/templates/apps/layout/src/components/RightContent/tenant-dropdown.less +4 -4
  10. package/generators/micro-react/templates/apps/layout/src/global.less +1 -2
  11. package/generators/micro-react/templates/apps/layout/src/layouts/components/header/index.less +17 -17
  12. package/generators/micro-react/templates/apps/layout/src/layouts/components/menu/index.less +15 -15
  13. package/generators/micro-react/templates/apps/layout/src/layouts/index.less +16 -16
  14. package/generators/micro-react/templates/apps/layout/src/layouts/index.tsx +3 -4
  15. package/generators/micro-react/templates/apps/layout/src/pages/Home/index.less +3 -3
  16. package/generators/micro-react/templates/apps/layout/src/pages/User/Login/index.less +46 -40
  17. package/generators/micro-react/templates/packages/common-intl/README.md +3 -2
  18. package/generators/subapp-react/templates/homepage/config/config.dev.ts +1 -47
  19. package/generators/subapp-react/templates/homepage/package.json +1 -0
  20. package/generators/subapp-react/templates/homepage/src/app.tsx +10 -0
  21. package/generators/subapp-react/templates/homepage/src/global.less +1 -1
  22. package/generators/subapp-react/templates/homepage/src/pages/index.less +31 -31
  23. package/generators/subapp-react/templates/homepage/src/pages/index.tsx +2 -2
  24. package/package.json +3 -3
package/README.md CHANGED
@@ -119,7 +119,7 @@ mico setup multica-desktop
119
119
 
120
120
  ### 组件库版本(`micoPackages`)
121
121
 
122
- CLI 根 `package.json` 的 `micoPackages` 是 `@mico-platform/ui` / `@mico-platform/theme` 的**唯一维护点**(semver range,如 `0.x`)。`mico create` 时在该 range 内 resolve 最新版本,写入生成项目为 `^x.y.z`(如 `^0.0.25`);子应用开发环境 CDN `MICO_UI_VERSION` 使用同一 resolved 精确版本。
122
+ CLI 根 `package.json` 的 `micoPackages` 是 `@mico-platform/ui` / `@mico-platform/theme` 的**唯一维护点**(semver range,如 `1.x`)。`mico create` 时在该 range 内 resolve 最新版本,写入生成项目为 `^x.y.z`;子应用独立开发时在 `app.tsx` 条件加载 npm CSS,嵌入主应用时由 layout 全局提供。
123
123
 
124
124
  组件库发 patch(仍在 `0.x`)时通常无需发 CLI;切换到 `1.x` 等 major 策略时,修改 `micoPackages` 并发布新 CLI 即可。
125
125
 
@@ -215,7 +215,7 @@ export default function Page() {
215
215
  return (
216
216
  <Card title="示例卡片">
217
217
  <Button type="primary">主要按钮</Button>
218
- <Tag color="arcoblue">标签</Tag>
218
+ <Tag color="dark-blue">标签</Tag>
219
219
  </Card>
220
220
  );
221
221
  }
@@ -443,7 +443,7 @@ export default function HomePage() {
443
443
  <Button type="primary" onClick={() => Message.success('成功!')}>
444
444
  点击按钮
445
445
  </Button>
446
- <Tag color="arcoblue">标签</Tag>
446
+ <Tag color="dark-blue">标签</Tag>
447
447
  </Card>
448
448
  );
449
449
  }
@@ -22,6 +22,7 @@
22
22
  "test": "cross-env UMI_ENV=test max dev"
23
23
  },
24
24
  "dependencies": {
25
+ "@arco-iconbox/react-mico": ">=0.0.1",
25
26
  "<%= packageScope %>/common-intl": "workspace:*",
26
27
  "<%= packageScope %>/shared": "workspace:*",
27
28
  "@mico-platform/ui": "<%= micoUiVersion %>",
@@ -4,7 +4,8 @@ import * as CommonWebSentry from '@common-web/sentry';
4
4
  import { SentryErrorBoundary } from '@common-web/sentry';
5
5
  import { errorConfig } from './requestErrorConfig';
6
6
  // 将 @mico-platform/ui 暴露到 window,供子应用 externals 使用
7
- import * as micoUI from '@mico-platform/ui';
7
+ import { Message } from '@mico-platform/ui';
8
+ import * as micoUI from '@mico-platform/ui/es';
8
9
  import dayjs from 'dayjs';
9
10
  import React from 'react';
10
11
  import ReactDOM from 'react-dom';
@@ -42,6 +43,7 @@ import { initTheme } from './common/theme';
42
43
  import MicroAppLoader from './components/MicroAppLoader';
43
44
  import { isCommonIntlEnabled } from '@/common/intl';
44
45
  import { isNoAuthRoute } from '@/constants';
46
+ import '@mico-platform/ui/dist/css/mico-ui.min.css';
45
47
  import '@mico-platform/theme/dist/css/theme.css';
46
48
  import './global.less';
47
49
  import { getCurrentLocale, setLocaleToStorage } from './common/locale';
@@ -177,8 +179,8 @@ export function render(oldRender: () => void): void {
177
179
  fetchMultilingualData({
178
180
  requestInstance: commonRequest,
179
181
  messageInstance: {
180
- error: micoUI.Message.error,
181
- warning: micoUI.Message.warning,
182
+ error: Message.error,
183
+ warning: Message.warning,
182
184
  },
183
185
  lang: umiLocaleToILang(getCurrentLocale()) as ILang,
184
186
  localeRequestUrl: process.env.LOCALE_REQUEST_URL,
@@ -13,14 +13,14 @@
13
13
  padding-left: 16px;
14
14
  transition: left 0.2s ease;
15
15
  z-index: 999;
16
- background-color: @color-fill-1;
16
+ background-color: @fill-1;
17
17
  top: @header-height;
18
18
  padding-top: 16px;
19
19
  padding-bottom: 8px;
20
20
 
21
21
  .arco-tabs-header-title {
22
22
  border: none;
23
- border-radius: @border-radius-lg;
23
+ border-radius: @border-radius-md;
24
24
 
25
25
  &-active {
26
26
  border: none;
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  &-active:hover {
31
- background-color: @color-fill-3;
31
+ background-color: @fill-3;
32
32
  }
33
33
  }
34
34
 
@@ -45,6 +45,6 @@
45
45
  }
46
46
 
47
47
  .arco-icon-hover:hover::before {
48
- background-color: @color-fill-2 !important;
48
+ background-color: @fill-2 !important;
49
49
  }
50
50
  }
@@ -179,7 +179,7 @@ const MicroAppLoader: React.FC<MicroAppLoaderProps> = ({
179
179
  )}
180
180
  {state.loading && !state.error && (
181
181
  <div className="micro-app-loading">
182
- <Spin dot tip={`正在加载 ${displayName || name}...`} />
182
+ <Spin tip={`正在加载 ${displayName || name}...`} />
183
183
  </div>
184
184
  )}
185
185
  {/* qiankun 容器挂载点 */}
@@ -1,16 +1,16 @@
1
1
  @import '@mico-platform/theme/variables';
2
2
 
3
3
  .avatar-dropdown-trigger {
4
- background-color: @color-fill-2;
4
+ background-color: @fill-2;
5
5
  border-radius: @border-radius-button;
6
6
  height: 32px;
7
7
  padding: 1px 10px;
8
- color: @color-text-1;
8
+ color: @text-1;
9
9
  cursor: pointer;
10
10
  }
11
11
 
12
12
  .avatar-dropdown-trigger:hover {
13
- background: @color-fill-3;
13
+ background: @fill-3;
14
14
  }
15
15
 
16
16
  .avatar-dropdown-trigger.arco-dropdown-popup-visible .arco-icon-down {
@@ -27,9 +27,9 @@
27
27
  }
28
28
 
29
29
  .selected-label {
30
- color: @Brand1-6;
30
+ color: @brand1-6;
31
31
  }
32
32
 
33
33
  .label-name {
34
- color: @color-text-3;
34
+ color: @text-3;
35
35
  }
@@ -6,17 +6,17 @@
6
6
  display: inline-flex;
7
7
  justify-content: space-between;
8
8
  width: @tenant-dropdown-width;
9
- background-color: @color-fill-2;
9
+ background-color: @fill-2;
10
10
  border-radius: @border-radius-button;
11
11
  height: 32px;
12
12
  padding: 1px 10px;
13
- color: @color-text-1;
13
+ color: @text-1;
14
14
  cursor: pointer;
15
15
  box-sizing: border-box;
16
16
  }
17
17
 
18
18
  .tenant-dropdown-trigger:hover {
19
- background: @color-fill-3;
19
+ background: @fill-3;
20
20
  }
21
21
 
22
22
  .tenant-dropdown-trigger .tenant-name {
@@ -44,5 +44,5 @@
44
44
  }
45
45
 
46
46
  .tenant-dropdown-menu .selected-label {
47
- color: @Brand1-6;
47
+ color: @brand1-6;
48
48
  }
@@ -1,4 +1,3 @@
1
-
2
1
  // 再导入 @mico-platform/theme 主题变量(CSS Variables + Less Variables)
3
2
  // 这样项目的变量定义会在 UI 库之后,可以正确覆盖
4
3
  @import '@mico-platform/theme/variables';
@@ -16,7 +15,7 @@ html {
16
15
  body {
17
16
  overscroll-behavior-x: none;
18
17
  height: 100%;
19
- background-color: @color-fill-1;
18
+ background-color: @fill-1;
20
19
  }
21
20
 
22
21
  #root {
@@ -2,7 +2,7 @@
2
2
 
3
3
  // Common mixins
4
4
  .header-gray-btn-mixin() {
5
- background: @color-fill-2;
5
+ background: @fill-2;
6
6
  border-radius: @border-radius-button;
7
7
  }
8
8
 
@@ -28,7 +28,7 @@
28
28
  display: flex;
29
29
  align-items: center;
30
30
  justify-content: space-between;
31
- background: var(--color-bg-3);
31
+ background: var(--fill-0);
32
32
  box-shadow: 0 4px 4px 0 rgba(134, 144, 156, 8%);
33
33
  flex-shrink: 0;
34
34
 
@@ -46,7 +46,7 @@
46
46
  .logo-text {
47
47
  font-size: @font-size-lg;
48
48
  font-weight: @font-weight-bold;
49
- color: @Brand1-6;
49
+ color: @brand1-6;
50
50
  letter-spacing: 1px;
51
51
  overflow: hidden;
52
52
  white-space: nowrap;
@@ -87,7 +87,7 @@
87
87
  font-size: 14px;
88
88
  line-height: 22px;
89
89
  font-weight: 400;
90
- color: @color-text-2;
90
+ color: @text-2;
91
91
  border-radius: @border-radius-md;
92
92
  transition: background-color @animation-duration-fast,
93
93
  color @animation-duration-fast;
@@ -98,26 +98,26 @@
98
98
 
99
99
  // 未选中 hover:仅加浅灰底(fill/2),文字保持灰色不变紫
100
100
  &:hover {
101
- color: @color-text-2;
102
- background-color: @color-fill-2;
101
+ color: @text-2;
102
+ background-color: @fill-2;
103
103
  }
104
104
 
105
105
  // 选中态:品牌紫 + Medium
106
106
  &-active {
107
- color: @Brand1-6;
107
+ color: @brand1-6;
108
108
  font-weight: 500;
109
109
  }
110
110
 
111
111
  // 选中 + hover:品牌紫文字 + 浅灰圆角底
112
112
  &-active:hover {
113
- color: @Brand1-6;
114
- background-color: @color-fill-2;
113
+ color: @brand1-6;
114
+ background-color: @fill-2;
115
115
  }
116
116
  }
117
117
 
118
118
  // 激活下划线(ink bar):品牌紫
119
119
  .arco-tabs-header-ink {
120
- background-color: @Brand1-6;
120
+ background-color: @brand1-6;
121
121
  }
122
122
  }
123
123
  }
@@ -138,12 +138,12 @@
138
138
  transition: background-color @animation-duration-fast;
139
139
 
140
140
  &:hover {
141
- background: @color-fill-2;
141
+ background: @fill-2;
142
142
  }
143
143
 
144
144
  svg {
145
145
  font-size: 18px;
146
- color: @color-text-2;
146
+ color: @text-2;
147
147
  }
148
148
  }
149
149
 
@@ -156,11 +156,11 @@
156
156
  transition: background-color @animation-duration-fast;
157
157
 
158
158
  &:hover {
159
- background: @color-fill-2;
159
+ background: @fill-2;
160
160
  }
161
161
 
162
162
  .user-name {
163
- color: @color-text-1;
163
+ color: @text-1;
164
164
  font-size: @font-size-base;
165
165
  }
166
166
  }
@@ -168,7 +168,7 @@
168
168
  .split-line {
169
169
  width: 1px;
170
170
  height: 16px;
171
- background: var(--color-border-2);
171
+ background: var(--line-2);
172
172
  margin: 0 @spacing-xs;
173
173
  }
174
174
 
@@ -176,9 +176,9 @@
176
176
  .header-gray-btn-mixin();
177
177
  .center-mixin();
178
178
 
179
- color: @color-text-1;
179
+ color: @text-1;
180
180
 
181
181
  .unread-count {
182
- background-color: @Danger-6;
182
+ background-color: @danger-6;
183
183
  }
184
184
  }
@@ -12,7 +12,7 @@
12
12
  .layout-menu.arco-menu-dark,
13
13
  .layout-menu.arco-menu {
14
14
  font-size: @font-size-base;
15
- background-color: @color-text-5;
15
+ background-color: @text-5;
16
16
 
17
17
  // Base menu item styles
18
18
  .arco-menu-item {
@@ -21,32 +21,32 @@
21
21
  padding: 0 12px;
22
22
 
23
23
  &:hover {
24
- background-color: @Brand1-1;
24
+ background-color: @brand1-1;
25
25
  }
26
26
  }
27
27
 
28
28
  .arco-menu-inline-header {
29
29
  &:hover {
30
- background-color: @Brand1-1;
30
+ background-color: @brand1-1;
31
31
  }
32
32
  }
33
33
 
34
34
  .arco-menu-inline-header.arco-menu-selected {
35
35
  &:hover {
36
- background-color: @Brand1-1;
36
+ background-color: @brand1-1;
37
37
  }
38
38
  }
39
39
 
40
40
  .arco-menu-item.arco-menu-selected {
41
- background-color: @Brand1-1;
41
+ background-color: @brand1-1;
42
42
  }
43
43
 
44
44
  .arco-menu-pop-header.arco-menu-selected {
45
- background-color: @Brand1-1;
45
+ background-color: @brand1-1;
46
46
  }
47
47
 
48
48
  .arco-menu-pop-header:hover {
49
- background-color: @Brand1-1;
49
+ background-color: @brand1-1;
50
50
  }
51
51
 
52
52
  .arco-menu-indent {
@@ -137,7 +137,7 @@
137
137
  // Sider styles
138
138
  .layout-web-sider {
139
139
  box-shadow: none;
140
- background-color: @color-text-5 !important;
140
+ background-color: @text-5 !important;
141
141
  position: fixed !important;
142
142
  height: calc(100vh - @header-height) !important;
143
143
  z-index: 999;
@@ -146,7 +146,7 @@
146
146
  display: flex;
147
147
  justify-content: flex-end;
148
148
  // 使用主题变量适配亮/暗主题
149
- background-color: @color-text-5;
149
+ background-color: @text-5;
150
150
  }
151
151
 
152
152
  .click-trigger-btn {
@@ -159,13 +159,13 @@
159
159
 
160
160
  // 图标颜色适配主题
161
161
  .arco-icon {
162
- color: @color-text-2;
162
+ color: @text-2;
163
163
  }
164
164
  }
165
165
 
166
166
  .click-trigger-btn:not(.collapsed) {
167
- background-color: @color-fill-1;
168
- border-radius: @border-radius-lg;
167
+ background-color: @fill-1;
168
+ border-radius: @border-radius-md;
169
169
  }
170
170
 
171
171
  .click-trigger-btn.collapsed {
@@ -184,11 +184,11 @@
184
184
  .arco-menu-dark .arco-menu-group-title,
185
185
  .arco-menu-dark .arco-menu-pop-header,
186
186
  .arco-menu-dark .arco-menu-inline-header {
187
- background-color: @color-text-5;
188
- color: @color-text-2;
187
+ background-color: @text-5;
188
+ color: @text-2;
189
189
 
190
190
  &.arco-menu-selected {
191
- color: @Brand1-6;
191
+ color: @brand1-6;
192
192
  }
193
193
  }
194
194
  }
@@ -1,7 +1,7 @@
1
1
  @import '@mico-platform/theme/variables';
2
2
 
3
3
  .arco-tree-node:hover {
4
- background-color: @color-fill-2;
4
+ background-color: @fill-2;
5
5
  }
6
6
 
7
7
  body {
@@ -11,7 +11,7 @@ body {
11
11
 
12
12
  .layout-container {
13
13
  min-width: @size-base * 128;
14
- background: @color-fill-1;
14
+ background: @fill-1;
15
15
  // overflow-x: auto;s
16
16
  // overflow-y: hidden;
17
17
  display: flex;
@@ -48,7 +48,7 @@ body {
48
48
  // overflow-y: scroll;
49
49
  overflow: hidden;
50
50
  background: none;
51
- border-radius: @border-radius-lg;
51
+ border-radius: @border-radius-md;
52
52
  position: relative;
53
53
 
54
54
  --layout-content-outlet-margin-top: 32px;
@@ -60,11 +60,11 @@ body {
60
60
  }
61
61
 
62
62
  .arco-spin-children::after {
63
- background-color: color-mix(in srgb, var(--color-text-5) 60%, transparent);
63
+ background-color: color-mix(in srgb, var(--text-5) 60%, transparent);
64
64
  }
65
65
 
66
66
  .arco-layout-sider-trigger {
67
- background-color: @color-text-5;
67
+ background-color: @text-5;
68
68
  }
69
69
  }
70
70
 
@@ -81,7 +81,7 @@ body {
81
81
 
82
82
  .layout-web-sider {
83
83
  box-shadow: none;
84
- background-color: @color-text-5;
84
+ background-color: @text-5;
85
85
  z-index: 999;
86
86
 
87
87
  .arco-layout-sider-trigger {
@@ -96,8 +96,8 @@ body {
96
96
  }
97
97
 
98
98
  .click-trigger-btn:not(.collapsed) {
99
- background-color: @color-fill-1;
100
- border-radius: @border-radius-lg;
99
+ background-color: @fill-1;
100
+ border-radius: @border-radius-md;
101
101
  }
102
102
 
103
103
  .click-trigger-btn.collapsed {
@@ -106,37 +106,37 @@ body {
106
106
  }
107
107
 
108
108
  .arco-drawer-header {
109
- border-bottom: 1px solid @color-line-2;
109
+ border-bottom: 1px solid @line-2;
110
110
  }
111
111
 
112
112
  .arco-drawer-footer {
113
- border-top: 1px solid @color-line-2;
113
+ border-top: 1px solid @line-2;
114
114
  }
115
115
 
116
116
  .arco-dropdown-menu {
117
- border-color: @color-line-2;
117
+ border-color: @line-2;
118
118
  }
119
119
 
120
120
  .arco-message-success,
121
121
  .arco-message-error,
122
122
  .arco-message-warning,
123
123
  .arco-message-loading {
124
- border-color: @color-line-2;
124
+ border-color: @line-2;
125
125
  }
126
126
 
127
127
  // 按钮样式覆盖
128
128
  .arco-btn-secondary:not(.arco-btn-disabled) {
129
- background-color: @color-fill-2;
129
+ background-color: @fill-2;
130
130
  }
131
131
 
132
132
  .arco-btn-secondary:not(.arco-btn-disabled):not(.arco-btn-loading):hover {
133
- background-color: @color-fill-3;
133
+ background-color: @fill-3;
134
134
  }
135
135
 
136
136
  .arco-btn-secondary:not(.arco-btn-disabled):not(.arco-btn-loading):active {
137
- background-color: @color-fill-4;
137
+ background-color: @fill-4;
138
138
  }
139
139
 
140
140
  .arco-btn-secondary.arco-btn-disabled {
141
- background-color: @color-fill-1;
141
+ background-color: @fill-1;
142
142
  }
@@ -229,7 +229,7 @@ const BasicLayout: React.FC = () => {
229
229
  zIndex: 100,
230
230
  }}
231
231
  >
232
- <Spin dot />
232
+ <Spin />
233
233
  </div>
234
234
  )}
235
235
  <MicroAppLoader
@@ -247,7 +247,6 @@ const BasicLayout: React.FC = () => {
247
247
  if (isRefreshing) {
248
248
  return (
249
249
  <Spin
250
- dot
251
250
  style={{ width: '100%', marginTop: 100, textAlign: 'center' }}
252
251
  />
253
252
  );
@@ -259,7 +258,7 @@ const BasicLayout: React.FC = () => {
259
258
  if (!showLayout) {
260
259
  return (
261
260
  <Suspense
262
- fallback={<Spin dot style={{ width: '100%', marginTop: 100 }} />}
261
+ fallback={<Spin style={{ width: '100%', marginTop: 100 }} />}
263
262
  >
264
263
  {isForbidden ? <ForbiddenPage /> : renderContent()}
265
264
  </Suspense>
@@ -277,7 +276,7 @@ const BasicLayout: React.FC = () => {
277
276
  <Content className="layout-content-outlet">
278
277
  <Suspense
279
278
  fallback={
280
- <Spin dot style={{ width: '100%', marginTop: 100 }} />
279
+ <Spin style={{ width: '100%', marginTop: 100 }} />
281
280
  }
282
281
  >
283
282
  {renderContent()}
@@ -2,7 +2,7 @@
2
2
 
3
3
  .container {
4
4
  padding-top: 30px;
5
- color: @color-text-1;
5
+ color: @text-1;
6
6
  }
7
7
 
8
8
  .title {
@@ -15,14 +15,14 @@
15
15
  margin: 0 0 8px;
16
16
  font-size: 14px;
17
17
  line-height: 1.6;
18
- color: @color-text-2;
18
+ color: @text-2;
19
19
  }
20
20
 
21
21
  .meta {
22
22
  margin: 0;
23
23
  font-size: 12px;
24
24
  font-family: ui-monospace, monospace;
25
- color: @color-text-3;
25
+ color: @text-3;
26
26
  }
27
27
 
28
28
  .demoCard {
@@ -7,9 +7,12 @@
7
7
  width: 100%;
8
8
  overflow: hidden;
9
9
  position: relative;
10
- background-color: @color-fill-2;
11
- background-image:
12
- radial-gradient(at 10% 10%, rgba(22, 93, 255, 0.08) 0%, transparent 60%),
10
+ background-color: @fill-2;
11
+ background-image: radial-gradient(
12
+ at 10% 10%,
13
+ rgba(22, 93, 255, 0.08) 0%,
14
+ transparent 60%
15
+ ),
13
16
  radial-gradient(at 90% 90%, rgba(22, 93, 255, 0.08) 0%, transparent 60%);
14
17
  }
15
18
 
@@ -32,8 +35,8 @@
32
35
  width: 100%;
33
36
  max-width: 420px;
34
37
  padding: 48px;
35
- background: @color-text-5;
36
- border-radius: @border-radius-lg;
38
+ background: @text-5;
39
+ border-radius: @border-radius-md;
37
40
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
38
41
  transition: all 0.3s ease-in-out;
39
42
 
@@ -53,7 +56,7 @@
53
56
  width: 56px;
54
57
  height: 56px;
55
58
  margin-bottom: 16px;
56
- color: @Brand2-6;
59
+ color: @brand2-6;
57
60
 
58
61
  svg {
59
62
  filter: drop-shadow(0 4px 8px rgba(22, 93, 255, 0.2));
@@ -69,14 +72,14 @@
69
72
  font-size: 24px;
70
73
  font-weight: 600;
71
74
  line-height: 32px;
72
- color: @color-text-1;
75
+ color: @text-1;
73
76
  }
74
77
 
75
78
  .subTitle {
76
79
  margin-top: 8px;
77
80
  font-size: 14px;
78
81
  line-height: 22px;
79
- color: @color-text-3;
82
+ color: @text-3;
80
83
  display: block;
81
84
  }
82
85
 
@@ -87,25 +90,25 @@
87
90
  border-radius: @border-radius-sm;
88
91
  padding-top: 6px;
89
92
  padding-bottom: 6px;
90
- border: 1px solid @color-border-2;
93
+ border: 1px solid @line-2;
91
94
  transition: all 0.2s;
92
95
 
93
96
  input {
94
97
  background: transparent;
95
98
 
96
99
  &::placeholder {
97
- color: @color-text-3;
100
+ color: @text-3;
98
101
  }
99
102
  }
100
103
 
101
104
  &:hover {
102
- background-color: @color-fill-2;
103
- border-color: @Brand2-6;
105
+ background-color: @fill-2;
106
+ border-color: @brand2-6;
104
107
  }
105
108
 
106
109
  &.arco-input-inner-wrapper-focus {
107
- background-color: @color-text-5;
108
- border-color: @Brand2-6;
110
+ background-color: @text-5;
111
+ border-color: @brand2-6;
109
112
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
110
113
  }
111
114
  }
@@ -113,7 +116,7 @@
113
116
  // Input.Password 样式(边框在外层)
114
117
  .arco-input-password {
115
118
  border-radius: @border-radius-sm;
116
- border: 1px solid @color-border-2;
119
+ border: 1px solid @line-2;
117
120
  transition: all 0.2s;
118
121
 
119
122
  // 内层不要边框,但保持 padding
@@ -136,18 +139,18 @@
136
139
  background: transparent;
137
140
 
138
141
  &::placeholder {
139
- color: @color-text-3;
142
+ color: @text-3;
140
143
  }
141
144
  }
142
145
 
143
146
  &:hover {
144
- background-color: @color-fill-2;
145
- border-color: @Brand2-6;
147
+ background-color: @fill-2;
148
+ border-color: @brand2-6;
146
149
  }
147
150
 
148
151
  &-focus {
149
- background-color: @color-text-5;
150
- border-color: @Brand2-6;
152
+ background-color: @text-5;
153
+ border-color: @brand2-6;
151
154
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
152
155
  }
153
156
  }
@@ -157,12 +160,12 @@
157
160
  font-size: 16px;
158
161
  font-weight: 500;
159
162
  border-radius: @border-radius-sm;
160
- background: linear-gradient(90deg, @Brand2-6 0%, @Brand2-5 100%);
163
+ background: linear-gradient(90deg, @brand2-6 0%, @brand2-5 100%);
161
164
  border: none;
162
165
  box-shadow: 0 4px 10px rgba(24, 144, 255, 0.2);
163
166
 
164
167
  &:hover {
165
- background: linear-gradient(90deg, @Brand2-7 0%, @Brand2-6 100%);
168
+ background: linear-gradient(90deg, @brand2-7 0%, @brand2-6 100%);
166
169
  box-shadow: 0 6px 16px rgba(24, 144, 255, 0.28);
167
170
  }
168
171
  }
@@ -178,15 +181,18 @@
178
181
  }
179
182
 
180
183
  .copyright {
181
- color: @color-text-3;
184
+ color: @text-3;
182
185
  font-size: 12px;
183
186
  }
184
187
 
185
188
  body[data-theme='dark'] {
186
189
  .container {
187
- background-color: @color-fill-1;
188
- background-image:
189
- radial-gradient(at 10% 10%, rgba(24, 144, 255, 0.12) 0%, transparent 60%),
190
+ background-color: @fill-1;
191
+ background-image: radial-gradient(
192
+ at 10% 10%,
193
+ rgba(24, 144, 255, 0.12) 0%,
194
+ transparent 60%
195
+ ),
190
196
  radial-gradient(at 90% 90%, rgba(24, 144, 255, 0.12) 0%, transparent 60%);
191
197
  }
192
198
 
@@ -196,12 +202,12 @@ body[data-theme='dark'] {
196
202
  }
197
203
 
198
204
  .content {
199
- background: @color-fill-2;
205
+ background: @fill-2;
200
206
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
201
207
  }
202
208
 
203
209
  .logo {
204
- color: @Brand2-5;
210
+ color: @brand2-5;
205
211
 
206
212
  svg {
207
213
  filter: drop-shadow(0 4px 10px rgba(24, 144, 255, 0.45));
@@ -211,30 +217,30 @@ body[data-theme='dark'] {
211
217
  .form {
212
218
  :global {
213
219
  .arco-input-inner-wrapper {
214
- border: 1px solid @color-border-1;
220
+ border: 1px solid @line-1;
215
221
 
216
222
  input {
217
223
  background: transparent;
218
224
 
219
225
  &::placeholder {
220
- color: @color-text-4;
226
+ color: @text-4;
221
227
  }
222
228
  }
223
229
 
224
230
  &:hover {
225
- background-color: @color-fill-2;
226
- border-color: @Brand2-6;
231
+ background-color: @fill-2;
232
+ border-color: @brand2-6;
227
233
  }
228
234
 
229
235
  &.arco-input-inner-wrapper-focus {
230
- background-color: @color-fill-1;
231
- border-color: @Brand2-6;
236
+ background-color: @fill-1;
237
+ border-color: @brand2-6;
232
238
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.2);
233
239
  }
234
240
  }
235
241
 
236
242
  .arco-input-password {
237
- border: 1px solid @color-border-1;
243
+ border: 1px solid @line-1;
238
244
 
239
245
  .arco-input-inner-wrapper {
240
246
  border: none;
@@ -255,18 +261,18 @@ body[data-theme='dark'] {
255
261
  background: transparent;
256
262
 
257
263
  &::placeholder {
258
- color: @color-text-4;
264
+ color: @text-4;
259
265
  }
260
266
  }
261
267
 
262
268
  &:hover {
263
- background-color: @color-fill-2;
264
- border-color: @Brand2-6;
269
+ background-color: @fill-2;
270
+ border-color: @brand2-6;
265
271
  }
266
272
 
267
273
  &-focus {
268
- background-color: @color-fill-1;
269
- border-color: @Brand2-6;
274
+ background-color: @fill-1;
275
+ border-color: @brand2-6;
270
276
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.2);
271
277
  }
272
278
  }
@@ -43,14 +43,15 @@ const { fetchMultilingualData, i18n } = initIntl({
43
43
  主应用(`apps/layout`)在 `app.tsx` 的 `render` 函数中调用 `fetchMultilingualData`,确保渲染前完成多语言数据加载:
44
44
 
45
45
  ```typescript
46
+ import { Message } from '@mico-platform/ui';
46
47
  import { fetchMultilingualData, getCurrentLocale, type ILang } from '<%= packageScope %>/common-intl';
47
48
 
48
49
  export function render(oldRender: () => void): void {
49
50
  fetchMultilingualData({
50
51
  requestInstance: commonRequest,
51
52
  messageInstance: {
52
- error: micoUI.Message.error,
53
- warning: micoUI.Message.warning,
53
+ error: Message.error,
54
+ warning: Message.warning,
54
55
  },
55
56
  lang: getCurrentLocale() as ILang,
56
57
  localeRequestUrl: process.env.LOCALE_REQUEST_URL,
@@ -2,17 +2,11 @@
2
2
 
3
3
  import { defineConfig } from '@umijs/max';
4
4
 
5
- /**
6
- * ⚠️⚠️ 不要修改这个变量名,版本升级工具会读取这个变量名,进行版本升级
7
- * @name mico-ui 版本
8
- * @description 开发环境使用 mico-ui 的最新版本
9
- */
10
- const MICO_UI_VERSION = '<%= micoUiVersionExact %>';
11
-
12
5
  /**
13
6
  * 开发环境配置
14
7
  * - 不配置 externals,直接打包依赖,方便独立运行调试
15
8
  * - 生产环境通过 config.prod.ts 配置 externals 复用主应用依赖
9
+ * - 样式由主应用 layout 提供;子应用独立运行时见 app.tsx 条件加载
16
10
  */
17
11
  const config: ReturnType<typeof defineConfig> = {
18
12
  publicPath: '/',
@@ -21,46 +15,6 @@ const config: ReturnType<typeof defineConfig> = {
21
15
  define: {
22
16
  'process.env.NODE_ENV': 'development',
23
17
  },
24
- // /**
25
- // * @name 脚本加载配置
26
- // * @description 开发环境独立运行时,通过 CDN 加载公共依赖
27
- // * 作为微前端子应用运行时,这些库由主应用提供
28
- // */
29
- // headScripts: [
30
- // 'https://unpkg.com/react@18/umd/react.development.js',
31
- // 'https://unpkg.com/react-dom@18/umd/react-dom.development.js',
32
- // 'https://unpkg.com/@mico-platform/ui@<%= micoUiVersionExact %>/dist/arco.min.js',
33
- // ],
34
-
35
- // /**
36
- // * @name 样式加载配置
37
- // * @description 开发环境独立运行时加载 @mico-platform/ui CSS
38
- // */
39
- // links: [
40
- // {
41
- // rel: 'stylesheet',
42
- // href: 'https://unpkg.com/@mico-platform/ui@<%= micoUiVersionExact %>/dist/css/arco.min.css',
43
- // },
44
- // ],
45
-
46
- // /**
47
- // * @name 外部依赖配置
48
- // * @description 开发环境也需要 externals,配合 CDN 使用
49
- // */
50
- // externals: {
51
- // react: 'window.React',
52
- // 'react-dom': 'window.ReactDOM',
53
- // '@mico-platform/ui': 'window.micoUI',
54
- // },
55
- /**
56
- * @name 样式加载配置
57
- * @description 开发环境独立运行时加载 @mico-platform/ui CSS
58
- * 作为微前端子应用运行时,样式由主应用提供
59
- */
60
- styles: [
61
- // @mico-platform/ui 基础样式(使用运行时解析的最新版本号,避免 latest 标签)
62
- `https://cdn-portal.micoplatform.com/portal-center/mico-ui/${MICO_UI_VERSION}/ui/dist/css/mico-ui.min.css`,
63
- ],
64
18
 
65
19
  /**
66
20
  * @name MFSU 配置
@@ -15,6 +15,7 @@
15
15
  "start": "npm run dev"
16
16
  },
17
17
  "dependencies": {
18
+ "@arco-iconbox/react-mico": ">=0.0.1",
18
19
  "@mico-platform/ui": "<%= micoUiVersion %>",
19
20
  "@mico-platform/theme": "<%= themeVersion %>",
20
21
  "@umijs/max": "^4.4.8",
@@ -38,6 +38,16 @@ import {
38
38
  } from './common/intl';
39
39
  import { getSubappCurrentLocale } from './common/intl/subappLocale';
40
40
 
41
+ // 子应用独立开发时加载完整 UI 样式;嵌入主应用时由 layout 全局提供
42
+ if (
43
+ process.env.NODE_ENV === 'development' &&
44
+ typeof window !== 'undefined' &&
45
+ !window.__POWERED_BY_QIANKUN__
46
+ ) {
47
+ require('@mico-platform/ui/dist/css/mico-ui.min.css');
48
+ require('@mico-platform/theme/dist/css/theme.css');
49
+ }
50
+
41
51
  // 子应用:将本地 request(自动桥接主应用 / 独立 umi)注入 shared 包,供共享服务层(getRequest)使用
42
52
  // 注意:模块顶层注入,request 函数引用稳定;运行期由 request 内部根据是否处于 qiankun 选用 main / umi
43
53
  configureRequest(request as <T = unknown>(url: string, options?: Record<string, unknown>) => Promise<T>);
@@ -23,5 +23,5 @@ body {
23
23
  #<%= appName %>-root {
24
24
  width: 100%;
25
25
  height: 100%;
26
- background-color: var(--color-fill-1);
26
+ background-color: var(--fill-1);
27
27
  }
@@ -10,27 +10,27 @@
10
10
  padding: @spacing-lg;
11
11
  min-height: 100vh;
12
12
  // 使用主题色变量 - 背景色会随主题切换自动变化
13
- background-color: @color-fill-1;
13
+ background-color: @fill-1;
14
14
  transition: background-color 0.3s ease;
15
15
 
16
16
  &-title {
17
17
  font-size: @font-size-xxl;
18
18
  font-weight: @font-weight-bold;
19
19
  // 主要文字色 - 亮色模式为深色,暗色模式为浅色
20
- color: @color-text-1;
20
+ color: @text-1;
21
21
  margin-bottom: @spacing-md;
22
22
  }
23
23
 
24
24
  &-subtitle {
25
25
  font-size: @font-size-md;
26
26
  // 次要文字色
27
- color: @color-text-2;
27
+ color: @text-2;
28
28
  margin-bottom: @spacing-lg;
29
29
  }
30
30
 
31
31
  &-intl-hint {
32
32
  margin-bottom: @spacing-sm;
33
- color: @color-text-2;
33
+ color: @text-2;
34
34
  }
35
35
 
36
36
  &-intl-meta {
@@ -41,10 +41,10 @@
41
41
  &-card {
42
42
  padding: @card-padding;
43
43
  // 卡片背景色 - 使用 color-text-5(亮色模式为白色)
44
- background-color: @color-text-5;
44
+ background-color: @text-5;
45
45
  border-radius: @border-radius-card;
46
46
  // 边框色
47
- border: 1px solid @color-border-2;
47
+ border: 1px solid @line-2;
48
48
  box-shadow: @shadow-card;
49
49
  margin-bottom: @spacing-md;
50
50
  }
@@ -67,27 +67,27 @@
67
67
  width: 60px;
68
68
  height: 60px;
69
69
  border-radius: @border-radius-md;
70
- border: 1px solid @color-border-2;
70
+ border: 1px solid @line-2;
71
71
  }
72
72
 
73
73
  &-color-label {
74
74
  font-size: @font-size-sm;
75
- color: @color-text-3;
75
+ color: @text-3;
76
76
  }
77
77
 
78
78
  // 品牌色示例
79
- .brand-1 { background-color: @Brand1-6; }
80
- .brand-2 { background-color: @Brand2-6; }
79
+ .brand-1 { background-color: @brand1-6; }
80
+ .brand-2 { background-color: @brand2-6; }
81
81
 
82
82
  // 功能色示例
83
- .success { background-color: @Success-6; }
84
- .warning { background-color: @Warning-6; }
85
- .danger { background-color: @Danger-6; }
83
+ .success { background-color: @success-6; }
84
+ .warning { background-color: @warning-6; }
85
+ .danger { background-color: @danger-6; }
86
86
 
87
87
  // 中性色示例
88
- .fill-1 { background-color: @color-fill-1; }
89
- .fill-2 { background-color: @color-fill-2; }
90
- .fill-3 { background-color: @color-fill-3; }
88
+ .fill-1 { background-color: @fill-1; }
89
+ .fill-2 { background-color: @fill-2; }
90
+ .fill-3 { background-color: @fill-3; }
91
91
 
92
92
  // 按钮示例
93
93
  &-button {
@@ -101,22 +101,22 @@
101
101
  transition: all 0.2s ease;
102
102
 
103
103
  &--primary {
104
- background-color: @Brand1-6;
105
- color: @color-text-5;
104
+ background-color: @brand1-6;
105
+ color: @text-5;
106
106
  border: none;
107
107
 
108
108
  &:hover {
109
- background-color: @Brand1-5;
109
+ background-color: @brand1-5;
110
110
  }
111
111
  }
112
112
 
113
113
  &--secondary {
114
114
  background-color: transparent;
115
- color: @Brand1-6;
116
- border: 1px solid @Brand1-6;
115
+ color: @brand1-6;
116
+ border: 1px solid @brand1-6;
117
117
 
118
118
  &:hover {
119
- background-color: @Brand1-1;
119
+ background-color: @brand1-1;
120
120
  }
121
121
  }
122
122
  }
@@ -128,21 +128,21 @@
128
128
  margin-top: @spacing-lg;
129
129
 
130
130
  &--info {
131
- background-color: @Brand2-1;
132
- border: 1px solid @Brand2-3;
133
- color: @Brand2-7;
131
+ background-color: @brand2-1;
132
+ border: 1px solid @brand2-3;
133
+ color: @brand2-7;
134
134
  }
135
135
 
136
136
  &--success {
137
- background-color: @Success-1;
138
- border: 1px solid @Success-3;
139
- color: @Success-7;
137
+ background-color: @success-1;
138
+ border: 1px solid @success-3;
139
+ color: @success-7;
140
140
  }
141
141
 
142
142
  &--warning {
143
- background-color: @Warning-1;
144
- border: 1px solid @Warning-3;
145
- color: @Warning-7;
143
+ background-color: @warning-1;
144
+ border: 1px solid @warning-3;
145
+ color: @warning-7;
146
146
  }
147
147
  }
148
148
  }
@@ -246,7 +246,7 @@ export default function HomePage() {
246
246
  { label: '邮箱', value: userInfo.email },
247
247
  {
248
248
  label: '角色',
249
- value: <Tag color="arcoblue">{userInfo.role}</Tag>,
249
+ value: <Tag color="dark-blue">{userInfo.role}</Tag>,
250
250
  },
251
251
  { label: '部门', value: userInfo.department },
252
252
  ]}
@@ -369,7 +369,7 @@ export default function HomePage() {
369
369
  <Divider />
370
370
 
371
371
  <Space size="medium">
372
- <Tag color="arcoblue">Arco Blue</Tag>
372
+ <Tag color="dark-blue">Arco Blue</Tag>
373
373
  <Tag color="green">Success</Tag>
374
374
  <Tag color="gold">Warning</Tag>
375
375
  <Tag color="red">Danger</Tag>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-mico-cli",
3
- "version": "0.2.34",
3
+ "version": "1.0.0",
4
4
  "description": "Yeoman generator for Mico CLI projects",
5
5
  "keywords": [
6
6
  "yeoman-generator",
@@ -36,8 +36,8 @@
36
36
  "node": ">=18"
37
37
  },
38
38
  "micoPackages": {
39
- "@mico-platform/ui": "0.x",
40
- "@mico-platform/theme": "0.x"
39
+ "@mico-platform/ui": "1.x",
40
+ "@mico-platform/theme": "1.x"
41
41
  },
42
42
  "dependencies": {
43
43
  "semver": "^7.6.3",