From 222b1fd5f7530837755ab0798becfea9ba0261bd Mon Sep 17 00:00:00 2001 From: Dan Popescu Date: Mon, 3 Jun 2024 15:03:31 +0300 Subject: [PATCH] fix: rename `vike-pinia` to `vike-vue-pinia` BREAKING CHANGE: all references to `vike-pinia` should be replaced with `vike-vue-pinia` b3c0c --- README.md | 6 +-- examples/{pinia => vue-pinia}/.gitignore | 0 examples/{pinia => vue-pinia}/assets/logo.svg | 0 .../components/Counter.vue | 0 .../{pinia => vue-pinia}/components/Link.vue | 0 .../layouts/HeadDefault.vue | 0 .../layouts/LayoutDefault.vue | 0 examples/{pinia => vue-pinia}/package.json | 2 +- .../{pinia => vue-pinia}/pages/+config.ts | 4 +- .../pages/_error/+Page.vue | 0 .../pages/about/+Page.vue | 0 .../pages/about/+config.ts | 0 .../pages/index/+Page.vue | 0 examples/{pinia => vue-pinia}/readme.md | 4 +- .../stores/useCounterStore.ts | 0 examples/{pinia => vue-pinia}/tsconfig.json | 0 examples/{pinia => vue-pinia}/vite.config.ts | 0 examples/{pinia => vue-pinia}/vue-shim.d.ts | 0 package.json | 2 +- packages/vike-pinia/renderer/+config.ts | 19 -------- .../{vike-pinia => vike-vue-pinia}/.gitignore | 0 .../CHANGELOG.md | 0 .../{vike-pinia => vike-vue-pinia}/README.md | 6 +-- .../package.json | 2 +- packages/vike-vue-pinia/renderer/+config.ts | 19 ++++++++ .../renderer/dehydratePinia.ts | 0 .../renderer/hydratePinia.ts | 0 .../renderer/installPinia.ts | 0 .../tsconfig.json | 0 pnpm-lock.yaml | 44 +++++++++---------- 30 files changed, 54 insertions(+), 54 deletions(-) rename examples/{pinia => vue-pinia}/.gitignore (100%) rename examples/{pinia => vue-pinia}/assets/logo.svg (100%) rename examples/{pinia => vue-pinia}/components/Counter.vue (100%) rename examples/{pinia => vue-pinia}/components/Link.vue (100%) rename examples/{pinia => vue-pinia}/layouts/HeadDefault.vue (100%) rename examples/{pinia => vue-pinia}/layouts/LayoutDefault.vue (100%) rename examples/{pinia => vue-pinia}/package.json (92%) rename examples/{pinia => vue-pinia}/pages/+config.ts (79%) rename examples/{pinia => vue-pinia}/pages/_error/+Page.vue (100%) rename examples/{pinia => vue-pinia}/pages/about/+Page.vue (100%) rename examples/{pinia => vue-pinia}/pages/about/+config.ts (100%) rename examples/{pinia => vue-pinia}/pages/index/+Page.vue (100%) rename examples/{pinia => vue-pinia}/readme.md (76%) rename examples/{pinia => vue-pinia}/stores/useCounterStore.ts (100%) rename examples/{pinia => vue-pinia}/tsconfig.json (100%) rename examples/{pinia => vue-pinia}/vite.config.ts (100%) rename examples/{pinia => vue-pinia}/vue-shim.d.ts (100%) delete mode 100644 packages/vike-pinia/renderer/+config.ts rename packages/{vike-pinia => vike-vue-pinia}/.gitignore (100%) rename packages/{vike-pinia => vike-vue-pinia}/CHANGELOG.md (100%) rename packages/{vike-pinia => vike-vue-pinia}/README.md (72%) rename packages/{vike-pinia => vike-vue-pinia}/package.json (97%) create mode 100644 packages/vike-vue-pinia/renderer/+config.ts rename packages/{vike-pinia => vike-vue-pinia}/renderer/dehydratePinia.ts (100%) rename packages/{vike-pinia => vike-vue-pinia}/renderer/hydratePinia.ts (100%) rename packages/{vike-pinia => vike-vue-pinia}/renderer/installPinia.ts (100%) rename packages/{vike-pinia => vike-vue-pinia}/tsconfig.json (100%) diff --git a/README.md b/README.md index 5e1d2504..a040f935 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ [](https://vike.dev) -# `vike-{vue,pinia,vue-query}` +# `vike-{vue,vue-pinia,vue-query}` [Vike extensions](https://vike.dev/extensions) for Vue: - [`vike-vue`](packages/vike-vue/) - [Changelog](packages/vike-vue/CHANGELOG.md) -- [`vike-pinia`](packages/vike-pinia/) - - [Changelog](packages/vike-pinia/CHANGELOG.md) +- [`vike-vue-pinia`](packages/vike-vue-pinia/) + - [Changelog](packages/vike-vue-pinia/CHANGELOG.md) - [`vike-vue-query`](packages/vike-vue-query/) - [Changelog](packages/vike-vue-query/CHANGELOG.md) diff --git a/examples/pinia/.gitignore b/examples/vue-pinia/.gitignore similarity index 100% rename from examples/pinia/.gitignore rename to examples/vue-pinia/.gitignore diff --git a/examples/pinia/assets/logo.svg b/examples/vue-pinia/assets/logo.svg similarity index 100% rename from examples/pinia/assets/logo.svg rename to examples/vue-pinia/assets/logo.svg diff --git a/examples/pinia/components/Counter.vue b/examples/vue-pinia/components/Counter.vue similarity index 100% rename from examples/pinia/components/Counter.vue rename to examples/vue-pinia/components/Counter.vue diff --git a/examples/pinia/components/Link.vue b/examples/vue-pinia/components/Link.vue similarity index 100% rename from examples/pinia/components/Link.vue rename to examples/vue-pinia/components/Link.vue diff --git a/examples/pinia/layouts/HeadDefault.vue b/examples/vue-pinia/layouts/HeadDefault.vue similarity index 100% rename from examples/pinia/layouts/HeadDefault.vue rename to examples/vue-pinia/layouts/HeadDefault.vue diff --git a/examples/pinia/layouts/LayoutDefault.vue b/examples/vue-pinia/layouts/LayoutDefault.vue similarity index 100% rename from examples/pinia/layouts/LayoutDefault.vue rename to examples/vue-pinia/layouts/LayoutDefault.vue diff --git a/examples/pinia/package.json b/examples/vue-pinia/package.json similarity index 92% rename from examples/pinia/package.json rename to examples/vue-pinia/package.json index f0e3cb1e..e3109325 100644 --- a/examples/pinia/package.json +++ b/examples/vue-pinia/package.json @@ -8,7 +8,7 @@ "@vitejs/plugin-vue": "^5.0.4", "pinia": "^2.1.7", "vike": "^0.4.172", - "vike-pinia": "^0.0.4", + "vike-vue-pinia": "^0.0.4", "vike-vue": "^0.6.8", "vite": "^5.2.9", "vue": "^3.4.23" diff --git a/examples/pinia/pages/+config.ts b/examples/vue-pinia/pages/+config.ts similarity index 79% rename from examples/pinia/pages/+config.ts rename to examples/vue-pinia/pages/+config.ts index 3e185b2f..88f3b685 100644 --- a/examples/pinia/pages/+config.ts +++ b/examples/vue-pinia/pages/+config.ts @@ -2,7 +2,7 @@ import type { Config } from 'vike/types' import Layout from '../layouts/LayoutDefault.vue' import Head from '../layouts/HeadDefault.vue' import vikeVue from 'vike-vue/config' -import vikePinia from 'vike-pinia/config' +import vikeVuePinia from 'vike-vue-pinia/config' // Default configs (can be overridden by pages) export default { @@ -10,5 +10,5 @@ export default { Head, // title: 'My Vike + Vue + Pinia App', - extends: [vikeVue, vikePinia], + extends: [vikeVue, vikeVuePinia], } satisfies Config diff --git a/examples/pinia/pages/_error/+Page.vue b/examples/vue-pinia/pages/_error/+Page.vue similarity index 100% rename from examples/pinia/pages/_error/+Page.vue rename to examples/vue-pinia/pages/_error/+Page.vue diff --git a/examples/pinia/pages/about/+Page.vue b/examples/vue-pinia/pages/about/+Page.vue similarity index 100% rename from examples/pinia/pages/about/+Page.vue rename to examples/vue-pinia/pages/about/+Page.vue diff --git a/examples/pinia/pages/about/+config.ts b/examples/vue-pinia/pages/about/+config.ts similarity index 100% rename from examples/pinia/pages/about/+config.ts rename to examples/vue-pinia/pages/about/+config.ts diff --git a/examples/pinia/pages/index/+Page.vue b/examples/vue-pinia/pages/index/+Page.vue similarity index 100% rename from examples/pinia/pages/index/+Page.vue rename to examples/vue-pinia/pages/index/+Page.vue diff --git a/examples/pinia/readme.md b/examples/vue-pinia/readme.md similarity index 76% rename from examples/pinia/readme.md rename to examples/vue-pinia/readme.md index f2d8ca09..4fd7926f 100644 --- a/examples/pinia/readme.md +++ b/examples/vue-pinia/readme.md @@ -1,9 +1,9 @@ -Example of using [Pinia](https://pinia.vuejs.org/) with the `vike-pinia` extension. +Example of using [Pinia](https://pinia.vuejs.org/) with the `vike-vue-pinia` extension. ```bash git clone git@github.com:vikejs/vike-vue cd vike-vue/ pnpm install -cd examples/pinia/ +cd examples/vue-pinia/ pnpm run dev ``` diff --git a/examples/pinia/stores/useCounterStore.ts b/examples/vue-pinia/stores/useCounterStore.ts similarity index 100% rename from examples/pinia/stores/useCounterStore.ts rename to examples/vue-pinia/stores/useCounterStore.ts diff --git a/examples/pinia/tsconfig.json b/examples/vue-pinia/tsconfig.json similarity index 100% rename from examples/pinia/tsconfig.json rename to examples/vue-pinia/tsconfig.json diff --git a/examples/pinia/vite.config.ts b/examples/vue-pinia/vite.config.ts similarity index 100% rename from examples/pinia/vite.config.ts rename to examples/vue-pinia/vite.config.ts diff --git a/examples/pinia/vue-shim.d.ts b/examples/vue-pinia/vue-shim.d.ts similarity index 100% rename from examples/pinia/vue-shim.d.ts rename to examples/vue-pinia/vue-shim.d.ts diff --git a/package.json b/package.json index b013320d..7f1dab29 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "pnpm": { "overrides": { "vike-vue": "link:./packages/vike-vue/", - "vike-pinia": "link:./packages/vike-pinia/", + "vike-vue-pinia": "link:./packages/vike-vue-pinia/", "vike-vue-query": "link:./packages/vike-vue-query/" } }, diff --git a/packages/vike-pinia/renderer/+config.ts b/packages/vike-pinia/renderer/+config.ts deleted file mode 100644 index 86df3f12..00000000 --- a/packages/vike-pinia/renderer/+config.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Pinia, StateTree } from 'pinia' - -export default { - name: 'vike-pinia', - onCreateApp: 'import:vike-pinia/renderer/installPinia:installPinia', - onAfterRenderSSRApp: 'import:vike-pinia/renderer/dehydratePinia:dehydratePinia', - onBeforeMountApp: 'import:vike-pinia/renderer/hydratePinia:hydratePinia', -} - -declare global { - namespace Vike { - interface PageContext { - pinia?: Pinia - fromHtmlRenderer: { - piniaInitialState?: StateTree - } - } - } -} diff --git a/packages/vike-pinia/.gitignore b/packages/vike-vue-pinia/.gitignore similarity index 100% rename from packages/vike-pinia/.gitignore rename to packages/vike-vue-pinia/.gitignore diff --git a/packages/vike-pinia/CHANGELOG.md b/packages/vike-vue-pinia/CHANGELOG.md similarity index 100% rename from packages/vike-pinia/CHANGELOG.md rename to packages/vike-vue-pinia/CHANGELOG.md diff --git a/packages/vike-pinia/README.md b/packages/vike-vue-pinia/README.md similarity index 72% rename from packages/vike-pinia/README.md rename to packages/vike-vue-pinia/README.md index dac46e85..b1ea1f20 100644 --- a/packages/vike-pinia/README.md +++ b/packages/vike-vue-pinia/README.md @@ -1,12 +1,12 @@ <!-- WARNING: keep links absolute in this file so they work on NPM too --> [<img src="https://vike.dev/vike-readme.svg" align="right" height="90">](https://vike.dev) -[![npm version](https://img.shields.io/npm/v/vike-pinia)](https://www.npmjs.com/package/vike-pinia) +[![npm version](https://img.shields.io/npm/v/vike-vue-pinia)](https://www.npmjs.com/package/vike-vue-pinia) -# `vike-pinia` +# `vike-vue-pinia` Pinia integration for Vike, see [vike.dev/pinia](https://vike.dev/pinia). - [Documentation](https://vike.dev) - [Example](https://github.com/vikejs/vike-vue/tree/main/examples/pinia) -- [Changelog](https://github.com/vikejs/vike-vue/blob/main/packages/vike-pinia/CHANGELOG.md) +- [Changelog](https://github.com/vikejs/vike-vue/blob/main/packages/vike-vue-pinia/CHANGELOG.md) diff --git a/packages/vike-pinia/package.json b/packages/vike-vue-pinia/package.json similarity index 97% rename from packages/vike-pinia/package.json rename to packages/vike-vue-pinia/package.json index f47ae3ba..883cc387 100644 --- a/packages/vike-pinia/package.json +++ b/packages/vike-vue-pinia/package.json @@ -1,5 +1,5 @@ { - "name": "vike-pinia", + "name": "vike-vue-pinia", "version": "0.0.4", "description": "", "main": "./dist/+config.js", diff --git a/packages/vike-vue-pinia/renderer/+config.ts b/packages/vike-vue-pinia/renderer/+config.ts new file mode 100644 index 00000000..ac61c250 --- /dev/null +++ b/packages/vike-vue-pinia/renderer/+config.ts @@ -0,0 +1,19 @@ +import type { Pinia, StateTree } from 'pinia' + +export default { + name: 'vike-vue-pinia', + onCreateApp: 'import:vike-vue-pinia/renderer/installPinia:installPinia', + onAfterRenderSSRApp: 'import:vike-vue-pinia/renderer/dehydratePinia:dehydratePinia', + onBeforeMountApp: 'import:vike-vue-pinia/renderer/hydratePinia:hydratePinia', +} + +declare global { + namespace Vike { + interface PageContext { + pinia?: Pinia + fromHtmlRenderer: { + piniaInitialState?: StateTree + } + } + } +} diff --git a/packages/vike-pinia/renderer/dehydratePinia.ts b/packages/vike-vue-pinia/renderer/dehydratePinia.ts similarity index 100% rename from packages/vike-pinia/renderer/dehydratePinia.ts rename to packages/vike-vue-pinia/renderer/dehydratePinia.ts diff --git a/packages/vike-pinia/renderer/hydratePinia.ts b/packages/vike-vue-pinia/renderer/hydratePinia.ts similarity index 100% rename from packages/vike-pinia/renderer/hydratePinia.ts rename to packages/vike-vue-pinia/renderer/hydratePinia.ts diff --git a/packages/vike-pinia/renderer/installPinia.ts b/packages/vike-vue-pinia/renderer/installPinia.ts similarity index 100% rename from packages/vike-pinia/renderer/installPinia.ts rename to packages/vike-vue-pinia/renderer/installPinia.ts diff --git a/packages/vike-pinia/tsconfig.json b/packages/vike-vue-pinia/tsconfig.json similarity index 100% rename from packages/vike-pinia/tsconfig.json rename to packages/vike-vue-pinia/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42ca7295..9a0ada70 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,7 +6,7 @@ settings: overrides: vike-vue: link:./packages/vike-vue/ - vike-pinia: link:./packages/vike-pinia/ + vike-vue-pinia: link:./packages/vike-vue-pinia/ vike-vue-query: link:./packages/vike-vue-query/ importers: @@ -89,7 +89,7 @@ importers: specifier: ^3.4.23 version: 3.4.23(typescript@5.4.5) - examples/pinia: + examples/vue-pinia: dependencies: '@vitejs/plugin-vue': specifier: ^5.0.4 @@ -100,12 +100,12 @@ importers: vike: specifier: ^0.4.172 version: 0.4.172(vite@5.2.9(@types/node@20.12.7)) - vike-pinia: - specifier: link:../../packages/vike-pinia - version: link:../../packages/vike-pinia vike-vue: specifier: link:../../packages/vike-vue version: link:../../packages/vike-vue + vike-vue-pinia: + specifier: link:../../packages/vike-vue-pinia + version: link:../../packages/vike-vue-pinia vite: specifier: ^5.2.9 version: 5.2.9(@types/node@20.12.7) @@ -157,7 +157,7 @@ importers: specifier: ^1.8.27 version: 1.8.27(typescript@5.4.5) - packages/vike-pinia: + packages/vike-vue: devDependencies: '@brillout/release-me': specifier: ^0.3.8 @@ -165,18 +165,21 @@ importers: '@types/node': specifier: ^20.12.7 version: 20.12.7 - pinia: - specifier: ^2.1.7 - version: 2.1.7(typescript@5.4.5)(vue@3.4.23(typescript@5.4.5)) + '@vitejs/plugin-vue': + specifier: ^5.0.4 + version: 5.0.4(vite@5.2.9(@types/node@20.12.7))(vue@3.4.23(typescript@5.4.5)) typescript: specifier: ^5.4.5 version: 5.4.5 vike: specifier: ^0.4.172 version: 0.4.172(vite@5.2.9(@types/node@20.12.7)) - vike-vue: - specifier: link:../vike-vue - version: link:../vike-vue + vite: + specifier: ^5.2.9 + version: 5.2.9(@types/node@20.12.7) + vite-plugin-dts: + specifier: ^3.8.3 + version: 3.8.3(@types/node@20.12.7)(rollup@4.14.3)(typescript@5.4.5)(vite@5.2.9(@types/node@20.12.7)) vue: specifier: ^3.4.23 version: 3.4.23(typescript@5.4.5) @@ -184,7 +187,7 @@ importers: specifier: ^2.0.13 version: 2.0.13(typescript@5.4.5) - packages/vike-vue: + packages/vike-vue-pinia: devDependencies: '@brillout/release-me': specifier: ^0.3.8 @@ -192,21 +195,18 @@ importers: '@types/node': specifier: ^20.12.7 version: 20.12.7 - '@vitejs/plugin-vue': - specifier: ^5.0.4 - version: 5.0.4(vite@5.2.9(@types/node@20.12.7))(vue@3.4.23(typescript@5.4.5)) + pinia: + specifier: ^2.1.7 + version: 2.1.7(typescript@5.4.5)(vue@3.4.23(typescript@5.4.5)) typescript: specifier: ^5.4.5 version: 5.4.5 vike: specifier: ^0.4.172 version: 0.4.172(vite@5.2.9(@types/node@20.12.7)) - vite: - specifier: ^5.2.9 - version: 5.2.9(@types/node@20.12.7) - vite-plugin-dts: - specifier: ^3.8.3 - version: 3.8.3(@types/node@20.12.7)(rollup@4.14.3)(typescript@5.4.5)(vite@5.2.9(@types/node@20.12.7)) + vike-vue: + specifier: link:../vike-vue + version: link:../vike-vue vue: specifier: ^3.4.23 version: 3.4.23(typescript@5.4.5)