generator-mico-cli 0.2.19 → 0.2.21
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.
- package/README.md +29 -0
- package/bin/mico.js +124 -5
- package/generators/micro-react/index.js +86 -17
- package/generators/micro-react/templates/.eslintrc.js +24 -1
- package/generators/micro-react/templates/CICD/start_dev.sh +1 -1
- package/generators/micro-react/templates/CLAUDE.md +11 -5
- package/generators/micro-react/templates/_gitignore +2 -0
- package/generators/micro-react/templates/apps/layout/config/config.ts +21 -0
- package/generators/micro-react/templates/apps/layout/docs/common-intl.md +23 -21
- 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
- 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 +61 -36
- package/generators/micro-react/templates/apps/layout/docs/feature-/350/217/234/345/215/225/346/235/203/351/231/220/346/216/247/345/210/266.md +7 -2
- package/generators/micro-react/templates/apps/layout/docs/utils-timezone.md +4 -2
- package/generators/micro-react/templates/apps/layout/mock/menus.ts +7 -2
- package/generators/micro-react/templates/apps/layout/package.json +3 -2
- package/generators/micro-react/templates/apps/layout/src/common/locale.ts +3 -3
- package/generators/micro-react/templates/apps/layout/src/common/menu/parser.ts +3 -15
- package/generators/micro-react/templates/apps/layout/src/common/menu/types.ts +4 -0
- package/generators/micro-react/templates/apps/layout/src/components/MicroAppLoader/index.tsx +1 -1
- package/generators/micro-react/templates/apps/layout/src/global.less +2 -3
- package/generators/micro-react/templates/apps/layout/src/services/config/type.ts +2 -4
- package/generators/micro-react/templates/package.json +5 -2
- package/generators/micro-react/templates/packages/common-intl/README.md +8 -8
- package/generators/micro-react/templates/packages/common-intl/src/intl.ts +13 -5678
- package/generators/micro-react/templates/packages/common-intl/src/utils.ts +22 -21
- package/generators/subapp-react/index.js +81 -13
- package/generators/subapp-react/templates/homepage/config/config.dev.ts +8 -1
- package/generators/subapp-react/templates/homepage/config/config.ts +21 -0
- package/generators/subapp-react/templates/homepage/config/routes.ts +1 -1
- package/generators/subapp-react/templates/homepage/mock/api.mock.ts +2 -2
- package/generators/subapp-react/templates/homepage/package.json +3 -2
- package/generators/subapp-react/templates/homepage/src/app.tsx +1 -1
- package/generators/subapp-react/templates/homepage/src/common/request.ts +2 -2
- package/generators/subapp-react/templates/homepage/src/global.less +2 -1
- package/generators/subapp-react/templates/homepage/src/pages/index.less +1 -1
- package/generators/subapp-react/templates/homepage/src/pages/index.tsx +27 -27
- package/lib/utils.js +200 -2
- package/package.json +1 -1
- package/generators/micro-react/templates/packages/common-intl/.turbo/turbo-build.log +0 -13
- package/generators/micro-react/templates/packages/common-intl/dist/index.d.ts +0 -3
- package/generators/micro-react/templates/packages/common-intl/dist/index.js +0 -4388
- package/generators/micro-react/templates/packages/common-intl/dist/indexedDBUtils.d.ts +0 -13
- package/generators/micro-react/templates/packages/common-intl/dist/intl.d.ts +0 -1022
- package/generators/micro-react/templates/packages/common-intl/dist/utils.d.ts +0 -122
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { isIndexedDBSupported, openDatabase } from './indexedDBUtils';
|
|
2
2
|
|
|
3
|
+
// ============ Window 类型扩展 ============
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 扩展 Window 接口,声明微前端共享的全局翻译缓存
|
|
7
|
+
*/
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
__MICO_COMMON_INTL_TRANSLATIONS__?: Record<string, Record<string, string>>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
// ============ 常量定义 ============
|
|
4
15
|
|
|
5
16
|
export const LANG = {
|
|
@@ -75,14 +86,6 @@ const API_CONFIG = {
|
|
|
75
86
|
|
|
76
87
|
// ============ 全局状态 ============
|
|
77
88
|
|
|
78
|
-
/**
|
|
79
|
-
* 微前端共享全局状态 Key
|
|
80
|
-
* 在 qiankun 微前端架构中,主应用和子应用各自有独立的 JS 运行时,
|
|
81
|
-
* 模块级变量无法共享。使用 window 对象存储全局状态,确保主应用获取到的文案
|
|
82
|
-
* 可以被所有子应用访问。
|
|
83
|
-
*/
|
|
84
|
-
const GLOBAL_TRANSLATIONS_KEY = '__MICO_COMMON_INTL_TRANSLATIONS__';
|
|
85
|
-
|
|
86
89
|
/**
|
|
87
90
|
* 语言管理工具
|
|
88
91
|
* 支持三种配置渠道,优先级从高到低:
|
|
@@ -136,7 +139,7 @@ function getBrowserLocale(): ILang {
|
|
|
136
139
|
if (typeof window === 'undefined') {
|
|
137
140
|
return DEFAULT_LOCALE;
|
|
138
141
|
}
|
|
139
|
-
const browserLang = navigator.language
|
|
142
|
+
const browserLang = navigator.language;
|
|
140
143
|
// 检查语言前缀(如 zh-TW -> zh-CN)
|
|
141
144
|
const langPrefix = browserLang.split('-')[0];
|
|
142
145
|
const matchedLocale = SUPPORTED_LOCALES.find((locale) =>
|
|
@@ -194,12 +197,12 @@ export function setLocaleToStorage(locale: ILang): void {
|
|
|
194
197
|
* 获取共享的翻译缓存对象
|
|
195
198
|
*/
|
|
196
199
|
function getSharedTranslationsCache(): Record<string, Record<string, string>> {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
if (typeof window !== "undefined") {
|
|
201
|
+
if (!window.__MICO_COMMON_INTL_TRANSLATIONS__) {
|
|
202
|
+
window.__MICO_COMMON_INTL_TRANSLATIONS__ = {};
|
|
203
|
+
}
|
|
204
|
+
return window.__MICO_COMMON_INTL_TRANSLATIONS__;
|
|
205
|
+
}
|
|
203
206
|
// 非浏览器环境使用本地缓存
|
|
204
207
|
return {};
|
|
205
208
|
}
|
|
@@ -313,8 +316,6 @@ function getTranslationsFromCacheSync(
|
|
|
313
316
|
// ============ i18n 函数 ============
|
|
314
317
|
|
|
315
318
|
/**
|
|
316
|
-
* @see https://micoworld.feishu.cn/wiki/wikcnBMzhhc8qpAVawAoySZanrg#DS1YNZ
|
|
317
|
-
*
|
|
318
319
|
* 国际化翻译函数
|
|
319
320
|
*
|
|
320
321
|
* 从全局变量缓存中获取翻译后的文案,支持插值替换
|
|
@@ -327,17 +328,17 @@ function getTranslationsFromCacheSync(
|
|
|
327
328
|
*
|
|
328
329
|
* @example
|
|
329
330
|
* // 无插值示例
|
|
330
|
-
* i18n({ key: '
|
|
331
|
+
* i18n({ key: 'common_cancel', defaultMessage: '取消' })
|
|
331
332
|
* // 返回 'Cancel' 或兜底文案 '取消'
|
|
332
333
|
*
|
|
333
334
|
* @example
|
|
334
335
|
* // 单个插值示例
|
|
335
|
-
* i18n({ key: '
|
|
336
|
+
* i18n({ key: 'common_page_total_count', interpolations: [pagination.total], defaultMessage: `总数量: ${pagination.total}条` })
|
|
336
337
|
* // 如果翻译文案为 '总数量: %AA%条',则返回 '总数量: 100条'
|
|
337
338
|
*
|
|
338
339
|
* @example
|
|
339
340
|
* // 多个插值示例
|
|
340
|
-
* i18n({ key: '
|
|
341
|
+
* i18n({ key: 'some_key', interpolations: [valueA, valueB, valueC], defaultMessage: `XXX${valueA}YYY${valueB}ZZZ${valueC}` })
|
|
341
342
|
* // 如果翻译文案为 'XXX%AA%YYY%BB%ZZZ%CC%',则按顺序替换占位符
|
|
342
343
|
*/
|
|
343
344
|
export function i18n({
|
|
@@ -433,7 +434,7 @@ export function initIntl(params: IInitIntlParams) {
|
|
|
433
434
|
throw new Error('参数 app_name 不能为空');
|
|
434
435
|
}
|
|
435
436
|
|
|
436
|
-
// @ts-
|
|
437
|
+
// @ts-expect-error - process.env 类型在不同构建环境中可能不兼容
|
|
437
438
|
return requestInstance(process.env.LOCALE_REQUEST_URL || API_CONFIG[process.env.REACT_APP_ENV as keyof typeof API_CONFIG] || API_CONFIG.production, {
|
|
438
439
|
method: 'GET',
|
|
439
440
|
params: {
|
|
@@ -9,10 +9,10 @@ const {
|
|
|
9
9
|
collectFiles,
|
|
10
10
|
transformDestPath,
|
|
11
11
|
isTemplateFile,
|
|
12
|
-
|
|
12
|
+
getPackageVersionsParallel,
|
|
13
13
|
setupErrorHandlers,
|
|
14
14
|
createLogger,
|
|
15
|
-
|
|
15
|
+
loadMicorc,
|
|
16
16
|
} = require('../../lib/utils');
|
|
17
17
|
|
|
18
18
|
const IGNORE_LIST = require('./ignore-list.json');
|
|
@@ -24,6 +24,18 @@ module.exports = class extends Generator {
|
|
|
24
24
|
initializing() {
|
|
25
25
|
this.monorepoRoot = process.cwd();
|
|
26
26
|
this.logger = createLogger(this);
|
|
27
|
+
|
|
28
|
+
// 检查 dry-run 模式
|
|
29
|
+
this.isDryRun = this.options.dryRun || process.env.MICO_DRY_RUN === '1';
|
|
30
|
+
|
|
31
|
+
// 加载 .micorc 配置
|
|
32
|
+
const { config: rcConfig, configPath } = loadMicorc(this.monorepoRoot);
|
|
33
|
+
this.rcConfig = rcConfig;
|
|
34
|
+
if (configPath) {
|
|
35
|
+
this.logger.verbose('Loaded config from:', configPath);
|
|
36
|
+
this.logger.verbose('Config:', JSON.stringify(rcConfig, null, 2));
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
const appsDir = path.join(this.monorepoRoot, 'apps');
|
|
28
40
|
const workspaceFile = path.join(this.monorepoRoot, 'pnpm-workspace.yaml');
|
|
29
41
|
|
|
@@ -77,13 +89,14 @@ module.exports = class extends Generator {
|
|
|
77
89
|
}
|
|
78
90
|
|
|
79
91
|
const detectedScope = this._detectPackageScope();
|
|
92
|
+
const rc = this.rcConfig || {};
|
|
80
93
|
|
|
81
94
|
this.answers = await this.prompt([
|
|
82
95
|
{
|
|
83
96
|
type: 'input',
|
|
84
97
|
name: 'appName',
|
|
85
98
|
message: 'Sub app name',
|
|
86
|
-
default: 'subapp',
|
|
99
|
+
default: rc.defaultSubappName || 'subapp',
|
|
87
100
|
filter: (input) => toKebab(input),
|
|
88
101
|
validate: (input) => {
|
|
89
102
|
const value = toKebab(input);
|
|
@@ -99,7 +112,7 @@ module.exports = class extends Generator {
|
|
|
99
112
|
type: 'input',
|
|
100
113
|
name: 'packageScope',
|
|
101
114
|
message: 'Package scope',
|
|
102
|
-
default: detectedScope || '@my-project',
|
|
115
|
+
default: rc.packageScope || detectedScope || '@my-project',
|
|
103
116
|
validate: (input) => {
|
|
104
117
|
if (!input) return 'Package scope is required';
|
|
105
118
|
if (!input.startsWith('@')) return 'Package scope must start with @';
|
|
@@ -122,7 +135,7 @@ module.exports = class extends Generator {
|
|
|
122
135
|
}
|
|
123
136
|
}
|
|
124
137
|
|
|
125
|
-
writing() {
|
|
138
|
+
async writing() {
|
|
126
139
|
try {
|
|
127
140
|
if (!fs.existsSync(this.templateDir)) {
|
|
128
141
|
console.error('');
|
|
@@ -132,20 +145,25 @@ module.exports = class extends Generator {
|
|
|
132
145
|
process.exit(1);
|
|
133
146
|
}
|
|
134
147
|
|
|
135
|
-
this.log('');
|
|
136
|
-
this.log(`📦 Creating sub-app: ${this.appName}`);
|
|
137
|
-
this.log(` Destination: apps/${this.appName}`);
|
|
138
|
-
this.log('');
|
|
139
|
-
|
|
140
148
|
this.logger.verbose('Template directory:', this.templateDir);
|
|
141
149
|
this.logger.verbose('Destination directory:', this.destDir);
|
|
142
150
|
|
|
143
151
|
// 在 mico_cli 根目录执行 npm view,以使用该目录 .npmrc 中的 Nexus 认证
|
|
144
152
|
const cliRoot = path.resolve(__dirname, '../..');
|
|
145
|
-
this.logger.verbose('Fetching latest package versions...');
|
|
153
|
+
this.logger.verbose('Fetching latest package versions (parallel)...');
|
|
154
|
+
|
|
155
|
+
// 并行获取版本
|
|
156
|
+
const versions = await getPackageVersionsParallel(
|
|
157
|
+
[
|
|
158
|
+
{ name: '@mico-platform/ui', fallback: '1.0.0' },
|
|
159
|
+
{ name: '@mico-platform/theme', fallback: '1.0.0' },
|
|
160
|
+
],
|
|
161
|
+
8000,
|
|
162
|
+
cliRoot,
|
|
163
|
+
);
|
|
146
164
|
|
|
147
|
-
const micoUiVer =
|
|
148
|
-
const themeVer =
|
|
165
|
+
const micoUiVer = versions['@mico-platform/ui'];
|
|
166
|
+
const themeVer = versions['@mico-platform/theme'];
|
|
149
167
|
|
|
150
168
|
this.logger.verbose('@mico-platform/ui version:', micoUiVer);
|
|
151
169
|
this.logger.verbose('@mico-platform/theme version:', themeVer);
|
|
@@ -171,6 +189,50 @@ module.exports = class extends Generator {
|
|
|
171
189
|
process.exit(1);
|
|
172
190
|
}
|
|
173
191
|
|
|
192
|
+
// Dry-run 模式:只列出文件,不实际创建
|
|
193
|
+
if (this.isDryRun) {
|
|
194
|
+
this.log('');
|
|
195
|
+
this.log('\x1b[33m📋 Dry run mode - no files will be created\x1b[0m');
|
|
196
|
+
this.log('');
|
|
197
|
+
this.log(` Sub-app: ${this.appName}`);
|
|
198
|
+
this.log(` Scope: ${this.packageScope}`);
|
|
199
|
+
this.log(` Destination: apps/${this.appName}`);
|
|
200
|
+
this.log('');
|
|
201
|
+
this.log(' Would create the following files:');
|
|
202
|
+
this.log('');
|
|
203
|
+
|
|
204
|
+
let templateCount = 0;
|
|
205
|
+
let copyCount = 0;
|
|
206
|
+
|
|
207
|
+
for (const relPath of files) {
|
|
208
|
+
const destRelPath = transformDestPath(relPath);
|
|
209
|
+
const isTemplate = isTemplateFile(relPath);
|
|
210
|
+
const tag = isTemplate ? '\x1b[32m[tpl]\x1b[0m' : '\x1b[36m[cpy]\x1b[0m';
|
|
211
|
+
this.log(` ${tag} apps/${this.appName}/${destRelPath}`);
|
|
212
|
+
|
|
213
|
+
if (isTemplate) {
|
|
214
|
+
templateCount++;
|
|
215
|
+
} else {
|
|
216
|
+
copyCount++;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
this.log('');
|
|
221
|
+
this.log(` Total: ${files.length} files (${templateCount} templates, ${copyCount} static)`);
|
|
222
|
+
this.log('');
|
|
223
|
+
this.log(' Run without --dry-run to actually create these files.');
|
|
224
|
+
this.log('');
|
|
225
|
+
|
|
226
|
+
// 设置标记以跳过后续阶段
|
|
227
|
+
this._skipInstall = true;
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
this.log('');
|
|
232
|
+
this.log(`📦 Creating sub-app: ${this.appName}`);
|
|
233
|
+
this.log(` Destination: apps/${this.appName}`);
|
|
234
|
+
this.log('');
|
|
235
|
+
|
|
174
236
|
this.logger.verbose(`Processing ${files.length} files...`);
|
|
175
237
|
|
|
176
238
|
let templateCount = 0;
|
|
@@ -203,6 +265,9 @@ module.exports = class extends Generator {
|
|
|
203
265
|
}
|
|
204
266
|
|
|
205
267
|
install() {
|
|
268
|
+
// 跳过 dry-run 模式
|
|
269
|
+
if (this._skipInstall) return;
|
|
270
|
+
|
|
206
271
|
this.log('');
|
|
207
272
|
this.log('📦 正在安装依赖...');
|
|
208
273
|
this.spawnCommandSync('pnpm', ['install'], {
|
|
@@ -211,6 +276,9 @@ module.exports = class extends Generator {
|
|
|
211
276
|
}
|
|
212
277
|
|
|
213
278
|
end() {
|
|
279
|
+
// 跳过 dry-run 模式
|
|
280
|
+
if (this._skipInstall) return;
|
|
281
|
+
|
|
214
282
|
this.log('');
|
|
215
283
|
this.log('✅ 子应用创建成功!');
|
|
216
284
|
this.log('');
|
|
@@ -2,6 +2,13 @@
|
|
|
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
|
+
|
|
5
12
|
/**
|
|
6
13
|
* 开发环境配置
|
|
7
14
|
* - 不配置 externals,直接打包依赖,方便独立运行调试
|
|
@@ -52,7 +59,7 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
52
59
|
*/
|
|
53
60
|
styles: [
|
|
54
61
|
// @mico-platform/ui 基础样式(使用运行时解析的最新版本号,避免 latest 标签)
|
|
55
|
-
|
|
62
|
+
`https://cdn-portal.micoplatform.com/portal-center/mico-ui/${MICO_UI_VERSION}/ui/dist/css/mico-ui.min.css`,
|
|
56
63
|
],
|
|
57
64
|
};
|
|
58
65
|
|
|
@@ -102,6 +102,27 @@ const config: ReturnType<typeof defineConfig> = {
|
|
|
102
102
|
codeSplitting: {
|
|
103
103
|
jsStrategy: 'granularChunks',
|
|
104
104
|
},
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @name 额外 Babel Presets
|
|
108
|
+
* @description 使用 @mico-platform/ui 的 babel preset,实现组件与图标的按需加载
|
|
109
|
+
*/
|
|
110
|
+
extraBabelPresets: ['@mico-platform/ui/babel-preset'],
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @name MFSU 配置
|
|
114
|
+
* @description
|
|
115
|
+
* - exclude: theme 子路径解析;ui 尽量与主应用一起编译
|
|
116
|
+
* - shared: React 单例,确保 MFSU 预打包里的组件(如 UI 库)与应用共用同一份 React,否则 useContext 报 null
|
|
117
|
+
* @doc https://umijs.org/docs/guides/mfsu
|
|
118
|
+
*/
|
|
119
|
+
mfsu: {
|
|
120
|
+
exclude: ['@mico-platform/theme', '@mico-platform/ui'],
|
|
121
|
+
shared: {
|
|
122
|
+
react: { singleton: true },
|
|
123
|
+
'react-dom': { singleton: true },
|
|
124
|
+
},
|
|
125
|
+
},
|
|
105
126
|
};
|
|
106
127
|
|
|
107
128
|
export default defineConfig(config);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name Mock API
|
|
3
|
-
* @description
|
|
3
|
+
* @description <%= appName %> 子应用的 Mock 数据
|
|
4
4
|
* @doc https://umijs.org/docs/guides/mock
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
// id: 1001,
|
|
13
13
|
// name: '张三',
|
|
14
14
|
// email: 'zhangsan@example.com',
|
|
15
|
-
// avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed
|
|
15
|
+
// avatar: 'https://api.dicebear.com/7.x/avataaars/svg?seed=<%= appName %>',
|
|
16
16
|
// role: 'admin',
|
|
17
17
|
// department: '技术部',
|
|
18
18
|
// },
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@mico-platform/theme": "<%= themeVersion %>",
|
|
19
19
|
"@umijs/max": "^4.4.8",
|
|
20
|
-
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
21
|
-
"cross-env": "^10.1.0",
|
|
22
20
|
"react": "^18.2.0",
|
|
23
21
|
"react-dom": "^18.2.0"
|
|
24
22
|
},
|
|
@@ -26,6 +24,9 @@
|
|
|
26
24
|
"@mico-platform/ui": "<%= micoUiVersion %>",
|
|
27
25
|
"@types/react": "^18.0.33",
|
|
28
26
|
"@types/react-dom": "^18.0.11",
|
|
27
|
+
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
28
|
+
"babel-plugin-import": "^1.13.8",
|
|
29
|
+
"cross-env": "^10.1.0",
|
|
29
30
|
"typescript": "^5.0.3"
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -26,12 +26,12 @@ export async function request<T = any>(
|
|
|
26
26
|
|
|
27
27
|
if (mainAppRequest) {
|
|
28
28
|
// 微前端模式:使用主应用的 request
|
|
29
|
-
console.log('[
|
|
29
|
+
console.log('[<%= appName %>] Using main app request:', url);
|
|
30
30
|
return mainAppRequest<T>(url, options);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// 独立运行模式:使用 umi request
|
|
34
|
-
console.log('[
|
|
34
|
+
console.log('[<%= appName %>] Using umi request:', url);
|
|
35
35
|
// umi request 默认返回 data,skipErrorHandler 可选
|
|
36
36
|
return umiRequest<T>(url, {
|
|
37
37
|
skipErrorHandler: true,
|
|
@@ -135,7 +135,7 @@ export default function HomePage() {
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
return (
|
|
138
|
-
<div className="
|
|
138
|
+
<div className="<%= appName %>">
|
|
139
139
|
<Title heading={2}>🎨 子应用主题 & 组件示例</Title>
|
|
140
140
|
<Paragraph type="secondary">
|
|
141
141
|
子应用复用主应用的 React 和 @mico-platform/ui,无重复打包,主题自动同步
|
|
@@ -316,44 +316,44 @@ export default function HomePage() {
|
|
|
316
316
|
</Paragraph>
|
|
317
317
|
|
|
318
318
|
<Title heading={6}>品牌色 & 功能色</Title>
|
|
319
|
-
<div className="
|
|
320
|
-
<div className="
|
|
321
|
-
<div className="
|
|
322
|
-
<span className="
|
|
319
|
+
<div className="<%= appName %>-colors">
|
|
320
|
+
<div className="<%= appName %>-color-item">
|
|
321
|
+
<div className="<%= appName %>-color-box brand-1" />
|
|
322
|
+
<span className="<%= appName %>-color-label">@Brand1-6</span>
|
|
323
323
|
</div>
|
|
324
|
-
<div className="
|
|
325
|
-
<div className="
|
|
326
|
-
<span className="
|
|
324
|
+
<div className="<%= appName %>-color-item">
|
|
325
|
+
<div className="<%= appName %>-color-box brand-2" />
|
|
326
|
+
<span className="<%= appName %>-color-label">@Brand2-6</span>
|
|
327
327
|
</div>
|
|
328
|
-
<div className="
|
|
329
|
-
<div className="
|
|
330
|
-
<span className="
|
|
328
|
+
<div className="<%= appName %>-color-item">
|
|
329
|
+
<div className="<%= appName %>-color-box success" />
|
|
330
|
+
<span className="<%= appName %>-color-label">@Success-6</span>
|
|
331
331
|
</div>
|
|
332
|
-
<div className="
|
|
333
|
-
<div className="
|
|
334
|
-
<span className="
|
|
332
|
+
<div className="<%= appName %>-color-item">
|
|
333
|
+
<div className="<%= appName %>-color-box warning" />
|
|
334
|
+
<span className="<%= appName %>-color-label">@Warning-6</span>
|
|
335
335
|
</div>
|
|
336
|
-
<div className="
|
|
337
|
-
<div className="
|
|
338
|
-
<span className="
|
|
336
|
+
<div className="<%= appName %>-color-item">
|
|
337
|
+
<div className="<%= appName %>-color-box danger" />
|
|
338
|
+
<span className="<%= appName %>-color-label">@Danger-6</span>
|
|
339
339
|
</div>
|
|
340
340
|
</div>
|
|
341
341
|
|
|
342
342
|
<Title heading={6} style={{ marginTop: 16 }}>
|
|
343
343
|
中性色(随主题自动切换)
|
|
344
344
|
</Title>
|
|
345
|
-
<div className="
|
|
346
|
-
<div className="
|
|
347
|
-
<div className="
|
|
348
|
-
<span className="
|
|
345
|
+
<div className="<%= appName %>-colors">
|
|
346
|
+
<div className="<%= appName %>-color-item">
|
|
347
|
+
<div className="<%= appName %>-color-box fill-1" />
|
|
348
|
+
<span className="<%= appName %>-color-label">@color-fill-1</span>
|
|
349
349
|
</div>
|
|
350
|
-
<div className="
|
|
351
|
-
<div className="
|
|
352
|
-
<span className="
|
|
350
|
+
<div className="<%= appName %>-color-item">
|
|
351
|
+
<div className="<%= appName %>-color-box fill-2" />
|
|
352
|
+
<span className="<%= appName %>-color-label">@color-fill-2</span>
|
|
353
353
|
</div>
|
|
354
|
-
<div className="
|
|
355
|
-
<div className="
|
|
356
|
-
<span className="
|
|
354
|
+
<div className="<%= appName %>-color-item">
|
|
355
|
+
<div className="<%= appName %>-color-box fill-3" />
|
|
356
|
+
<span className="<%= appName %>-color-label">@color-fill-3</span>
|
|
357
357
|
</div>
|
|
358
358
|
</div>
|
|
359
359
|
</Card>
|