@varlet/cli 2.1.0 → 2.2.0-alpha.1667670228109

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.
Files changed (81) hide show
  1. package/README.en-US.md +7 -5
  2. package/README.md +7 -5
  3. package/lib/client/appType.d.ts +4 -4
  4. package/lib/client/appType.js +7 -7
  5. package/lib/client/index.d.ts +17 -17
  6. package/lib/client/index.js +106 -106
  7. package/lib/node/bin.d.ts +2 -2
  8. package/lib/node/bin.js +122 -122
  9. package/lib/node/commands/build.d.ts +1 -1
  10. package/lib/node/commands/build.js +15 -15
  11. package/lib/node/commands/changelog.d.ts +6 -6
  12. package/lib/node/commands/changelog.js +20 -20
  13. package/lib/node/commands/commitLint.d.ts +1 -1
  14. package/lib/node/commands/commitLint.js +16 -16
  15. package/lib/node/commands/compile.d.ts +7 -7
  16. package/lib/node/commands/compile.js +35 -35
  17. package/lib/node/commands/create.d.ts +8 -8
  18. package/lib/node/commands/create.js +91 -91
  19. package/lib/node/commands/dev.d.ts +5 -5
  20. package/lib/node/commands/dev.js +38 -38
  21. package/lib/node/commands/gen.d.ts +8 -8
  22. package/lib/node/commands/gen.js +68 -68
  23. package/lib/node/commands/jest.d.ts +8 -8
  24. package/lib/node/commands/jest.js +27 -27
  25. package/lib/node/commands/lint.d.ts +1 -1
  26. package/lib/node/commands/lint.js +42 -42
  27. package/lib/node/commands/preview.d.ts +1 -1
  28. package/lib/node/commands/preview.js +18 -18
  29. package/lib/node/commands/release.d.ts +5 -5
  30. package/lib/node/commands/release.js +146 -146
  31. package/lib/node/commands/vite.d.ts +3 -3
  32. package/lib/node/commands/vite.js +13 -13
  33. package/lib/node/compiler/compileModule.d.ts +5 -5
  34. package/lib/node/compiler/compileModule.js +74 -74
  35. package/lib/node/compiler/compileSFC.d.ts +2 -2
  36. package/lib/node/compiler/compileSFC.js +74 -74
  37. package/lib/node/compiler/compileScript.d.ts +17 -17
  38. package/lib/node/compiler/compileScript.js +95 -95
  39. package/lib/node/compiler/compileSiteEntry.d.ts +13 -13
  40. package/lib/node/compiler/compileSiteEntry.js +95 -95
  41. package/lib/node/compiler/compileStyle.d.ts +11 -11
  42. package/lib/node/compiler/compileStyle.js +39 -39
  43. package/lib/node/compiler/compileTemplateHighlight.d.ts +10 -10
  44. package/lib/node/compiler/compileTemplateHighlight.js +133 -133
  45. package/lib/node/compiler/compileTypes.d.ts +2 -2
  46. package/lib/node/compiler/compileTypes.js +30 -30
  47. package/lib/node/config/varlet.config.d.ts +45 -45
  48. package/lib/node/config/varlet.config.js +27 -27
  49. package/lib/node/config/varlet.default.config.d.ts +2 -2
  50. package/lib/node/config/varlet.default.config.js +264 -264
  51. package/lib/node/config/vite.config.d.ts +6 -6
  52. package/lib/node/config/vite.config.js +142 -142
  53. package/lib/node/index.d.ts +1 -1
  54. package/lib/node/index.js +1 -1
  55. package/lib/node/shared/constant.d.ts +42 -42
  56. package/lib/node/shared/constant.js +47 -47
  57. package/lib/node/shared/fsUtils.d.ts +13 -13
  58. package/lib/node/shared/fsUtils.js +48 -48
  59. package/lib/node/shared/logger.d.ts +8 -8
  60. package/lib/node/shared/logger.js +18 -18
  61. package/package.json +7 -7
  62. package/site/components/button/index.ts +10 -10
  63. package/site/components/cell/index.ts +10 -10
  64. package/site/components/code-example/codeExample.less +41 -41
  65. package/site/components/code-example/index.ts +10 -10
  66. package/site/components/context/zIndex.ts +20 -20
  67. package/site/components/icon/icon.less +26 -26
  68. package/site/components/icon/index.ts +10 -10
  69. package/site/components/icon/props.ts +24 -24
  70. package/site/components/loading/index.ts +10 -10
  71. package/site/components/progress/index.ts +10 -10
  72. package/site/components/snackbar/snackbar.less +135 -135
  73. package/site/components/styles/common.less +64 -64
  74. package/site/components/styles/elevation.less +126 -126
  75. package/site/components/styles/var.less +27 -27
  76. package/site/index.html +49 -49
  77. package/site/mobile/components/app-bar/index.ts +10 -10
  78. package/site/mobile/components/app-bar/props.ts +25 -25
  79. package/site/mobile.html +41 -41
  80. package/site/module.d.ts +5 -5
  81. package/site/tsconfig.json +11 -11
