@varlet/cli 2.0.5 → 2.1.0-alpha.1666877950844
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.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/babel.config.cjs +29 -0
- package/cjs/babel.sfc.transform.cjs +18 -0
- package/cjs/jest.config.cjs +33 -0
- package/cjs/jest.media.mock.cjs +1 -0
- package/cjs/jest.style.mock.cjs +1 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/lib/client/appType.d.ts +4 -0
- package/lib/client/appType.js +7 -0
- package/lib/client/index.d.ts +17 -0
- package/lib/client/index.js +106 -0
- package/lib/{bin.d.ts → node/bin.d.ts} +2 -2
- package/lib/node/bin.js +122 -0
- package/lib/{commands → node/commands}/build.d.ts +1 -1
- package/lib/node/commands/build.js +15 -0
- package/lib/{commands → node/commands}/changelog.d.ts +6 -6
- package/lib/node/commands/changelog.js +20 -0
- package/lib/{commands → node/commands}/commitLint.d.ts +1 -1
- package/lib/node/commands/commitLint.js +45 -0
- package/lib/{commands → node/commands}/compile.d.ts +7 -7
- package/lib/node/commands/compile.js +35 -0
- package/lib/{commands → node/commands}/create.d.ts +8 -8
- package/lib/node/commands/create.js +91 -0
- package/lib/{commands → node/commands}/dev.d.ts +5 -5
- package/lib/node/commands/dev.js +38 -0
- package/lib/{commands → node/commands}/gen.d.ts +8 -8
- package/lib/node/commands/gen.js +75 -0
- package/lib/{commands → node/commands}/jest.d.ts +8 -8
- package/lib/node/commands/jest.js +27 -0
- package/lib/{commands → node/commands}/lint.d.ts +1 -1
- package/lib/node/commands/lint.js +41 -0
- package/lib/{commands → node/commands}/preview.d.ts +1 -1
- package/lib/node/commands/preview.js +18 -0
- package/lib/{commands → node/commands}/release.d.ts +5 -5
- package/lib/node/commands/release.js +146 -0
- package/lib/{commands → node/commands}/vite.d.ts +3 -3
- package/lib/node/commands/vite.js +13 -0
- package/lib/{compiler → node/compiler}/compileModule.d.ts +5 -5
- package/lib/node/compiler/compileModule.js +74 -0
- package/lib/{compiler → node/compiler}/compileSFC.d.ts +2 -2
- package/lib/node/compiler/compileSFC.js +79 -0
- package/lib/{compiler → node/compiler}/compileScript.d.ts +17 -17
- package/lib/node/compiler/compileScript.js +141 -0
- package/lib/{compiler → node/compiler}/compileSiteEntry.d.ts +13 -13
- package/lib/node/compiler/compileSiteEntry.js +128 -0
- package/lib/{compiler → node/compiler}/compileStyle.d.ts +11 -11
- package/lib/node/compiler/compileStyle.js +39 -0
- package/lib/{compiler → node/compiler}/compileTemplateHighlight.d.ts +10 -10
- package/lib/node/compiler/compileTemplateHighlight.js +133 -0
- package/lib/{compiler → node/compiler}/compileTypes.d.ts +2 -2
- package/lib/node/compiler/compileTypes.js +45 -0
- package/lib/{config → node/config}/varlet.config.d.ts +45 -44
- package/lib/node/config/varlet.config.js +27 -0
- package/lib/node/config/varlet.default.config.d.ts +2 -0
- package/lib/node/config/varlet.default.config.js +264 -0
- package/lib/node/config/vite.config.d.ts +6 -0
- package/lib/node/config/vite.config.js +144 -0
- package/lib/node/index.d.ts +1 -0
- package/lib/node/index.js +1 -0
- package/lib/{shared → node/shared}/constant.d.ts +42 -43
- package/lib/node/shared/constant.js +47 -0
- package/lib/{shared → node/shared}/fsUtils.d.ts +13 -12
- package/lib/node/shared/fsUtils.js +48 -0
- package/lib/{shared → node/shared}/logger.d.ts +8 -8
- package/lib/node/shared/logger.js +18 -0
- package/package.json +22 -19
- package/{preset.js → preset.cjs} +1 -1
- package/site/components/button/index.ts +10 -10
- package/site/components/cell/index.ts +10 -10
- package/site/components/code-example/CodeExample.vue +2 -1
- package/site/components/code-example/codeExample.less +41 -41
- package/site/components/code-example/index.ts +10 -10
- package/site/components/context/zIndex.ts +20 -20
- package/site/components/icon/icon.less +26 -26
- package/site/components/icon/index.ts +10 -10
- package/site/components/icon/props.ts +24 -24
- package/site/components/loading/index.ts +10 -10
- package/site/components/progress/index.ts +10 -10
- package/site/components/snackbar/snackbar.less +135 -135
- package/site/components/styles/common.less +64 -64
- package/site/components/styles/elevation.less +126 -126
- package/site/components/styles/var.less +27 -27
- package/site/components/utils/components.ts +1 -4
- package/site/components/utils/elements.ts +1 -1
- package/site/index.html +49 -49
- package/site/mobile/App.vue +27 -26
- package/site/mobile/components/AppHome.vue +2 -1
- package/site/mobile/components/app-bar/index.ts +10 -10
- package/site/mobile/components/app-bar/props.ts +25 -25
- package/site/mobile.html +41 -41
- package/site/module.d.ts +5 -5
- package/site/pc/App.vue +2 -1
- package/site/pc/Layout.vue +2 -1
- package/site/pc/components/AppHeader.vue +4 -2
- package/site/pc/pages/index/index.vue +8 -4
- package/site/tsconfig.json +11 -11
- package/site/useProgress.ts +2 -1
- package/site/utils.ts +6 -137
- package/template/generators/config/default/base/{varlet.config.js → varlet.config.mjs} +2 -2
- package/template/generators/config/i18n/base/{varlet.config.js → varlet.config.mjs} +2 -2
- package/tsconfig.json +2 -9
- package/lib/bin.js +0 -102
- package/lib/commands/build.js +0 -67
- package/lib/commands/changelog.js +0 -27
- package/lib/commands/commitLint.js +0 -21
- package/lib/commands/compile.js +0 -119
- package/lib/commands/create.js +0 -166
- package/lib/commands/dev.js +0 -123
- package/lib/commands/gen.js +0 -138
- package/lib/commands/jest.js +0 -85
- package/lib/commands/lint.js +0 -123
- package/lib/commands/preview.js +0 -74
- package/lib/commands/release.js +0 -270
- package/lib/commands/vite.js +0 -69
- package/lib/compiler/compileModule.js +0 -190
- package/lib/compiler/compileSFC.js +0 -135
- package/lib/compiler/compileScript.js +0 -194
- package/lib/compiler/compileSiteEntry.js +0 -237
- package/lib/compiler/compileStyle.js +0 -91
- package/lib/compiler/compileTemplateHighlight.js +0 -193
- package/lib/compiler/compileTypes.js +0 -85
- package/lib/config/babel.config.d.ts +0 -2
- package/lib/config/babel.config.js +0 -31
- package/lib/config/babel.sfc.transform.d.ts +0 -1
- package/lib/config/babel.sfc.transform.js +0 -18
- package/lib/config/jest.config.d.ts +0 -1
- package/lib/config/jest.config.js +0 -37
- package/lib/config/jest.media.mock.d.ts +0 -0
- package/lib/config/jest.media.mock.js +0 -2
- package/lib/config/jest.style.mock.d.ts +0 -0
- package/lib/config/jest.style.mock.js +0 -2
- package/lib/config/varlet.config.js +0 -35
- package/lib/config/vite.config.d.ts +0 -5
- package/lib/config/vite.config.js +0 -162
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -5
- package/lib/shared/constant.js +0 -50
- package/lib/shared/fsUtils.js +0 -108
- package/lib/shared/logger.js +0 -23
- package/site/mobile/components/AppType.vue +0 -22
- package/varlet.default.config.js +0 -267
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
// 文字
|
|
2
|
-
@site-font-size-xs: 10px;
|
|
3
|
-
@site-font-size-sm: 12px;
|
|
4
|
-
@site-font-size-md: 14px;
|
|
5
|
-
@site-font-size-lg: 16px;
|
|
6
|
-
|
|
7
|
-
// 图标
|
|
8
|
-
@site-icon-size-xs: 16px;
|
|
9
|
-
@site-icon-size-sm: 18px;
|
|
10
|
-
@site-icon-size-md: 20px;
|
|
11
|
-
@site-icon-size-lg: 22px;
|
|
12
|
-
|
|
13
|
-
//颜色
|
|
14
|
-
@site-color-primary: #3a7afe;
|
|
15
|
-
@site-color-info: #00afef;
|
|
16
|
-
@site-color-success: #00c48f;
|
|
17
|
-
@site-color-warning: #ff9f00;
|
|
18
|
-
@site-color-danger: #f44336;
|
|
19
|
-
@site-color-disabled: #e0e0e0;
|
|
20
|
-
|
|
21
|
-
// 动画函数
|
|
22
|
-
@site-cubic-bezier: cubic-bezier(0.25, 0.8, 0.5, 1);
|
|
23
|
-
|
|
24
|
-
// 阴影
|
|
25
|
-
@site-shadow-key-umbra-opacity: rgba(0, 0, 0, 0.2);
|
|
26
|
-
@site-shadow-key-penumbra-opacity: rgba(0, 0, 0, 0.14);
|
|
27
|
-
@site-shadow-key-ambient-opacity: rgba(0, 0, 0, 0.12);
|
|
1
|
+
// 文字
|
|
2
|
+
@site-font-size-xs: 10px;
|
|
3
|
+
@site-font-size-sm: 12px;
|
|
4
|
+
@site-font-size-md: 14px;
|
|
5
|
+
@site-font-size-lg: 16px;
|
|
6
|
+
|
|
7
|
+
// 图标
|
|
8
|
+
@site-icon-size-xs: 16px;
|
|
9
|
+
@site-icon-size-sm: 18px;
|
|
10
|
+
@site-icon-size-md: 20px;
|
|
11
|
+
@site-icon-size-lg: 22px;
|
|
12
|
+
|
|
13
|
+
//颜色
|
|
14
|
+
@site-color-primary: #3a7afe;
|
|
15
|
+
@site-color-info: #00afef;
|
|
16
|
+
@site-color-success: #00c48f;
|
|
17
|
+
@site-color-warning: #ff9f00;
|
|
18
|
+
@site-color-danger: #f44336;
|
|
19
|
+
@site-color-disabled: #e0e0e0;
|
|
20
|
+
|
|
21
|
+
// 动画函数
|
|
22
|
+
@site-cubic-bezier: cubic-bezier(0.25, 0.8, 0.5, 1);
|
|
23
|
+
|
|
24
|
+
// 阴影
|
|
25
|
+
@site-shadow-key-umbra-opacity: rgba(0, 0, 0, 0.2);
|
|
26
|
+
@site-shadow-key-penumbra-opacity: rgba(0, 0, 0, 0.14);
|
|
27
|
+
@site-shadow-key-ambient-opacity: rgba(0, 0, 0, 0.12);
|
|
@@ -98,10 +98,7 @@ export function createNamespace(name: string) {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export function call<
|
|
102
|
-
fn?: F | null,
|
|
103
|
-
...arg: P
|
|
104
|
-
): ReturnType<F> | undefined {
|
|
101
|
+
export function call<P extends any[], R>(fn?: (...arg: P) => R, ...arg: P): R | undefined {
|
|
105
102
|
if (fn) return fn(...arg)
|
|
106
103
|
}
|
|
107
104
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNumber, isString, toNumber, kebabCase } from '@varlet/shared'
|
|
2
|
-
import type { StyleVars } from '
|
|
2
|
+
import type { StyleVars } from '@varlet/cli/client'
|
|
3
3
|
|
|
4
4
|
export function getLeft(element: HTMLElement): number {
|
|
5
5
|
const { left } = element.getBoundingClientRect()
|