Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Commit 154d9bf

Browse files
Michael.KryvoruchkoMichael.Kryvoruchko
authored andcommitted
feat: upgrade dev playground
- setup auto import from vue and gitart-vue-dialog - setup auto import gitart-vue-dialog components
1 parent 1e12713 commit 154d9bf

File tree

7 files changed

+194
-22
lines changed

7 files changed

+194
-22
lines changed

packages/dialog/dev/.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-env node */
2+
module.exports = {
3+
extends: [
4+
'../../../.eslintrc.js',
5+
],
6+
7+
rules: {
8+
'no-undef': 'off',
9+
},
10+
}

packages/dialog/dev/Playground.template.vue

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,6 @@
1111
</button>
1212
</template>
1313

14-
<script lang="ts">
15-
import { ref } from 'vue'
16-
import { GDialog } from 'gitart-vue-dialog'
17-
18-
export default {
19-
name: 'Playground',
20-
components: {
21-
GDialog,
22-
},
23-
24-
setup() {
25-
const dialog = ref(false)
26-
27-
return {
28-
dialog,
29-
}
30-
},
31-
}
14+
<script setup lang="ts">
15+
const dialog = ref(false)
3216
</script>

packages/dialog/dev/auto-imports.d.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Generated by 'unplugin-auto-import'
2+
// We suggest you to commit this file into source control
3+
declare global {
4+
const computed: typeof import('vue')['computed']
5+
const createApp: typeof import('vue')['createApp']
6+
const customRef: typeof import('vue')['customRef']
7+
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
8+
const defineComponent: typeof import('vue')['defineComponent']
9+
const dialogInjectionKey: typeof import('gitart-vue-dialog')['dialogInjectionKey']
10+
const dialogPlugin: typeof import('gitart-vue-dialog')['plugin']
11+
const effectScope: typeof import('vue')['effectScope']
12+
const EffectScope: typeof import('vue')['EffectScope']
13+
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
14+
const getCurrentScope: typeof import('vue')['getCurrentScope']
15+
const h: typeof import('vue')['h']
16+
const inject: typeof import('vue')['inject']
17+
const isReadonly: typeof import('vue')['isReadonly']
18+
const isRef: typeof import('vue')['isRef']
19+
const markRaw: typeof import('vue')['markRaw']
20+
const nextTick: typeof import('vue')['nextTick']
21+
const onActivated: typeof import('vue')['onActivated']
22+
const onBeforeMount: typeof import('vue')['onBeforeMount']
23+
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
24+
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
25+
const onDeactivated: typeof import('vue')['onDeactivated']
26+
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
27+
const onMounted: typeof import('vue')['onMounted']
28+
const onRenderTracked: typeof import('vue')['onRenderTracked']
29+
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
30+
const onScopeDispose: typeof import('vue')['onScopeDispose']
31+
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
32+
const onUnmounted: typeof import('vue')['onUnmounted']
33+
const onUpdated: typeof import('vue')['onUpdated']
34+
const provide: typeof import('vue')['provide']
35+
const reactive: typeof import('vue')['reactive']
36+
const readonly: typeof import('vue')['readonly']
37+
const ref: typeof import('vue')['ref']
38+
const shallowReactive: typeof import('vue')['shallowReactive']
39+
const shallowReadonly: typeof import('vue')['shallowReadonly']
40+
const shallowRef: typeof import('vue')['shallowRef']
41+
const toRaw: typeof import('vue')['toRaw']
42+
const toRef: typeof import('vue')['toRef']
43+
const toRefs: typeof import('vue')['toRefs']
44+
const triggerRef: typeof import('vue')['triggerRef']
45+
const unref: typeof import('vue')['unref']
46+
const useAttrs: typeof import('vue')['useAttrs']
47+
const useCssModule: typeof import('vue')['useCssModule']
48+
const useSlots: typeof import('vue')['useSlots']
49+
const watch: typeof import('vue')['watch']
50+
const watchEffect: typeof import('vue')['watchEffect']
51+
}
52+
export {}

packages/dialog/dev/components.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// generated by unplugin-vue-components
2+
// We suggest you to commit this file into source control
3+
// Read more: https://github.com/vuejs/vue-next/pull/3399
4+
5+
declare module 'vue' {
6+
export interface GlobalComponents {
7+
GDialog: typeof import('gitart-vue-dialog')['GDialog']
8+
GDialogRoot: typeof import('gitart-vue-dialog')['GDialogRoot']
9+
}
10+
}
11+
12+
export { }

packages/dialog/dev/vite.config.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import path from 'path'
33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'
5+
import AutoImport from 'unplugin-auto-import/vite'
6+
import Components from 'unplugin-vue-components/vite'
57
import WindiCSS from 'vite-plugin-windicss'
68