@@ -1,18 +1,18 @@
1
- import chalk from 'chalk';
2
- export default {
3
- info(text) {
4
- console.log(text);
5
- },
6
- success(text) {
7
- console.log(chalk.hex('#00c48f')(text));
8
- },
9
- warning(text) {
10
- console.log(chalk.hex('#ff9800')(text));
11
- },
12
- error(text) {
13
- console.log(chalk.hex('#f44336')(text));
14
- },
15
- title(text) {
16
- console.log(chalk.cyan(text));
17
- },
18
- };
1
+ import chalk from 'chalk';
2
+ export default {
3
+ info(text) {
4
+ console.log(text);
5
+ },
6
+ success(text) {
7
+ console.log(chalk.hex('#00c48f')(text));
8
+ },
9
+ warning(text) {
10
+ console.log(chalk.hex('#ff9800')(text));
11
+ },
12
+ error(text) {
13
+ console.log(chalk.hex('#f44336')(text));
14
+ },
15
+ title(text) {
16
+ console.log(chalk.cyan(text));
17
+ },
18
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "2.1.0",
3
+ "version": "2.2.0-alpha.1667670228109",
4
4
  "type": "module",
5
5
  "description": "cli of varlet",
6
6
  "bin": {
@@ -40,8 +40,8 @@
40
40
  "@babel/preset-env": "^7.14.8",
41
41
  "@babel/preset-typescript": "^7.14.5",
42
42
  "@types/inquirer": "^9.0.2",
43
- "@varlet/markdown-vite-plugin": "2.1.0",
44
- "@varlet/shared": "2.1.0",
43
+ "@varlet/markdown-vite-plugin": "2.2.0-alpha.1667670228109",
44
+ "@varlet/shared": "2.2.0-alpha.1667670228109",
45
45
  "@vitejs/plugin-vue": "3.0.1",
46
46
  "@vitejs/plugin-vue-jsx": "2.0.0",
47
47
  "@vue/babel-plugin-jsx": "1.1.1",
@@ -80,12 +80,12 @@
80
80
  "@types/lodash-es": "^4.17.5",
81
81
  "@types/node": "^18.7.20",
82
82
  "@types/semver": "^7.3.9",
83
- "@varlet/icons": "2.1.0",
84
- "@varlet/touch-emulator": "2.1.0"
83
+ "@varlet/icons": "2.2.0-alpha.1667670228109",
84
+ "@varlet/touch-emulator": "2.2.0-alpha.1667670228109"
85
85
  },
86
86
  "peerDependencies": {
87
- "@varlet/icons": "2.1.0",
88
- "@varlet/touch-emulator": "2.1.0",
87
+ "@varlet/icons": "2.2.0-alpha.1667670228109",
88
+ "@varlet/touch-emulator": "2.2.0-alpha.1667670228109",
89
89
  "@vue/runtime-core": "3.2.16",
90
90
  "@vue/test-utils": "^2.0.2",
91
91
  "clipboard": "^2.0.6",
@@ -1,10 +1,10 @@
1
- import type { App } from 'vue'
2
- import Button from './Button.vue'
3
-
4
- Button.install = function (app: App) {
5
- app.component(Button.name, Button)
6
- }
7
-
8
- export const _ButtonComponent = Button
9
-
10
- export default Button
1
+ import type { App } from 'vue'
2
+ import Button from './Button.vue'
3
+
4
+ Button.install = function (app: App) {
5
+ app.component(Button.name, Button)
6
+ }
7
+
8
+ export const _ButtonComponent = Button
9
+
10
+ export default Button
@@ -1,10 +1,10 @@
1
- import type { App } from 'vue'
2
- import Cell from './Cell.vue'
3
-
4
- Cell.install = function (app: App) {
5
- app.component(Cell.name, Cell)
6
- }
7
-
8
- export const _CellComponent = Cell
9
-
10
- export default Cell
1
+ import type { App } from 'vue'
2
+ import Cell from './Cell.vue'
3
+
4
+ Cell.install = function (app: App) {
5
+ app.component(Cell.name, Cell)
6
+ }
7
+
8
+ export const _CellComponent = Cell
9
+
10
+ export default Cell
@@ -1,41 +1,41 @@
1
- .var-site-code-example {
2
- margin-top: 16px;
3
- margin-bottom: 4px;
4
- position: relative;
5
- border: thin solid var(--site-config-color-hl-border);
6
- border-radius: 4px;
7
- transition: border .25s;
8
-
9
- &:hover {
10
- .var-site-code-example__toolbar {
11
- opacity: 1;
12
- }
13
- }
14
-
15
- &__toolbar {
16
- display: flex;
17
- align-items: center;
18
- position: absolute;
19
- z-index: 1;
20
- right: 10px;
21
- top: 10px;
22
- opacity: 0;
23
- transition: .25s all;
24
-
25
- button {
26
- color: var(--site-config-color-hl-code) !important;
27
- }
28
- }
29
-
30
- &__code {
31
- transition: all .25s;
32
- overflow: hidden;
33
- border-radius: 4px;
34
- }
35
-
36
- &--scroller {
37
- code {
38
- white-space: nowrap;
39
- }
40
- }
41
- }
1
+ .var-site-code-example {
2
+ margin-top: 16px;
3
+ margin-bottom: 4px;
4
+ position: relative;
5
+ border: thin solid var(--site-config-color-hl-border);
6
+ border-radius: 4px;
7
+ transition: border .25s;
8
+
9
+ &:hover {
10
+ .var-site-code-example__toolbar {
11
+ opacity: 1;
12
+ }
13
+ }
14
+
15
+ &__toolbar {
16
+ display: flex;
17
+ align-items: center;
18
+ position: absolute;
19
+ z-index: 1;
20
+ right: 10px;
21
+ top: 10px;
22
+ opacity: 0;
23
+ transition: .25s all;
24
+
25
+ button {
26
+ color: var(--site-config-color-hl-code) !important;
27
+ }
28
+ }
29
+
30
+ &__code {
31
+ transition: all .25s;
32
+ overflow: hidden;
33
+ border-radius: 4px;
34
+ }
35
+
36
+ &--scroller {
37
+ code {
38
+ white-space: nowrap;
39
+ }
40
+ }
41
+ }
@@ -1,10 +1,10 @@
1
- import type { App } from 'vue'
2
- import CodeExample from './CodeExample.vue'
3
-
4
- CodeExample.install = function (app: App) {
5
- app.component(CodeExample.name, CodeExample)
6
- }
7
-
8
- export const _CodeExampleComponent = CodeExample
9
-
10
- export default CodeExample
1
+ import type { App } from 'vue'
2
+ import CodeExample from './CodeExample.vue'
3
+
4
+ CodeExample.install = function (app: App) {
5
+ app.component(CodeExample.name, CodeExample)
6
+ }
7
+
8
+ export const _CodeExampleComponent = CodeExample
9
+
10
+ export default CodeExample
@@ -1,20 +1,20 @@
1
- import context from './index'
2
- import { watch, ref } from 'vue'
3
- import type { Ref } from 'vue'
4
-
5
- export function useZIndex(source: any, count: number) {
6
- const zIndex: Ref<number> = ref(context.zIndex)
7
-
8
- watch(
9
- source,
10
- (newValue) => {
11
- if (newValue) {
12
- context.zIndex += count
13
- zIndex.value = context.zIndex
14
- }
15
- },
16
- { immediate: true }
17
- )
18
-
19
- return { zIndex }
20
- }
1
+ import context from './index'
2
+ import { watch, ref } from 'vue'
3
+ import type { Ref } from 'vue'
4
+
5
+ export function useZIndex(source: any, count: number) {
6
+ const zIndex: Ref<number> = ref(context.zIndex)
7
+
8
+ watch(
9
+ source,
10
+ (newValue) => {
11
+ if (newValue) {
12
+ context.zIndex += count
13
+ zIndex.value = context.zIndex
14
+ }
15
+ },
16
+ { immediate: true }
17
+ )
18
+
19
+ return { zIndex }
20
+ }
@@ -1,26 +1,26 @@
1
- @import '@varlet/icons/dist/css/varlet-icons.less';
2
-
3
- @site-icon-size: 20px;
4
-
5
- :root {
6
- --site-icon-size: @site-icon-size;
7
- }
8
-
9
- .var-site-icon {
10
- display: inline-flex;
11
- justify-content: center;
12
- align-items: center;
13
- font-size: var(--site-icon-size);
14
- color: inherit;
15
- vertical-align: bottom;
16
-
17
- &--shrinking {
18
- transform: scale(0);
19
- }
20
-
21
- &__image {
22
- width: var(--site-icon-size);
23
- height: var(--site-icon-size);
24
- object-fit: cover;
25
- }
26
- }
1
+ @import '@varlet/icons/dist/css/varlet-icons.less';
2
+
3
+ @site-icon-size: 20px;
4
+
5
+ :root {
6
+ --site-icon-size: @site-icon-size;
7
+ }
8
+
9
+ .var-site-icon {
10
+ display: inline-flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ font-size: var(--site-icon-size);
14
+ color: inherit;
15
+ vertical-align: bottom;
16
+
17
+ &--shrinking {
18
+ transform: scale(0);
19
+ }
20
+
21
+ &__image {
22
+ width: var(--site-icon-size);
23
+ height: var(--site-icon-size);
24
+ object-fit: cover;
25
+ }
26
+ }
@@ -1,10 +1,10 @@
1
- import type { App } from 'vue'
2
- import Icon from './Icon.vue'
3
-
4
- Icon.install = function (app: App) {
5
- app.component(Icon.name, Icon)
6
- }
7
-
8
- export const _IconComponent = Icon
9
-
10
- export default Icon
1
+ import type { App } from 'vue'
2
+ import Icon from './Icon.vue'
3
+
4
+ Icon.install = function (app: App) {
5
+ app.component(Icon.name, Icon)
6
+ }
7
+
8
+ export const _IconComponent = Icon
9
+
10
+ export default Icon
@@ -1,24 +1,24 @@
1
- import type { PropType } from 'vue'
2
-
3
- export const props = {
4
- name: {
5
- type: String,
6
- },
7
- size: {
8
- type: [Number, String],
9
- },
10
- color: {
11
- type: String,
12
- },
13
- namespace: {
14
- type: String,
15
- default: 'var-icon',
16
- },
17
- transition: {
18
- type: [Number, String],
19
- default: 0,
20
- },
21
- onClick: {
22
- type: Function as PropType<(event: Event) => void>,
23
- },
24
- }
1
+ import type { PropType } from 'vue'
2
+
3
+ export const props = {
4
+ name: {
5
+ type: String,
6
+ },
7
+ size: {
8
+ type: [Number, String],
9
+ },
10
+ color: {
11
+ type: String,
12
+ },
13
+ namespace: {
14
+ type: String,
15
+ default: 'var-icon',
16
+ },
17
+ transition: {
18
+ type: [Number, String],
19
+ default: 0,
20
+ },
21
+ onClick: {
22
+ type: Function as PropType<(event: Event) => void>,
23
+ },
24
+ }
@@ -1,10 +1,10 @@
1
- import type { App } from 'vue'
2
- import Loading from './Loading.vue'
3
-
4
- Loading.install = function (app: App) {
5
- app.component(Loading.name, Loading)
6
- }
7
-
8
- export const _LoadingComponent = Loading
9
-
10
- export default Loading
1
+ import type { App } from 'vue'
2
+ import Loading from './Loading.vue'
3
+
4
+ Loading.install = function (app: App) {
5
+ app.component(Loading.name, Loading)
6
+ }
7
+
8
+ export const _LoadingComponent = Loading
9
+
10
+ export default Loading
@@ -1,10 +1,10 @@
1
- import type { App } from 'vue'
2
- import Progress from './Progress.vue'
3
-
4
- Progress.install = function (app: App) {
5
- app.component(Progress.name, Progress)
6
- }
7
-
8
- export const _ProgressComponent = Progress
9
-
10
- export default Progress
1
+ import type { App } from 'vue'
2
+ import Progress from './Progress.vue'
3
+
4
+ Progress.install = function (app: App) {
5
+ app.component(Progress.name, Progress)
6
+ }
7
+
8
+ export const _ProgressComponent = Progress
9
+
10
+ export default Progress