@varlet/cli 3.15.0-alpha.1776572752298 → 3.15.0-alpha.1776609013808
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 +7 -7
- package/README.zh-CN.md +7 -7
- package/lib/node/commands/gen.js +4 -0
- package/package.json +9 -9
- package/template/generators/base/.vscode/extensions.json +3 -0
- package/template/generators/base/.vscode/settings.json +5 -0
- package/template/generators/base/package.json +0 -1
- package/template/generators/base/tsconfig.template.json +20 -0
- package/template/generators/config/default/base/varlet.config.mjs +85 -2
- package/template/generators/config/i18n/base/varlet.config.mjs +81 -0
- package/template/generators/config/i18n/sfc/src/locale/en-US.d.ts +2 -2
- package/template/generators/config/i18n/sfc/src/locale/zh-CN.d.ts +2 -2
- package/template/generators/config/i18n/tsx/src/locale/en-US.d.ts +2 -2
- package/template/generators/config/i18n/tsx/src/locale/zh-CN.d.ts +2 -2
- package/template/generators/base/tsconfig.json +0 -14
- /package/template/generators/base/{vite.config.ts → vite.config.mts} +0 -0
package/README.md
CHANGED
|
@@ -22,19 +22,19 @@ The out-of-the-box `Vue3 component library` rapid prototyping tool provides a se
|
|
|
22
22
|
|
|
23
23
|
### Recommended toolchain
|
|
24
24
|
|
|
25
|
-
Under Varlet’s current
|
|
25
|
+
Under Varlet’s current `component-library toolchain`, we recommend combining `@varlet/cli`, [`vite-plus`](https://viteplus.dev/) (`vp`), and `rattail` (`rt`, npm package `rattail`): `@varlet/cli` covers first-party library workflows (docs, compile, tests, …), `vp` covers lint/format and app/extension build entrypoints aligned with the Ox/Rolldown stack, and `rt` covers `clean`, git hooks, `changelog`, `release`, `commit-lint`, and similar automation. Use this trio for new libraries, scaffold upgrades, or whenever you re-run `varlet-cli gen` to match the built-in template.
|
|
26
26
|
|
|
27
27
|
| Piece | Role |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
29
|
+
| `@varlet/cli` | First-party Varlet workflows: `create`, `gen`, `dev`, `build`, `preview`, `compile`, `compile:style-vars`, `build:icons`, `test`, … |
|
|
30
|
+
| [`vite-plus`](https://viteplus.dev/) (`vp`) | Lint, format, app/extension `build`/`dev`/`preview`, and other toolchain entrypoints aligned with the Ox/Rolldown stack |
|
|
31
|
+
| `rattail` (`rt`, npm package `rattail`) | `clean`, git hooks, `changelog`, `release`, `commit-lint`, and other repo automation |
|
|
32
32
|
|
|
33
|
-
After upgrading `@varlet/cli`, you can align an existing app with the
|
|
33
|
+
After upgrading `@varlet/cli`, you can align an existing app with the built-in template by running `varlet-cli gen` again from the parent directory (commit or back up first; `gen` may overwrite generated files).
|
|
34
34
|
|
|
35
35
|
### Legacy subcommands (prefer alternatives)
|
|
36
36
|
|
|
37
|
-
These subcommands
|
|
37
|
+
These subcommands still run for backward compatibility and may print a deprecation notice. Do not rely on them in new scripts or new projects — prefer `vp` / `rt` (or `vr` where documented). Any future changes will be called out in release notes.
|
|
38
38
|
|
|
39
39
|
| Command | Use instead |
|
|
40
40
|
| --- | --- |
|
|
@@ -43,7 +43,7 @@ These subcommands **still run** for backward compatibility and may print a depre
|
|
|
43
43
|
| `varlet-cli dev:extension` | `vp pack --watch` (with a local `vite.config.ts` for the extension) |
|
|
44
44
|
| `varlet-cli build:extension` | `vp pack` |
|
|
45
45
|
| `varlet-cli commit-lint` | `rt commit-lint` |
|
|
46
|
-
| `varlet-cli checklist` |
|
|
46
|
+
| `varlet-cli checklist` | Minimal value; deprecated without replacement |
|
|
47
47
|
| `varlet-cli changelog` | `rt changelog` |
|
|
48
48
|
| `varlet-cli release` | `rt release` (or `vr release` from `@varlet/release`) |
|
|
49
49
|
|
package/README.zh-CN.md
CHANGED
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
|
|
23
23
|
### 推荐技术栈
|
|
24
24
|
|
|
25
|
-
在全新的
|
|
25
|
+
在全新的 `Varlet 组件库工具链` 体系下,我们建议将 `@varlet/cli`、[`vite-plus`](https://viteplus.dev/)(`vp`)与 `rattail`(`rt`,npm 包 `rattail`)组合使用:前者覆盖组件库文档站与编译等一等能力,后两者承接与 Ox / Rolldown 栈一致的 lint、format、打包入口,以及 `clean`、Git 钩子、`changelog`、`release`、`commit-lint` 等工程自动化。无论是从零搭建新库,还是升级旧脚手架、需要与模板对齐时,都推荐沿用这一组合。
|
|
26
26
|
|
|
27
27
|
| 部分 | 作用 |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
29
|
+
| `@varlet/cli` | Varlet 一等能力:`create`、`gen`、`dev`、`build`、`preview`、`compile`、`compile:style-vars`、`build:icons`、`test` 等 |
|
|
30
|
+
| [`vite-plus`](https://viteplus.dev/)(`vp`) | 与 Ox / Rolldown 栈一致的 lint、format、应用/扩展的 `build`/`dev`/`preview` 等入口 |
|
|
31
|
+
| `rattail`(`rt`,npm 包 `rattail`) | `clean`、Git 钩子、`changelog`、`release`、`commit-lint` 等工程自动化 |
|
|
32
32
|
|
|
33
|
-
升级 `@varlet/cli` 后,可在上级目录再次执行
|
|
33
|
+
升级 `@varlet/cli` 后,可在上级目录再次执行 `varlet-cli gen`,将已有工程与内置模板对齐(请先提交或备份;`gen` 可能覆盖生成型文件)。
|
|
34
34
|
|
|
35
35
|
### 不建议继续使用的子命令
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
以下子命令仍可执行(会给出废弃相关提示),但不应在新脚本或新工程中再依赖,请优先改用 `vp` / `rt`(或文档中的 `vr`)。具体时间表以后续发布说明为准。
|
|
38
38
|
|
|
39
39
|
| 命令 | 请改用 |
|
|
40
40
|
| --- | --- |
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
| `varlet-cli dev:extension` | `vp pack --watch`(扩展包内需有本地 `vite.config.ts`) |
|
|
44
44
|
| `varlet-cli build:extension` | `vp pack` |
|
|
45
45
|
| `varlet-cli commit-lint` | `rt commit-lint` |
|
|
46
|
-
| `varlet-cli checklist` |
|
|
46
|
+
| `varlet-cli checklist` | 用处极小,直接废弃 |
|
|
47
47
|
| `varlet-cli changelog` | `rt changelog` |
|
|
48
48
|
| `varlet-cli release` | `rt release`(或 `@varlet/release` 提供的 `vr release`) |
|
|
49
49
|
|
package/lib/node/commands/gen.js
CHANGED
|
@@ -58,6 +58,10 @@ export async function gen(options) {
|
|
|
58
58
|
await copy(configBase, dest);
|
|
59
59
|
await copy(code, dest);
|
|
60
60
|
await rename(resolve(dest, '_gitignore'), resolve(dest, '.gitignore'));
|
|
61
|
+
const scaffoldTsconfigPath = resolve(dest, 'tsconfig.template.json');
|
|
62
|
+
if (pathExistsSync(scaffoldTsconfigPath)) {
|
|
63
|
+
await rename(scaffoldTsconfigPath, resolve(dest, 'tsconfig.json'));
|
|
64
|
+
}
|
|
61
65
|
syncVersion(name);
|
|
62
66
|
logger.success('✨ Application generated successfully!');
|
|
63
67
|
logger.info(`\
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "3.15.0-alpha.
|
|
3
|
+
"version": "3.15.0-alpha.1776609013808",
|
|
4
4
|
"description": "cli of varlet",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"typescript": "5.6.3",
|
|
57
57
|
"vite-plus": "0.1.18",
|
|
58
58
|
"vue": "3.5.21",
|
|
59
|
-
"@varlet/
|
|
60
|
-
"@varlet/
|
|
59
|
+
"@varlet/shared": "3.15.0-alpha.1776609013808",
|
|
60
|
+
"@varlet/vite-plugins": "3.15.0-alpha.1776609013808"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/babel__core": "^7.20.1",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"@types/node": "^20.19.0",
|
|
70
70
|
"@types/sharp": "0.31.1",
|
|
71
71
|
"rimraf": "^5.0.1",
|
|
72
|
-
"@varlet/icons": "3.15.0-alpha.
|
|
73
|
-
"@varlet/touch-emulator": "3.15.0-alpha.
|
|
74
|
-
"@varlet/ui": "3.15.0-alpha.
|
|
72
|
+
"@varlet/icons": "3.15.0-alpha.1776609013808",
|
|
73
|
+
"@varlet/touch-emulator": "3.15.0-alpha.1776609013808",
|
|
74
|
+
"@varlet/ui": "3.15.0-alpha.1776609013808"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"@vitest/coverage-istanbul": "4.1.4",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"live-server": "^1.2.1",
|
|
83
83
|
"vue": "3.5.21",
|
|
84
84
|
"vue-router": "4.5.1",
|
|
85
|
-
"@varlet/icons": "3.15.0-alpha.
|
|
86
|
-
"@varlet/touch-emulator": "3.15.0-alpha.
|
|
87
|
-
"@varlet/ui": "3.15.0-alpha.
|
|
85
|
+
"@varlet/icons": "3.15.0-alpha.1776609013808",
|
|
86
|
+
"@varlet/touch-emulator": "3.15.0-alpha.1776609013808",
|
|
87
|
+
"@varlet/ui": "3.15.0-alpha.1776609013808"
|
|
88
88
|
},
|
|
89
89
|
"engines": {
|
|
90
90
|
"node": "^14.18.0 || >=16.0.0"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"strict": true,
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"noEmit": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowJs": true,
|
|
11
|
+
"lib": ["esnext", "dom"],
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"jsxImportSource": "vue",
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"types": ["vite-plus/test/globals"],
|
|
16
|
+
"moduleResolution": "bundler"
|
|
17
|
+
},
|
|
18
|
+
"include": ["src", "types", "shims", "vite.config.mts", "varlet.config.mjs"],
|
|
19
|
+
"exclude": ["node_modules", "es", "lib", "umd", "site", "coverage", "highlight", ".varlet", ".vite-hooks"]
|
|
20
|
+
}
|
|
@@ -3,23 +3,99 @@ import { defineConfig } from '@varlet/cli'
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
logo: './logo.svg',
|
|
5
5
|
useMobile: true,
|
|
6
|
+
title: 'Varlet X',
|
|
6
7
|
pc: {
|
|
8
|
+
description: {
|
|
9
|
+
'zh-CN':
|
|
10
|
+
'Varlet X 是一个基于 Vue3 开发的 Material design 组件库,支持移动端和桌面端,由 varletjs 组织开发和维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件以保证良好的开发体验。',
|
|
11
|
+
'en-US':
|
|
12
|
+
'Varlet X is a Material design component library developed based on Vue3, supporting mobile and desktop, developed and maintained by varletjs organization. Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience.',
|
|
13
|
+
},
|
|
7
14
|
header: {
|
|
8
15
|
darkMode: null,
|
|
9
|
-
i18n: null,
|
|
10
16
|
playground: null,
|
|
11
17
|
versions: null,
|
|
18
|
+
changelog: null,
|
|
19
|
+
},
|
|
20
|
+
indexPage: {
|
|
21
|
+
sponsors: null,
|
|
22
|
+
contributors: null,
|
|
23
|
+
teamMembers: null,
|
|
24
|
+
features: [
|
|
25
|
+
{
|
|
26
|
+
name: {
|
|
27
|
+
'zh-CN': '特性',
|
|
28
|
+
'en-US': 'Feature',
|
|
29
|
+
},
|
|
30
|
+
description: {
|
|
31
|
+
'zh-CN': '特性描述',
|
|
32
|
+
'en-US': 'Feature description',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: {
|
|
37
|
+
'zh-CN': '特性',
|
|
38
|
+
'en-US': 'Feature',
|
|
39
|
+
},
|
|
40
|
+
description: {
|
|
41
|
+
'zh-CN': '特性描述',
|
|
42
|
+
'en-US': 'Feature description',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: {
|
|
47
|
+
'zh-CN': '特性',
|
|
48
|
+
'en-US': 'Feature',
|
|
49
|
+
},
|
|
50
|
+
description: {
|
|
51
|
+
'zh-CN': '特性描述',
|
|
52
|
+
'en-US': 'Feature description',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: {
|
|
57
|
+
'zh-CN': '特性',
|
|
58
|
+
'en-US': 'Feature',
|
|
59
|
+
},
|
|
60
|
+
description: {
|
|
61
|
+
'zh-CN': '特性描述',
|
|
62
|
+
'en-US': 'Feature description',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: {
|
|
67
|
+
'zh-CN': '特性',
|
|
68
|
+
'en-US': 'Feature',
|
|
69
|
+
},
|
|
70
|
+
description: {
|
|
71
|
+
'zh-CN': '特性描述',
|
|
72
|
+
'en-US': 'Feature description',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: {
|
|
77
|
+
'zh-CN': '特性',
|
|
78
|
+
'en-US': 'Feature',
|
|
79
|
+
},
|
|
80
|
+
description: {
|
|
81
|
+
'zh-CN': '特性描述',
|
|
82
|
+
'en-US': 'Feature description',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
12
86
|
},
|
|
13
87
|
menu: [
|
|
14
88
|
{
|
|
15
89
|
text: {
|
|
16
90
|
'zh-CN': '开发指南',
|
|
91
|
+
'en-US': 'Developer Guide',
|
|
17
92
|
},
|
|
18
93
|
type: 1,
|
|
19
94
|
},
|
|
20
95
|
{
|
|
21
96
|
text: {
|
|
22
97
|
'zh-CN': '基本介绍',
|
|
98
|
+
'en-US': 'Basic Introduce',
|
|
23
99
|
},
|
|
24
100
|
doc: 'home',
|
|
25
101
|
type: 3,
|
|
@@ -27,12 +103,14 @@ export default defineConfig({
|
|
|
27
103
|
{
|
|
28
104
|
text: {
|
|
29
105
|
'zh-CN': '基础组件',
|
|
106
|
+
'en-US': 'Basic Components',
|
|
30
107
|
},
|
|
31
108
|
type: 1,
|
|
32
109
|
},
|
|
33
110
|
{
|
|
34
111
|
text: {
|
|
35
112
|
'zh-CN': 'Button 按钮',
|
|
113
|
+
'en-US': 'Button',
|
|
36
114
|
},
|
|
37
115
|
doc: 'button',
|
|
38
116
|
type: 2,
|
|
@@ -41,8 +119,13 @@ export default defineConfig({
|
|
|
41
119
|
},
|
|
42
120
|
mobile: {
|
|
43
121
|
header: {
|
|
44
|
-
i18n: null,
|
|
45
122
|
darkMode: null,
|
|
46
123
|
},
|
|
124
|
+
title: {
|
|
125
|
+
'zh-CN':
|
|
126
|
+
'Varlet X 是一个基于 Vue3 开发的 Material design 组件库,支持移动端和桌面端,由 varletjs 组织开发和维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件以保证良好的开发体验。',
|
|
127
|
+
'en-US':
|
|
128
|
+
'Varlet X is a Material design component library developed based on Vue3, supporting mobile and desktop, developed and maintained by varletjs organization. Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience.',
|
|
129
|
+
},
|
|
47
130
|
},
|
|
48
131
|
})
|
|
@@ -3,11 +3,86 @@ import { defineConfig } from '@varlet/cli'
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
logo: './logo.svg',
|
|
5
5
|
useMobile: true,
|
|
6
|
+
title: 'Varlet X',
|
|
6
7
|
pc: {
|
|
8
|
+
description: {
|
|
9
|
+
'zh-CN':
|
|
10
|
+
'Varlet X 是一个基于 Vue3 开发的 Material design 组件库,支持移动端和桌面端,由 varletjs 组织开发和维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件以保证良好的开发体验。',
|
|
11
|
+
'en-US':
|
|
12
|
+
'Varlet X is a Material design component library developed based on Vue3, supporting mobile and desktop, developed and maintained by varletjs organization. Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience.',
|
|
13
|
+
},
|
|
7
14
|
header: {
|
|
8
15
|
darkMode: null,
|
|
9
16
|
playground: null,
|
|
10
17
|
versions: null,
|
|
18
|
+
changelog: null,
|
|
19
|
+
},
|
|
20
|
+
indexPage: {
|
|
21
|
+
sponsors: null,
|
|
22
|
+
contributors: null,
|
|
23
|
+
teamMembers: null,
|
|
24
|
+
features: [
|
|
25
|
+
{
|
|
26
|
+
name: {
|
|
27
|
+
'zh-CN': '特性',
|
|
28
|
+
'en-US': 'Feature',
|
|
29
|
+
},
|
|
30
|
+
description: {
|
|
31
|
+
'zh-CN': '特性描述',
|
|
32
|
+
'en-US': 'Feature description',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: {
|
|
37
|
+
'zh-CN': '特性',
|
|
38
|
+
'en-US': 'Feature',
|
|
39
|
+
},
|
|
40
|
+
description: {
|
|
41
|
+
'zh-CN': '特性描述',
|
|
42
|
+
'en-US': 'Feature description',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: {
|
|
47
|
+
'zh-CN': '特性',
|
|
48
|
+
'en-US': 'Feature',
|
|
49
|
+
},
|
|
50
|
+
description: {
|
|
51
|
+
'zh-CN': '特性描述',
|
|
52
|
+
'en-US': 'Feature description',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: {
|
|
57
|
+
'zh-CN': '特性',
|
|
58
|
+
'en-US': 'Feature',
|
|
59
|
+
},
|
|
60
|
+
description: {
|
|
61
|
+
'zh-CN': '特性描述',
|
|
62
|
+
'en-US': 'Feature description',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: {
|
|
67
|
+
'zh-CN': '特性',
|
|
68
|
+
'en-US': 'Feature',
|
|
69
|
+
},
|
|
70
|
+
description: {
|
|
71
|
+
'zh-CN': '特性描述',
|
|
72
|
+
'en-US': 'Feature description',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: {
|
|
77
|
+
'zh-CN': '特性',
|
|
78
|
+
'en-US': 'Feature',
|
|
79
|
+
},
|
|
80
|
+
description: {
|
|
81
|
+
'zh-CN': '特性描述',
|
|
82
|
+
'en-US': 'Feature description',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
11
86
|
},
|
|
12
87
|
menu: [
|
|
13
88
|
{
|
|
@@ -46,5 +121,11 @@ export default defineConfig({
|
|
|
46
121
|
header: {
|
|
47
122
|
darkMode: null,
|
|
48
123
|
},
|
|
124
|
+
title: {
|
|
125
|
+
'zh-CN':
|
|
126
|
+
'Varlet X 是一个基于 Vue3 开发的 Material design 组件库,支持移动端和桌面端,由 varletjs 组织开发和维护。支持 Typescript、按需引入、暗黑模式、主题定制、国际化,并提供 VSCode 插件以保证良好的开发体验。',
|
|
127
|
+
'en-US':
|
|
128
|
+
'Varlet X is a Material design component library developed based on Vue3, supporting mobile and desktop, developed and maintained by varletjs organization. Support Typescript, import on demand, dark mode, theme customization, internationalization, and provide VSCode plugin to ensure a good development experience.',
|
|
129
|
+
},
|
|
49
130
|
},
|
|
50
131
|
})
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
"lib": ["esnext", "dom"],
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"jsxImportSource": "vue",
|
|
11
|
-
"jsx": "preserve",
|
|
12
|
-
"types": ["vite-plus/test/globals"]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
File without changes
|