From 6635e3403a3c02241ad259cd8e4284aee019d758 Mon Sep 17 00:00:00 2001 From: valere Date: Sat, 20 Sep 2025 00:30:15 +0200 Subject: [PATCH] test --- app/components/nuxt-template.vue | 15 ++++++++++-- app/store/testStore.ts | 18 ++++++++++++++ nuxt.config.ts | 5 +++- package.json | 2 ++ pnpm-lock.yaml | 41 ++++++++++++++++++++++++++++++++ 5 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 app/store/testStore.ts diff --git a/app/components/nuxt-template.vue b/app/components/nuxt-template.vue index ff40949..c559a25 100644 --- a/app/components/nuxt-template.vue +++ b/app/components/nuxt-template.vue @@ -1,5 +1,16 @@ + + diff --git a/app/store/testStore.ts b/app/store/testStore.ts new file mode 100644 index 0000000..76a88b1 --- /dev/null +++ b/app/store/testStore.ts @@ -0,0 +1,18 @@ +import { defineStore } from 'pinia' + +export const useTestStore = defineStore('test', { + state: () => ({ + datas: Array(), + }), + + actions: { + async addData() { + this.datas.push('item') + } + }, + + getters: { + // Obtenir tous les compilations + getDatas: (state) => state.datas + } +}) diff --git a/nuxt.config.ts b/nuxt.config.ts index 872c7b7..3fafec9 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -2,5 +2,8 @@ export default defineNuxtConfig({ compatibilityDate: '2025-07-15', devtools: { enabled: true }, - modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss'] + modules: ['@nuxt/eslint', '@nuxtjs/tailwindcss', '@pinia/nuxt'], + pinia: { + storesDirs: ['./stores/**'], + }, }) \ No newline at end of file diff --git a/package.json b/package.json index 5b28ceb..3aa7869 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,10 @@ "dependencies": { "@nuxt/eslint": "1.9.0", "@nuxtjs/tailwindcss": "6.14.0", + "@pinia/nuxt": "0.11.2", "eslint": "^9.33.0", "nuxt": "^4.0.3", + "pinia": "^3.0.3", "vue": "^3.5.18", "vue-router": "^4.5.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1005d2f..6e2ae55 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,12 +14,18 @@ importers: '@nuxtjs/tailwindcss': specifier: 6.14.0 version: 6.14.0(magicast@0.3.5) + '@pinia/nuxt': + specifier: 0.11.2 + version: 0.11.2(magicast@0.3.5)(pinia@3.0.3(typescript@5.9.2)(vue@3.5.18(typescript@5.9.2))) eslint: specifier: ^9.33.0 version: 9.33.0(jiti@2.5.1) nuxt: specifier: ^4.0.3 version: 4.0.3(@netlify/blobs@9.1.2)(@parcel/watcher@2.5.1)(@types/node@24.3.0)(@vue/compiler-sfc@3.5.18)(db0@0.3.2)(eslint@9.33.0(jiti@2.5.1))(ioredis@5.7.0)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.46.3)(terser@5.43.1)(typescript@5.9.2)(vite@7.1.2(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)(yaml@2.8.1))(yaml@2.8.1) + pinia: + specifier: ^3.0.3 + version: 3.0.3(typescript@5.9.2)(vue@3.5.18(typescript@5.9.2)) vue: specifier: ^3.5.18 version: 3.5.18(typescript@5.9.2) @@ -1139,6 +1145,11 @@ packages: resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==} engines: {node: '>= 10.0.0'} + '@pinia/nuxt@0.11.2': + resolution: {integrity: sha512-CgvSWpbktxxWBV7ModhAcsExsQZqpPq6vMYEe9DexmmY6959ev8ukL4iFhr/qov2Nb9cQAWd7niFDnaWkN+FHg==} + peerDependencies: + pinia: ^3.0.3 + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -1605,6 +1616,9 @@ packages: '@vue/devtools-api@6.6.4': resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==} + '@vue/devtools-api@7.7.7': + resolution: {integrity: sha512-lwOnNBH2e7x1fIIbVT7yF5D+YWhqELm55/4ZKf45R9T8r9dE2AIOy8HKjfqzGsoTHFbWbr337O4E0A0QADnjBg==} + '@vue/devtools-core@7.7.7': resolution: {integrity: sha512-9z9TLbfC+AjAi1PQyWX+OErjIaJmdFlbDHcD+cAMYKY6Bh5VlsAtCeGyRMrXwIlMEQPukvnWt3gZBLwTAIMKzQ==} peerDependencies: @@ -3683,6 +3697,15 @@ packages: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} + pinia@3.0.3: + resolution: {integrity: sha512-ttXO/InUULUXkMHpTdp9Fj4hLpD/2AoJdmAbAeW2yu1iy1k+pkFekQXw5VpC0/5p51IOR/jDaDRfRWRnMMsGOA==} + peerDependencies: + typescript: '>=4.4.4' + vue: ^2.7.0 || ^3.5.11 + peerDependenciesMeta: + typescript: + optional: true + pirates@4.0.7: resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} engines: {node: '>= 6'} @@ -6099,6 +6122,13 @@ snapshots: '@parcel/watcher-win32-ia32': 2.5.1 '@parcel/watcher-win32-x64': 2.5.1 + '@pinia/nuxt@0.11.2(magicast@0.3.5)(pinia@3.0.3(typescript@5.9.2)(vue@3.5.18(typescript@5.9.2)))': + dependencies: + '@nuxt/kit': 3.18.1(magicast@0.3.5) + pinia: 3.0.3(typescript@5.9.2)(vue@3.5.18(typescript@5.9.2)) + transitivePeerDependencies: + - magicast + '@pkgjs/parseargs@0.11.0': optional: true @@ -6564,6 +6594,10 @@ snapshots: '@vue/devtools-api@6.6.4': {} + '@vue/devtools-api@7.7.7': + dependencies: + '@vue/devtools-kit': 7.7.7 + '@vue/devtools-core@7.7.7(vite@7.1.2(@types/node@24.3.0)(jiti@2.5.1)(terser@5.43.1)(yaml@2.8.1))(vue@3.5.18(typescript@5.9.2))': dependencies: '@vue/devtools-kit': 7.7.7 @@ -8914,6 +8948,13 @@ snapshots: pify@2.3.0: {} + pinia@3.0.3(typescript@5.9.2)(vue@3.5.18(typescript@5.9.2)): + dependencies: + '@vue/devtools-api': 7.7.7 + vue: 3.5.18(typescript@5.9.2) + optionalDependencies: + typescript: 5.9.2 + pirates@4.0.7: {} pkg-types@1.3.1: