@hr-components-dev/cli 1.1.7 → 1.1.9

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@hr-components-dev/cli",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "packageManager": "pnpm@10.23.0",
8
+ "packageManager": "pnpm@10.28.0",
9
9
  "keywords": [
10
10
  "hrisv",
11
11
  "hr",
@@ -37,7 +37,7 @@
37
37
  "!**/*.spec.js"
38
38
  ],
39
39
  "dependencies": {
40
- "@fortawesome/fontawesome-free": "^7.1.0",
40
+ "@fortawesome/fontawesome-free": "^7.2.0",
41
41
  "@vue/tsconfig": "^0.8.1",
42
42
  "ts-node": "^10.9.2"
43
43
  },
@@ -59,10 +59,10 @@
59
59
  "vue": "^3.5.25"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/lodash": "^4.17.21",
63
- "@types/node": "^24.10.1",
64
- "@types/react": "^19.2.7",
62
+ "@types/lodash": "^4.17.23",
63
+ "@types/node": "^25.2.3",
64
+ "@types/react": "^19.2.13",
65
65
  "typescript": "~5.9.3",
66
- "vue-tsc": "^3.1.5"
66
+ "vue-tsc": "^3.2.4"
67
67
  }
68
68
  }
@@ -5,6 +5,18 @@ import { reactive, ref, toRefs } from 'vue';
5
5
  import AmisRenderer from './components/amis.vue';
6
6
  import { ConvertSchemaMarkToJSON, evalFc } from './components/utils/evalScope';
7
7
 
8
+
9
+ // amisData数据类型
10
+ type DefaultAmisDataType = {
11
+ entity: any;
12
+ view: any;
13
+ "sys架构": string;
14
+ env: boolean;
15
+ user: any;
16
+ theme: 'light' | 'dark' | 'auto';
17
+ lang: 'en-US' | 'zh-CN';
18
+ }
19
+
8
20
  /**
9
21
  * 预览后的页面 Schema
10
22
  */
@@ -232,7 +244,7 @@ const defaultSchema = ref<Schema>({
232
244
  /**
233
245
  * amis 顶级 data 数据
234
246
  */
235
- const defaultAmisData = ref({
247
+ const defaultAmisData = ref<DefaultAmisDataType>({
236
248
  entity: {
237
249
  "icon": "fa fa-file",
238
250
  "_id": "6490433386348a0a8db0ad27",
@@ -259,13 +271,17 @@ const defaultAmisData = ref({
259
271
  "roles": [
260
272
  "630c897c962bc822fe5c3767"
261
273
  ]
262
- }
274
+ },
275
+ theme: 'dark',
276
+ lang: "zh-CN"
263
277
  });
264
278
  /**
265
279
  * amis context 数据
266
280
  */
267
281
  const defaultAmisContext = ref({
268
- onInit: (amisInstance?: IScopedContext & amis.TypeEmbed) => consola.success('onInit事件触发:', amisInstance)
282
+ onInit: (amisInstance?: IScopedContext & amis.TypeEmbed) => consola.success('onInit事件触发:', amisInstance),
283
+ changeLocale: (lang: 'en-US' | 'zh-CN'): void => { consola.log('changeLocale', lang) },
284
+ changeTheme: (): void => { consola.log('changeTheme') }
269
285
  });
270
286
  const amisReady = (amisInstance: IScopedContext & amis.TypeEmbed) => {
271
287
  instance.value = amisInstance;
@@ -10,7 +10,7 @@ import consola from 'consola';
10
10
  * 创建软链接
11
11
  */
12
12
  function BuildSoftLink() {
13
- consola.info('=== 开始构建软链接... ===');
13
+ // consola.info('=== 开始构建软链接... ===');
14
14
 
15
15
  try {
16
16
  // 组件源目录 (项目根目录下的 src/components)
@@ -18,8 +18,8 @@ function BuildSoftLink() {
18
18
  // 目标链接位置 (cli 子包根目录下的 src/components)
19
19
  const target = resolve(targetPackageDir, 'src/components');
20
20
 
21
- consola.info(`源目录: ${source}`);
22
- consola.info(`目标链接: ${target}`);
21
+ // consola.info(`源目录: ${source}`);
22
+ // consola.info(`目标链接: ${target}`);
23
23
 
24
24
  // 检查源目录是否存在
25
25
  if (!existsSync(source)) {
@@ -30,13 +30,13 @@ function BuildSoftLink() {
30
30
  // 如果目标链接已存在,则删除它
31
31
  if (existsSync(target)) {
32
32
  unlinkSync(target);
33
- consola.info('已删除现有链接');
33
+ // consola.info('已删除现有链接');
34
34
  }
35
35
 
36
36
  // 创建软链接
37
37
  symlinkSync(source, target, 'junction'); // 使用 junction 在 Windows 上更兼容
38
38
 
39
- consola.success('软链接创建成功!');
39
+ // consola.success('软链接创建成功!');
40
40
  consola.info(`${target} -> ${source}`);
41
41
 
42
42
  } catch (error) {