@varlet/cli 3.2.13 → 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
|
|
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) &&
|
|
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`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "3.2.
|
|
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.
|
|
68
|
-
"@varlet/vite-plugins": "3.2.
|
|
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.
|
|
84
|
-
"@varlet/
|
|
85
|
-
"@varlet/
|
|
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/
|
|
99
|
-
"@varlet/
|
|
100
|
-
"@varlet/
|
|
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",
|
package/site/mobile/AppHome.vue
CHANGED
|
@@ -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 {
|