@varlet/cli 3.2.12 → 3.2.14-alpha.1717685185218

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.
@@ -1,3 +1,3 @@
1
1
  export declare function compileMD(path: string, keys: Set<string>): void;
2
- export declare function compileDir(path: string, keys: Set<string>): void;
3
- export declare function compileStyleVars(): void;
2
+ export declare function compileDir(path: string, keys: Set<string>, defaultLanguage: 'zh-CN' | 'en-US'): void;
3
+ export declare function compileStyleVars(): Promise<void>;
@@ -3,6 +3,8 @@ import { SRC_DIR, TYPES_DIR } from '../shared/constant.js';
3
3
  import { resolve } from 'path';
4
4
  import { isDir, isMD } from '../shared/fsUtils.js';
5
5
  import { camelize } from '@varlet/shared';
6
+ import { getVarletConfig } from '../config/varlet.config.js';
7
+ import { get } from 'lodash-es';
6
8
  const { ensureDirSync, readdirSync, readFileSync, writeFileSync } = fse;
7
9
  export function compileMD(path, keys) {
8
10
  const content = readFileSync(path, 'utf-8');
@@ -11,18 +13,21 @@ export function compileMD(path, keys) {
11
13
  keys.add(key.replace(/`/g, ''));
12
14
  });
13
15
  }
14
- export function compileDir(path, keys) {
16
+ export function compileDir(path, keys, defaultLanguage) {
15
17
  const dir = readdirSync(path);
16
18
  dir.forEach((filename) => {
17
19
  const filePath = resolve(path, filename);
18
- isDir(filePath) && compileDir(filePath, keys);
19
- isMD(filePath) && compileMD(filePath, keys);
20
+ isDir(filePath) && compileDir(filePath, keys, defaultLanguage);
21
+ if (isMD(filePath) && filename.includes(defaultLanguage)) {
22
+ compileMD(filePath, keys);
23
+ }
20
24
  });
21
25
  }
22
- export function compileStyleVars() {
26
+ export async function compileStyleVars() {
23
27
  ensureDirSync(TYPES_DIR);
28
+ const defaultLanguage = get(await getVarletConfig(), 'defaultLanguage');
24
29
  const keys = new Set();
25
- compileDir(SRC_DIR, keys);
30
+ compileDir(SRC_DIR, keys, defaultLanguage);
26
31
  let template = [...keys].reduce((template, key) => {
27
32
  template += ` '${key}'?: string\n`;
28
33
  template += ` ${camelize(key.slice(2))}?: string\n`;
@@ -30,6 +30,7 @@ export interface VarletConfigPcHeader {
30
30
  github?: string;
31
31
  changelog?: string;
32
32
  playground?: string;
33
+ ai?: string;
33
34
  themes?: Record<string, string>[];
34
35
  versions?: {
35
36
  name: string;
@@ -1,15 +1,15 @@
1
1
  import { defineConfig } from './varlet.config.js';
2
2
  const title = {
3
- 'zh-CN': '面向 Vue3 Material 风格移动端组件库',
4
- 'en-US': 'Material design mobile components built for Vue3',
3
+ 'zh-CN': 'Varlet - Vue3 Material Design 移动端组件库',
4
+ 'en-US': 'Varlet - Material design mobile components built for Vue3',
5
5
  };
6
6
  const description = {
7
- 'zh-CN': 'Varlet 是一个基于 Vue3 开发的 Material 风格移动端组件库,全面拥抱 Vue3 生态,由社区团队维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件保障良好的开发体验。',
7
+ 'zh-CN': 'Varlet 是一个基于 Vue3 开发的 Material Design 移动端组件库,全面拥抱 Vue3 生态,由社区团队维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件保障良好的开发体验。',
8
8
  'en-US': 'Varlet is a Material design mobile component library developed based on Vue3, developed and maintained by partners in the community. Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience.',
9
9
  };
10
10
  const keywords = {
11
- 'zh-CN': 'Varlet,Vue3 移动端组件库,Material Design',
12
- 'en-US': 'Varlet,Vue3 Mobile Components Library,Material Design',
11
+ 'zh-CN': 'Varlet,UI,Vue3 移动端组件库,Material Design 2,Material Design 3',
12
+ 'en-US': 'Varlet,UI,Vue3 Mobile Components Library,Material Design 2,Material Design 3',
13
13
  };
14
14
  export default defineConfig({
15
15
  name: 'Varlet',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "3.2.12",
3
+ "version": "3.2.14-alpha.1717685185218",
4
4
  "type": "module",
5
5
  "description": "cli of varlet",
6
6
  "bin": {
@@ -64,8 +64,8 @@
64
64
  "semver": "^7.3.5",
65
65
  "sharp": "0.31.1",
66
66
  "typescript": "^5.1.5",
67
- "@varlet/shared": "3.2.12",
68
- "@varlet/vite-plugins": "3.2.12"
67
+ "@varlet/shared": "3.2.14-alpha.1717685185218",
68
+ "@varlet/vite-plugins": "3.2.14-alpha.1717685185218"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/babel__core": "^7.20.1",
@@ -80,9 +80,9 @@
80
80
  "@types/semver": "^7.3.9",
81
81
  "@types/sharp": "0.31.1",
82
82
  "rimraf": "^5.0.1",
83
- "@varlet/ui": "3.2.12",
84
- "@varlet/icons": "3.2.12",
85
- "@varlet/touch-emulator": "3.2.12"
83
+ "@varlet/ui": "3.2.14-alpha.1717685185218",
84
+ "@varlet/icons": "3.2.14-alpha.1717685185218",
85
+ "@varlet/touch-emulator": "3.2.14-alpha.1717685185218"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@vue/runtime-core": "3.4.21",
@@ -95,9 +95,9 @@
95
95
  "lodash-es": "^4.17.21",
96
96
  "vue": "3.4.21",
97
97
  "vue-router": "4.2.0",
98
- "@varlet/ui": "3.2.12",
99
- "@varlet/icons": "3.2.12",
100
- "@varlet/touch-emulator": "3.2.12"
98
+ "@varlet/ui": "3.2.14-alpha.1717685185218",
99
+ "@varlet/icons": "3.2.14-alpha.1717685185218",
100
+ "@varlet/touch-emulator": "3.2.14-alpha.1717685185218"
101
101
  },
102
102
  "scripts": {
103
103
  "dev": "tsc --watch",
@@ -53,7 +53,7 @@ export default {
53
53
  query: {
54
54
  language: lang.value,
55
55
  platform: platform.value,
56
- replace: component.doc
56
+ replace: component.doc,
57
57
  },
58
58
  })
59
59
 
@@ -77,9 +77,7 @@ export default {
77
77
 
78
78
  <style lang="less">
79
79
  .varlet-logo {
80
- height: 100px;
81
80
  padding-top: 30px;
82
- margin-bottom: 20px;
83
81
  }
84
82
 
85
83
  .varlet-home__title {
@@ -96,9 +94,9 @@ export default {
96
94
  }
97
95
 
98
96
  .varlet-home__desc {
99
- margin: 0 0 40px;
100
97
  color: var(--site-config-color-sub-text);
101
98
  font-size: 14px;
99
+ line-height: 22px;
102
100
  }
103
101
 
104
102
  .varlet-home__image {
@@ -68,29 +68,18 @@ function handleClose() {
68
68
  &__logo {
69
69
  height: 36px;
70
70
  border-radius: 8px;
71
- transition: all 0.2s;
72
-
73
- &:hover {
74
- transform: scale(1.1);
75
- }
76
71
  }
77
72
 
78
73
  &__description {
79
74
  display: flex;
80
75
  align-items: center;
81
- height: 32px;
76
+ height: 34px;
82
77
  border-radius: 100px;
83
78
  padding: 0 18px;
84
79
  margin-left: 12px;
85
80
  font-size: 15px;
86
81
  background: #d0bcff;
87
82
  color: #381e72;
88
- transition: all 0.2s;
89
- transform-origin: left;
90
-
91
- &:hover {
92
- transform: scale(1.05);
93
- }
94
83
  }
95
84
 
96
85
  &__close-button {
@@ -33,6 +33,16 @@
33
33
  </transition>
34
34
  </div>
35
35
 
36
+ <a
37
+ class="varlet-site-header__link"
38
+ style="width: auto; border-radius: 3px; padding: 0 12px; height: 40px"
39
+ target="_blank"
40
+ :href="ai"
41
+ v-ripple
42
+ v-if="ai"
43
+ >
44
+ <span>AI Agent</span>
45
+ </a>
36
46
  <a
37
47
  class="varlet-site-header__link"
38
48
  style="margin-right: 8px"
@@ -133,6 +143,7 @@ export default defineComponent({
133
143
  const github: Ref<string> = ref(get(config, 'pc.header.github'))
134
144
  const themes: Ref<Record<string, any>> = ref(get(config, 'pc.header.themes'))
135
145
  const changelog: Ref<string> = ref(get(config, 'pc.header.changelog'))
146
+ const ai: Ref<string> = ref(get(config, 'pc.header.ai'))
136
147
  const redirect = get(config, 'pc.redirect')
137
148
  const darkMode: Ref<boolean> = ref(get(config, 'pc.header.darkMode'))
138
149
  const currentTheme = ref(getBrowserTheme())
@@ -210,6 +221,7 @@ export default defineComponent({
210
221
  nonEmptyLanguages,
211
222
  playground,
212
223
  changelog,
224
+ ai,
213
225
  github,
214
226
  isOpenLanguageMenu,
215
227
  isOpenVersionsMenu,