@varlet/cli 2.0.0-alpha.1663742071515 → 2.0.0-alpha.1664031123039

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 (55) hide show
  1. package/README.en-US.md +1 -1
  2. package/README.md +1 -1
  3. package/lib/commands/create.js +58 -73
  4. package/lib/commands/gen.js +5 -10
  5. package/package.json +6 -7
  6. package/template/create/{tsx.ejs → [ComponentName].tsx.ejs} +2 -2
  7. package/template/create/{vue.ejs → [ComponentName].vue.ejs} +2 -2
  8. package/template/create/{less.ejs → [componentName].less.ejs} +0 -0
  9. package/template/create/__tests__/{index.spec.ejs → index.spec.js.ejs} +6 -1
  10. package/template/create/example/{index.ejs → index.vue.ejs} +0 -0
  11. package/template/create/{index.ejs → index.ts.ejs} +0 -1
  12. package/template/generators/base/.prettierignore +6 -1
  13. package/template/generators/base/README.md +1 -1
  14. package/template/generators/base/public/logo.svg +30 -1
  15. package/template/generators/config/default/base/docs/home.zh-CN.md +0 -8
  16. package/template/generators/config/default/base/package.json +12 -5
  17. package/template/generators/config/default/base/varlet.config.js +0 -65
  18. package/template/generators/config/default/sfc/src/button/Button.vue +3 -2
  19. package/template/generators/config/default/sfc/src/button/button.less +2 -2
  20. package/template/generators/config/default/sfc/src/button/docs/zh-CN.md +2 -11
  21. package/template/generators/config/default/sfc/src/button/example/BasicUse.vue +2 -2
  22. package/template/generators/config/default/sfc/src/button/example/ModifyColor.vue +2 -2
  23. package/template/generators/config/default/sfc/src/button/example/index.vue +3 -4
  24. package/template/generators/config/default/tsx/src/button/Button.tsx +2 -2
  25. package/template/generators/config/default/tsx/src/button/button.less +2 -2
  26. package/template/generators/config/default/tsx/src/button/docs/zh-CN.md +2 -11
  27. package/template/generators/config/default/tsx/src/button/example/BasicUse.vue +2 -2
  28. package/template/generators/config/default/tsx/src/button/example/ModifyColor.vue +2 -2
  29. package/template/generators/config/default/tsx/src/button/example/index.vue +3 -4
  30. package/template/generators/config/i18n/base/docs/home.en-US.md +0 -8
  31. package/template/generators/config/i18n/base/docs/home.zh-CN.md +0 -8
  32. package/template/generators/config/i18n/base/package.json +11 -4
  33. package/template/generators/config/i18n/base/varlet.config.js +0 -75
  34. package/template/generators/config/i18n/sfc/src/button/Button.vue +6 -5
  35. package/template/generators/config/i18n/sfc/src/button/button.less +2 -2
  36. package/template/generators/config/i18n/sfc/src/button/docs/en-US.md +7 -3
  37. package/template/generators/config/i18n/sfc/src/button/docs/zh-CN.md +6 -2
  38. package/template/generators/config/i18n/sfc/src/button/example/BasicUse.vue +2 -2
  39. package/template/generators/config/i18n/sfc/src/button/example/ModifyColor.vue +2 -2
  40. package/template/generators/config/i18n/sfc/src/button/example/index.vue +5 -2
  41. package/template/generators/config/i18n/tsx/src/button/Button.tsx +6 -8
  42. package/template/generators/config/i18n/tsx/src/button/button.less +2 -2
  43. package/template/generators/config/i18n/tsx/src/button/docs/en-US.md +7 -3
  44. package/template/generators/config/i18n/tsx/src/button/docs/zh-CN.md +6 -2
  45. package/template/generators/config/i18n/tsx/src/button/example/BasicUse.vue +3 -3
  46. package/template/generators/config/i18n/tsx/src/button/example/ModifyColor.vue +2 -2
  47. package/template/generators/config/i18n/tsx/src/button/example/index.vue +4 -2
  48. package/template/generators/config/i18n/tsx/src/button/index.ts +1 -1
  49. package/lib/commands/test.d.ts +0 -7
  50. package/lib/commands/test.js +0 -26
  51. package/lib/commands/useVite.d.ts +0 -1
  52. package/lib/commands/useVite.js +0 -70
  53. package/lib/config/vitest.config.d.ts +0 -2
  54. package/lib/config/vitest.config.js +0 -28
  55. package/template/generators/base/public/highlight.css +0 -1
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import BButton from '../Button'
2
+ import VarButton from '..'
3
3
  </script>