79
const resolve = (str: string) => path.resolve(__dirname, str)
@@ -11,6 +13,33 @@ export default defineConfig({
1113

1214
plugins: [
1315
vue(),
16+
AutoImport({
17+
imports: [
18+
'vue',
19+
{
20+
'gitart-vue-dialog': [
21+
'dialogInjectionKey',
22+
['plugin', 'dialogPlugin'],
23+
],
24+
},
25+
],
26+
dts: resolve('auto-imports.d.ts'),
27+
}),
28+
Components({
29+
resolvers: [
30+
(name: string) => {
31+
if ([
32+
'GDialog',
33+
'GDialogRoot',
34+
].includes(name)) {
35+
return { importName: name, path: 'gitart-vue-dialog' }
36+
}
37+
38+
return
39+
},
40+
],
41+
dts: resolve('components.d.ts'),
42+
}),
1443
WindiCSS(),
1544
],
1645

packages/dialog/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"@vitejs/plugin-vue": "^1.6.0",
4444
"sass": "^1.39.0",
4545
"shelljs": "^0.8.4",
46+
"unplugin-auto-import": "^0.5.1",
47+
"unplugin-vue-components": "^0.17.5",
4648
"vite": "^2.5.3",
4749
"vue": "3.2.6",
4850
"vue-tsc": "^0.29.8"

yarn.lock

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
dependencies:
1010
"@types/throttle-debounce" "^2.1.0"
1111

12+
"@antfu/utils@^0.3.0":
13+
version "0.3.0"
14+
resolved "https://registry.yarnpkg.com/@antfu/utils/-/utils-0.3.0.tgz#6306c43b52a883bd8e973e3ed8dd64248418bcc4"
15+
integrity sha512-UU8TLr/EoXdg7OjMp0h9oDoIAVr+Z/oW9cpOxQQyrsz6Qzd2ms/1CdWx8fl2OQdFpxGmq5Vc4TwfLHId6nAZjA==
16+
dependencies:
17+
"@types/throttle-debounce" "^2.1.0"
18+
1219
1320
version "7.12.11"
1421
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
@@ -284,6 +291,14 @@
284291
"@nodelib/fs.scandir" "2.1.5"
285292
fastq "^1.6.0"
286293

294+
"@rollup/pluginutils@^4.1.1":
295+
version "4.1.1"
296+
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.1.1.tgz#1d4da86dd4eded15656a57d933fda2b9a08d47ec"
297+
integrity sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==
298+
dependencies:
299+
estree-walker "^2.0.1"
300+
picomatch "^2.2.2"
301+
287302
"@stylelint/postcss-css-in-js@^0.37.2":
288303
version "0.37.2"
289304
resolved "https://registry.yarnpkg.com/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.2.tgz#7e5a84ad181f4234a2480803422a47b8749af3d2"
@@ -851,6 +866,13 @@ browserslist@^4.12.0, browserslist@^4.16.6:
851866
escalade "^3.1.1"
852867
node-releases "^1.1.75"
853868

869+
builtins@^4.0.0:
870+
version "4.0.0"
871+
resolved "https://registry.yarnpkg.com/builtins/-/builtins-4.0.0.tgz#a8345420de82068fdc4d6559d0456403a8fb1905"
872+
integrity sha512-qC0E2Dxgou1IHhvJSLwGDSTvokbRovU5zZFuDY6oY8Y2lF3nGt5Ad8YZK7GMtqzY84Wu7pXTPeHQeHcXSXsRhw==
873+
dependencies:
874+
semver "^7.0.0"
875+
854876
cac@^6.7.2:
855877
version "6.7.3"
856878
resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.3.tgz#10410b8611677990cc2e3c8b576d471c1d71b768"
@@ -927,7 +949,7 @@ character-reference-invalid@^1.0.0:
927949
resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560"
928950
integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==
929951

930-
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.1:
952+
"chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.1, chokidar@^3.5.2:
931953
version "3.5.2"
932954
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
933955
integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
@@ -1502,7 +1524,7 @@ estraverse@^5.1.0, estraverse@^5.2.0:
15021524
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880"
15031525
integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==
15041526

1505-
estree-walker@^2.0.2:
1527+
estree-walker@^2.0.1, estree-walker@^2.0.2:
15061528
version "2.0.2"
15071529
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
15081530
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
@@ -1903,6 +1925,13 @@ import-lazy@^4.0.0:
19031925
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153"
19041926
integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==
19051927

1928+
import-meta-resolve@^1.1.1:
1929+
version "1.1.1"
1930+
resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-1.1.1.tgz#244fd542fd1fae73550d4f8b3cde3bba1d7b2b18"
1931+
integrity sha512-JiTuIvVyPaUg11eTrNDx5bgQ/yMKMZffc7YSjvQeSMXy58DO2SQ8BtAf3xteZvmzvjYh14wnqNjL8XVeDy2o9A==
1932+
dependencies:
1933+
builtins "^4.0.0"
1934+
19061935
imurmurhash@^0.1.4:
19071936
version "0.1.4"
19081937
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
@@ -2260,6 +2289,13 @@ loader-utils@^1.1.0:
22602289
emojis-list "^3.0.0"
22612290
json5 "^1.0.1"
22622291

2292+
local-pkg@^0.4.0:
2293+
version "0.4.0"
2294+
resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.0.tgz#e6221171813d5a0812dd84fa80ffb1c8fcc00531"
2295+
integrity sha512-2XBWjO/v63JeR1HPzLJxdTVRQDB84Av2p2KtBA5ahvpyLUPubcAU6iXlAJrONcY7aSqgJhXxElAnKtnYsRolPQ==
2296+
dependencies:
2297+
mlly "^0.2.2"
2298+
22632299
locate-path@^2.0.0:
22642300
version "2.0.0"
22652301
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
@@ -2469,6 +2505,13 @@ mkdirp@~1.0.4:
24692505
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
24702506
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
24712507

2508+
mlly@^0.2.2:
2509+
version "0.2.10"
2510+
resolved "https://registry.yarnpkg.com/mlly/-/mlly-0.2.10.tgz#645902c9761dc6b5ded174b8e717147fe52e4893"
2511+
integrity sha512-xfyW6c2QBGArtctzNnTV5leOKX8nOMz2simeubtXofdsdSJFSNw+Ncvrs8kxcN3pBrQLXuYBHNFV6NgZ5Ryf4A==
2512+
dependencies:
2513+
import-meta-resolve "^1.1.1"
2514+
24722515
24732516
version "2.0.0"
24742517
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -2732,7 +2775,7 @@ path-type@^4.0.0:
27322775
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
27332776
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
27342777

2735-
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
2778+
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3:
27362779
version "2.3.0"
27372780
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
27382781
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
@@ -3250,7 +3293,7 @@ semver@^6.3.0:
32503293
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
32513294
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
32523295

3253-
semver@^7.2.1, semver@^7.3.4, semver@^7.3.5:
3296+
semver@^7.0.0, semver@^7.2.1, semver@^7.3.4, semver@^7.3.5:
32543297
version "7.3.5"
32553298
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
32563299
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
@@ -3768,6 +3811,41 @@ unist-util-stringify-position@^2.0.0:
37683811
dependencies:
37693812
"@types/unist" "^2.0.2"
37703813

3814+
unplugin-auto-import@^0.5.1:
3815+
version "0.5.1"
3816+
resolved "https://registry.yarnpkg.com/unplugin-auto-import/-/unplugin-auto-import-0.5.1.tgz#e1d4447c0da73b092cf73d9afac9c6e681715510"
3817+
integrity sha512-Q3CvNbCB7nLbu+JdrF6jYs0Nx7kHmV2KzDcZHzTrdri3EhU1lUOgto+ce+Jw01Ds7RxBi9lwWwF3QoFwFPul1A==
3818+
dependencies:
3819+
"@antfu/utils" "^0.3.0"
3820+
"@rollup/pluginutils" "^4.1.1"
3821+
local-pkg "^0.4.0"
3822+
magic-string "^0.25.7"
3823+
resolve "^1.20.0"
3824+
unplugin "^0.2.21"
3825+
3826+
unplugin-vue-components@^0.17.5:
3827+
version "0.17.5"
3828+
resolved "https://registry.yarnpkg.com/unplugin-vue-components/-/unplugin-vue-components-0.17.5.tgz#0a08b60e11757a577246d358ecc2efa497b79fdf"
3829+
integrity sha512-KjvKCMgVtfJypDfRkM90s++ayOjwjpJWmlksnOfX1hASIshdYlJuBqO/DE6YTPG7kAk8+83py50yKBioNj9wAw==
3830+
dependencies:
3831+
"@antfu/utils" "^0.3.0"
3832+
"@rollup/pluginutils" "^4.1.1"
3833+
chokidar "^3.5.2"
3834+
debug "^4.3.2"
3835+
fast-glob "^3.2.7"
3836+
local-pkg "^0.4.0"
3837+
magic-string "^0.25.7"
3838+
minimatch "^3.0.4"
3839+
resolve "^1.20.0"
3840+
unplugin "^0.2.21"
3841+
3842+
unplugin@^0.2.21:
3843+
version "0.2.21"
3844+
resolved "https://registry.yarnpkg.com/unplugin/-/unplugin-0.2.21.tgz#7852cddd9f78f0b32881812fd2efd5a39dcc64e5"
3845+
integrity sha512-IJ15/L5XbhnV7J09Zjk0FT5HEkBjkXucWAXQWRsmEtUxmmxwh23yavrmDbCF6ZPxWiVB28+wnKIHePTRRpQPbQ==
3846+
dependencies:
3847+
webpack-virtual-modules "^0.4.3"
3848+
37713849
upath@^2.0.1:
37723850
version "2.0.1"
37733851
resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b"
@@ -4012,6 +4090,11 @@ [email protected]:
40124090
"@vue/runtime-dom" "3.2.6"
40134091
"@vue/shared" "3.2.6"
40144092

4093+
webpack-virtual-modules@^0.4.3:
4094+
version "0.4.3"
4095+
resolved "https://registry.yarnpkg.com/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz#cd597c6d51d5a5ecb473eea1983a58fa8a17ded9"
4096+
integrity sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==
4097+
40154098
which-boxed-primitive@^1.0.2:
40164099
version "1.0.2"
40174100
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"

0 commit comments

Comments
 (0)