From: Eduardo San Martin Morote Date: Sun, 11 Jul 2021 19:02:29 +0000 (+0200) Subject: chore: add playground to test X-Git-Tag: v2.0.0-rc.0~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=156bdddc840cc43b8e4f2e3314e55e1ef1502b33;p=thirdparty%2Fvuejs%2Fpinia.git chore: add playground to test --- diff --git a/docs/vite.config.js b/docs/vite.config.js index f23e4ec9..c51ed741 100644 --- a/docs/vite.config.js +++ b/docs/vite.config.js @@ -1,7 +1,5 @@ import { defineConfig } from 'vite' -console.log('loaded config') - export default defineConfig({ define: { __DEV__: 'true', diff --git a/index.html b/index.html new file mode 100644 index 00000000..b4cd94ab --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + 🍍 Pinia playground + + +
+ + + diff --git a/package.json b/package.json index 7e314d62..1f78d3ab 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,8 @@ "@types/node": "^16.0.1", "@vue/server-renderer": "^3.1.5", "@vue/test-utils": "^2.0.0-rc.10", + "@vitejs/plugin-vue": "^1.2.4", + "@vue/compiler-sfc": "npm:@knightly/vue__compiler-sfc@3-2", "@vueuse/core": "^5.1.3", "brotli": "^1.3.2", "codecov": "^3.8.2", @@ -86,6 +88,7 @@ "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.30.0", "typescript": "~4.3.5", + "vite": "^2.4.1", "vitepress": "^0.15.6", "vue": "^3.1.5", "yorkie": "^2.0.0" diff --git a/playground/.gitignore b/playground/.gitignore new file mode 100644 index 00000000..d451ff16 --- /dev/null +++ b/playground/.gitignore @@ -0,0 +1,5 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local diff --git a/playground/src/App.vue b/playground/src/App.vue new file mode 100644 index 00000000..f151f0a9 --- /dev/null +++ b/playground/src/App.vue @@ -0,0 +1,18 @@ + + + + + diff --git a/docs/.vitepress/components/TestCounterStore.vue b/playground/src/components/TestCounterStore.vue similarity index 100% rename from docs/.vitepress/components/TestCounterStore.vue rename to playground/src/components/TestCounterStore.vue diff --git a/docs/.vitepress/components/TestStore.vue b/playground/src/components/TestStore.vue similarity index 92% rename from docs/.vitepress/components/TestStore.vue rename to playground/src/components/TestStore.vue index 156f07f4..a5b1c272 100644 --- a/docs/.vitepress/components/TestStore.vue +++ b/playground/src/components/TestStore.vue @@ -6,7 +6,7 @@

Counter: {{ counterStore.double }} = 2 x {{ counterStore.n }}

- +
diff --git a/playground/src/main.ts b/playground/src/main.ts new file mode 100644 index 00000000..1d3ea99e --- /dev/null +++ b/playground/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import { createPinia } from '../../src' + +createApp(App).use(createPinia()).mount('#app') diff --git a/playground/src/shims-vue.d.ts b/playground/src/shims-vue.d.ts new file mode 100644 index 00000000..ac1ded79 --- /dev/null +++ b/playground/src/shims-vue.d.ts @@ -0,0 +1,5 @@ +declare module '*.vue' { + import { DefineComponent } from 'vue' + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/docs/.vitepress/stores/cart.ts b/playground/src/stores/cart.ts similarity index 100% rename from docs/.vitepress/stores/cart.ts rename to playground/src/stores/cart.ts diff --git a/docs/.vitepress/stores/counter.ts b/playground/src/stores/counter.ts similarity index 100% rename from docs/.vitepress/stores/counter.ts rename to playground/src/stores/counter.ts diff --git a/docs/.vitepress/stores/user.ts b/playground/src/stores/user.ts similarity index 100% rename from docs/.vitepress/stores/user.ts rename to playground/src/stores/user.ts diff --git a/playground/src/vite-env.d.ts b/playground/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/playground/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 00000000..5a5c18d6 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [vue()], + define: { + __DEV__: 'true', + __BROWSER__: 'true', + __TEST__: 'false', + }, + optimizeDeps: { + exclude: ['@vueuse/shared', '@vueuse/core'], + }, +}) diff --git a/yarn.lock b/yarn.lock index 7f63de74..bcc45823 100644 --- a/yarn.lock +++ b/yarn.lock @@ -996,7 +996,7 @@ dependencies: "@types/yargs-parser" "*" -"@vitejs/plugin-vue@^1.2.3": +"@vitejs/plugin-vue@^1.2.3", "@vitejs/plugin-vue@^1.2.4": version "1.2.4" resolved "https://registry.yarnpkg.com/@vitejs/plugin-vue/-/plugin-vue-1.2.4.tgz#a7aa6e6a31c556a8b781de730316deeecf7f56f2" integrity sha512-D/3H9plevPQGgQGwmV6eecvOnooLTecPR63HPffVVWPEhbfvmtYLWgznzs456NBb2DItiRTCIa1yWxvGqC+I8A== @@ -5732,7 +5732,7 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= -vite@^2.3.7: +vite@^2.3.7, vite@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/vite/-/vite-2.4.1.tgz#2e48b8dbfc69e4edbf7f4d1c0798d621585cb8da" integrity sha512-4BpKRis9uxIqPfIEcJ18LTBsamqnDFxTx45CXwagHjNltHa6PFEvf8Pe6OpgIHb0OyWT30OXOSSQvdOaX4OBiQ==