4
4
 
5
5
  <template>
6
- <b-button color="#03A9F4">起步</b-button>
6
+ <var-button color="#03A9F4">起步</var-button>
7
7
  </template>
@@ -1,13 +1,12 @@
1
1
  <script setup>
2
+ import VarButton from '..'
2
3
  import AppType from '@varlet/cli/site/mobile/components/AppType'
3
- import BasicUse from './BasicUse'
4
- import ModifyColor from './ModifyColor'
5
4
  </script>
6
5
 
7
6
  <template>
8
7
  <app-type>基本使用</app-type>
9
- <basic-use />
8
+ <var-button>起步</var-button>
10
9
 
11
10
  <app-type>修改颜色</app-type>
12
- <modify-color />
11
+ <var-button color="#03A9F4">起步</var-button>
13
12
  </template>
@@ -2,7 +2,7 @@ import { defineComponent, PropType } from 'vue'
2
2
  import './button.less'
3
3
 
4
4
  export default defineComponent({
5
- name: 'BButton',
5
+ name: 'VarButton',
6
6
  props: {
7
7
  color: {
8
8
  type: String,
@@ -19,7 +19,7 @@ export default defineComponent({
19
19
 
20
20
  return (
21
21
  <>
22
- <button class="basic-button" style={{ background: color }} onClick={handleClick}>
22
+ <button class="var-button" style={{ background: color }} onClick={handleClick}>
23
23
  {slots.default?.()}
24
24
  </button>
25
25
  </>
@@ -1,7 +1,7 @@
1
- .basic-button {
1
+ .var-button {
2
2
  display: flex;
3
3
  padding: 10px;
4
- background: #009688;
4
+ background: #3a7afe;
5
5
  color: #fff;
6
6
  outline: none;
7
7
  border: none;
@@ -1,17 +1,8 @@
1
1
  # 按钮
2
2
 
3
- ### 引入
4
-
5
- ```js
6
- import { createApp } from 'vue'
7
- import { Button } from 'basic-ui'
8
-
9
- createApp().use(Button)
10
- ```
11
-
12
3
  ### 基本使用
13
4
  ```html
14
- <b-button>组件库从我开始</b-button>
5
+ <var-button>组件库从我开始</var-button>
15
6
  ```
16
7
 
17
8
  ```vue
@@ -20,7 +11,7 @@ import BasicUse from '../example/BasicUse'
20
11
 
21
12
  ### 主题色按钮
22
13
  ```html
23
- <b-button color="#009688">组件库从我开始</b-button>
14
+ <var-button color="#009688">组件库从我开始</var-button>
24
15
  ```
25
16
 
26
17
  ```vue
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import BButton from '../Button'
2
+ import VarButton from '..'
3
3
  </script>
4
4
 
5
5
  <template>
6
- <b-button>起步</b-button>
6
+ <var-button>起步</var-button>
7
7
  </template>
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import BButton from '../Button'
2
+ import VarButton from '..'
3
3
  </script>
4
4
 
5
5
  <template>
6
- <b-button color="#03A9F4">起步</b-button>
6
+ <var-button color="#03A9F4">起步</var-button>
7
7
  </template>
@@ -1,13 +1,12 @@
1
1
  <script setup>
2
+ import VarButton from '..'
2
3
  import AppType from '@varlet/cli/site/mobile/components/AppType'
3
- import BasicUse from './BasicUse'
4
- import ModifyColor from './ModifyColor'
5
4
  </script>
6
5
 
7
6
  <template>
8
7
  <app-type>基本使用</app-type>
9
- <basic-use />
8
+ <var-button>起步</var-button>
10
9
 
11
10
  <app-type>修改颜色</app-type>
12
- <modify-color />
11
+ <var-button color="#03A9F4">起步</var-button>
13
12
  </template>
@@ -1,11 +1,3 @@
1
- <div class="varlet-introduce">
2
- <div class="varlet-introduce__row">
3
- <img class="varlet-introduce__image" src="../public/logo.svg" />
4
- <div class="varlet-introduce__name">Basic UI</div>
5
- </div>
6
- <div class="varlet-introduce__des">Components Library</div>
7
- </div>
8
-
9
1
  ### Intro
10
2
 
11
3
  Introduce the library, write whatever you want to write...
@@ -1,11 +1,3 @@
1
- <div class="varlet-introduce">
2
- <div class="varlet-introduce__row">
3
- <img class="varlet-introduce__image" src="../public/logo.svg" />
4
- <div class="varlet-introduce__name">Basic UI</div>
5
- </div>
6
- <div class="varlet-introduce__des">一个组件库</div>
7
- </div>
8
-
9
1
  ### 介绍
10
2
 
11
3
  这里可以介绍一下组件库, 想写什么就写什么...
@@ -1,7 +1,7 @@
1
1
  {
2
- "name": "basic-ui",
2
+ "name": "@varlet/ui",
3
3
  "version": "0.0.0",
4
- "description": "A basic components library",
4
+ "description": "A components library example",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
7
7
  "typings": "types/index.d.ts",
@@ -18,6 +18,10 @@
18
18
  "sideEffects": [
19
19
  "es/**/style/*",
20
20
  "lib/**/style/*",
21
+ "es/style.js",
22
+ "es/less.js",
23
+ "lib/style.js",
24
+ "lib/less.js",
21
25
  "*.css",
22
26
  "*.less"
23
27
  ],
@@ -45,7 +49,7 @@
45
49
  "@varlet/stylelint-config": "workspace:*",
46
50
  "@varlet/touch-emulator": "workspace:*",
47
51
  "@varlet/shared": "workspace:*",
48
- "@vue/test-utils": "2.0.0-rc.6",
52
+ "@vue/test-utils": "^2.0.2",
49
53
  "clipboard": "^2.0.6",
50
54
  "eslint": "^7.30.0",
51
55
  "lint-staged": "^10.5.0",
@@ -76,6 +80,9 @@
76
80
  "site/**",
77
81
  "public/**",
78
82
  "src/*/__tests__/**",
83
+ "coverage/**",
84
+ "highlight/**",
85
+ "types/index.d.ts",
79
86
  ".varlet/**"
80
87
  ],
81
88
  "extends": [
@@ -98,7 +105,7 @@
98
105
  ]
99
106
  },
100
107
  "browserslist": [
101
- "Chrome >= 51",
108
+ "Chrome >= 54",
102
109
  "iOS >= 10"
103
110
  ],
104
111
  "packageManager": "pnpm@7.9.0"
@@ -1,75 +1,10 @@
1
1
  module.exports = {
2
- name: 'Basic',
3
- namespace: 'b',
4
- title: 'Basic UI',
5
2
  logo: './logo.svg',
6
3
  useMobile: true,
7
- themes: {
8
- 'color-body': '#fff',
9
- 'color-bar': '#fff',
10
- 'color-sub-bar': '#f5f5f5',
11
- 'color-text': '#555',
12
- 'color-sub-text': '#888',
13
- 'color-border': 'rgba(0, 0, 0, 0.12)',
14
- 'color-shadow': '#eee',
15
- 'color-introduce-border': '#009688',
16
- 'color-primary': '#009688',
17
- 'color-link': '#009688',
18
- 'color-type': '#009688',
19
- 'color-progress': '#009688',
20
- 'color-progress-track': '#fff',
21
- 'color-side-bar': '#009688',
22
- 'color-side-bar-active-background': '#00968821',
23
- 'color-app-bar': '#009688',
24
- 'color-nav-button-hover-background': 'rgba(0, 0, 0, 0.08)',
25
- 'color-pc-language-active': '#009688',
26
- 'color-pc-language-active-background': '#00968821',
27
- 'color-mobile-language-active': '#009688',
28
- 'color-mobile-language-active-background': '#00968821',
29
- 'color-mobile-cell-hover': '#009688',
30
- },
31
- darkThemes: {
32
- 'color-body': '#121212',
33
- 'color-bar': '#1e1e1e',
34
- 'color-sub-bar': '#272727',
35
- 'color-text': '#fff',
36
- 'color-sub-text': '#aaa',
37
- 'color-border': '#333',
38
- 'color-shadow': '#121212',
39
- 'color-introduce-border': '#555',
40
- 'color-primary': '#009688',
41
- 'color-link': '#009688',
42
- 'color-type': '#009688',
43
- 'color-progress': '#009688',
44
- 'color-progress-track': '#202020',
45
- 'color-side-bar': '#009688',
46
- 'color-side-bar-active-background': '#00968821',
47
- 'color-app-bar': '#009688',
48
- 'color-nav-button-hover-background': 'rgba(255, 255, 255, 0.08)',
49
- 'color-pc-language-active': '#009688',
50
- 'color-pc-language-active-background': '#00968821',
51
- 'color-mobile-language-active': '#009688',
52
- 'color-mobile-language-active-background': '#00968821',
53
- 'color-mobile-cell-hover': '#009688',
54
- },
55
- highlight: {
56
- style: './highlight.css',
57
- },
58
4
  pc: {
59
- redirect: '/home',
60
- title: {
61
- 'zh-CN': '一个组件库',
62
- 'en-US': 'Components Library',
63
- },
64
5
  header: {
65
6
  darkMode: null,
66
- versions: null,
67
- i18n: {
68
- 'zh-CN': '中文',
69
- 'en-US': 'English',
70
- },
71
7
  playground: null,
72
- github: 'https://github.com/varletjs/varlet',
73
8
  },
74
9
  menu: [
75
10
  {
@@ -105,18 +40,8 @@ module.exports = {
105
40
  ],
106
41
  },
107
42
  mobile: {
108
- redirect: '/home',
109
- title: {
110
- 'zh-CN': '一个组件库',
111
- 'en-US': 'Components Library',
112
- },
113
43
  header: {
114
- i18n: {
115
- 'zh-CN': '中文',
116
- 'en-US': 'English',
117
- },
118
44
  darkMode: null,
119
- github: 'https://github.com/varletjs/varlet',
120
45
  },
121
46
  },
122
47
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <button class="basic-button" :style="{ background: color }">
2
+ <button class="var-button" :style="{ background: color }">
3
+ {{ pack.button }} ->
3
4
  <slot />
4
- <!-- {{ pack.button }}-->
5
5
  </button>
6
6
  </template>
7
7
 
@@ -9,10 +9,10 @@
9
9
  import { defineComponent, PropType } from 'vue'
10
10
 
11
11
  // i18n for component's internal
12
- // import { pack } from '../locale'
12
+ import { pack } from '../locale'
13
13
 
14
14
  export default defineComponent({
15
- name: 'BButton',
15
+ name: 'VarButton',
16
16
  props: {
17
17
  color: {
18
18
  type: String,
@@ -25,6 +25,7 @@ export default defineComponent({
25
25
  const handleClick = (e: Event) => props.onClick?.(e)
26
26
 
27
27
  return {
28
+ pack,
28
29
  handleClick,
29
30
  }
30
31
  },
@@ -32,5 +33,5 @@ export default defineComponent({
32
33
  </script>
33
34
 
34
35
  <style lang="less">
35
- @import 'button';
36
+ @import './button';
36
37
  </style>
@@ -1,7 +1,7 @@
1
- .basic-button {
1
+ .var-button {
2
2
  display: flex;
3
3
  padding: 10px;
4
- background: #009688;
4
+ background: #3a7afe;
5
5
  color: #fff;
6
6
  outline: none;
7
7
  border: none;
@@ -2,12 +2,16 @@
2
2
 
3
3
  ### Basic Use
4
4
  ```html
5
- <b-button>start</b-button>
5
+ <var-button>start</var-button>
6
+ ```
7
+
8
+ ```vue
9
+ import BasicUse from '../example/BasicUse'
6
10
  ```
7
11
 
8
12
  ### Theme Color Button
9
13
  ```html
10
- <b-button color="#009688">start</b-button>
14
+ <var-button color="#009688">start</var-button>
11
15
  ```
12
16
 
13
17
  ```vue
@@ -20,7 +24,7 @@ import ModifyColor from '../example/ModifyColor'
20
24
 
21
25
  | Prop | Description | Type | Default |
22
26
  | --- | --- | --- | --- |
23
- | `color` | 按钮颜色 | _string_ | `default` |
27
+ | `color` | Button background color | _string_ | `default` |
24
28
 
25
29
  ### Events
26
30
 
@@ -2,12 +2,16 @@
2
2
 
3
3
  ### 基本使用
4
4
  ```html
5
- <b-button>组件库从我开始</b-button>
5
+ <var-button>组件库从我开始</var-button>
6
+ ```
7
+
8
+ ```vue
9
+ import BasicUse from '../example/BasicUse'
6
10
  ```
7
11
 
8
12
  ### 主题色按钮
9
13
  ```html
10
- <b-button color="#009688">组件库从我开始</b-button>
14
+ <var-button color="#009688">组件库从我开始</var-button>
11
15
  ```
12
16
 
13
17
  ```vue
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
+ import VarButton from '..'
2
3
  import { watchLang } from '@varlet/cli/site/utils'
3
- import BButton from '../Button'
4
4
  import { pack, use } from './locale'
5
5
 
6
6
  watchLang(use)
7
7
  </script>
8
8
 
9
9
  <template>
10
- <b-button>{{ pack.start }}</b-button>
10
+ <var-button>{{ pack.start }}</var-button>
11
11
  </template>
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
+ import VarButton from '..'
2
3
  import { watchLang } from '@varlet/cli/site/utils'
3
- import BButton from '../Button'
4
4
  import { pack, use } from './locale'
5
5
 
6
6
  watchLang(use, 'pc')
7
7
  </script>
8
8
 
9
9
  <template>
10
- <b-button color="#03A9F4">{{ pack.start }}</b-button>
10
+ <var-button color="#03A9F4">{{ pack.start }}</var-button>
11
11
  </template>
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
+ import VarButton from '..'
2
3
  import AppType from '@varlet/cli/site/mobile/components/AppType'
3
4
  import { watchLang } from '@varlet/cli/site/utils'
4
- import BasicUse from './BasicUse'
5
5
  import { pack, use } from './locale'
6
6
 
7
7
  watchLang(use)
@@ -9,5 +9,8 @@ watchLang(use)
9
9
 
10
10
  <template>
11
11
  <app-type>{{ pack.basicUse }}</app-type>
12
- <basic-use />
12
+ <var-button>{{ pack.start }}</var-button>
13
+
14
+ <app-type>{{ pack.modifyColor }}</app-type>
15
+ <var-button color="#03A9F4">{{ pack.start }}</var-button>
13
16
  </template>
@@ -2,10 +2,10 @@ import { defineComponent, PropType } from 'vue'
2
2
  import './button.less'
3
3
 
4
4
  // i18n for component's internal
5
- // import { pack } from '../locale'
5
+ import { pack } from '../locale'
6
6
 
7
7
  export default defineComponent({
8
- name: 'BButton',
8
+ name: 'VarButton',
9
9
  props: {
10
10
  color: {
11
11
  type: String,
@@ -21,12 +21,10 @@ export default defineComponent({
21
21
  const { color } = props
22
22
 
23
23
  return (
24
- <>
25
- <button class="basic-button" style={{ background: color }} onClick={handleClick}>
26
- {/* { pack.value.button } */}
27
- {slots.default?.()}
28
- </button>
29
- </>
24
+ <button class="var-button" style={{ background: color }} onClick={handleClick}>
25
+ {pack.value.button} -{'> '}
26
+ {slots.default?.()}
27
+ </button>
30
28
  )
31
29
  }
32
30
  },
@@ -1,7 +1,7 @@
1
- .basic-button {
1
+ .var-button {
2
2
  display: flex;
3
3
  padding: 10px;
4
- background: #009688;
4
+ background: #3a7afe;
5
5
  color: #fff;
6
6
  outline: none;
7
7
  border: none;
@@ -2,12 +2,16 @@
2
2
 
3
3
  ### Basic Use
4
4
  ```html
5
- <b-button>start</b-button>
5
+ <var-button>start</var-button>
6
+ ```
7
+
8
+ ```vue
9
+ import BasicUse from '../example/BasicUse'
6
10
  ```
7
11
 
8
12
  ### Theme Color Button
9
13
  ```html
10
- <b-button color="#009688">start</b-button>
14
+ <var-button color="#009688">start</var-button>
11
15
  ```
12
16
 
13
17
  ```vue
@@ -20,7 +24,7 @@ import ModifyColor from '../example/ModifyColor'
20
24
 
21
25
  | Prop | Description | Type | Default |
22
26
  | --- | --- | --- | --- |
23
- | `color` | 按钮颜色 | _string_ | `default` |
27
+ | `color` | Button background color | _string_ | `default` |
24
28
 
25
29
  ### Events
26
30
 
@@ -2,12 +2,16 @@
2
2
 
3
3
  ### 基本使用
4
4
  ```html
5
- <b-button>组件库从我开始</b-button>
5
+ <var-button>组件库从我开始</var-button>
6
+ ```
7
+
8
+ ```vue
9
+ import BasicUse from '../example/BasicUse'
6
10
  ```
7
11
 
8
12
  ### 主题色按钮
9
13
  ```html
10
- <b-button color="#009688">组件库从我开始</b-button>
14
+ <var-button color="#009688">组件库从我开始</var-button>
11
15
  ```
12
16
 
13
17
  ```vue
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
+ import VarButton from '../Button'
2
3
  import { watchLang } from '@varlet/cli/site/utils'
3
- import BButton from '../Button'
4
4
  import { pack, use } from './locale'
5
5
 
6
- watchLang(use)
6
+ watchLang(use, 'pc')
7
7
  </script>
8
8
 
9
9
  <template>
10
- <b-button>{{ pack.start }}</b-button>
10
+ <var-button>{{ pack.start }}</var-button>
11
11
  </template>
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
+ import VarButton from '../Button'
2
3
  import { watchLang } from '@varlet/cli/site/utils'
3
- import BButton from '../Button'
4
4
  import { pack, use } from './locale'
5
5
 
6
6
  watchLang(use, 'pc')
7
7
  </script>
8
8
 
9
9
  <template>
10
- <b-button color="#03A9F4">{{ pack.start }}</b-button>
10
+ <var-button color="#03A9F4">{{ pack.start }}</var-button>
11
11
  </template>
@@ -1,7 +1,6 @@
1
1
  <script setup>
2
2
  import AppType from '@varlet/cli/site/mobile/components/AppType'
3
3
  import { watchLang } from '@varlet/cli/site/utils'
4
- import BasicUse from './BasicUse'
5
4
  import { pack, use } from './locale'
6
5
 
7
6
  watchLang(use)
@@ -9,5 +8,8 @@ watchLang(use)
9
8
 
10
9
  <template>
11
10
  <app-type>{{ pack.basicUse }}</app-type>
12
- <basic-use />
11
+ <var-button>{{ pack.start }}</var-button>
12
+
13
+ <app-type>{{ pack.modifyColor }}</app-type>
14
+ <var-button color="#03A9F4">{{ pack.start }}</var-button>
13
15
  </template>
@@ -1,5 +1,5 @@
1
1
  import type { App } from 'vue'
2
- import Button from './Button.vue'
2
+ import Button from './Button'
3
3
 
4
4
  Button.install = function (app: App) {
5
5
  app.component(Button.name, Button)
@@ -1,7 +0,0 @@
1
- interface TestCommandOptions {
2
- watch?: boolean;
3
- component?: string;
4
- coverage?: boolean;
5
- }
6
- export declare function test({ component, watch, coverage }: TestCommandOptions): Promise<void>;
7
- export {};
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.test = void 0;
7
- const execa_1 = __importDefault(require("execa"));
8
- const constant_1 = require("../shared/constant");
9
- const compileSiteEntry_1 = require("../compiler/compileSiteEntry");
10
- async function test({ component, watch, coverage }) {
11
- process.env.NODE_ENV = 'test';
12
- // Test cases may contain documentation example code, and site dependencies need to build
13
- await (0, compileSiteEntry_1.buildSiteEntry)();
14
- const args = ['--config', constant_1.VITEST_CONFIG];
15
- if (!watch) {
16
- args.unshift('run');
17
- }
18
- if (coverage) {
19
- args.push('--coverage');
20
- }
21
- if (component) {
22
- args.push('--dir', `src/${component.trim()}`);
23
- }
24
- await (0, execa_1.default)('vitest', args, { stdin: 'inherit', stdout: 'inherit', stderr: 'inherit' });
25
- }
26
- exports.test = test;
@@ -1 +0,0 @@
1
- export declare function useVite(mode: 'build' | 'dev'): Promise<void>;