Repository: jhipster/jhipster-lite (java)

Issue:
Replace pinia-plugin-persist by pinia-plugin-persistedstate
pinia-plugin-persist is not really maintained (no commit since 2 years) and has [some compatibility issues with TypeScript 5](https://github.com/Seb-L/pinia-plugin-persist/issues/64].

On the other hand, https://github.com/prazdevs/pinia-plugin-persistedstate is equivalent but is maintained. 

Pull request:
feat(vue): replace pinia-plugin-persist by pinia-plugin-persistedstate
Fixes #10465

Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java b/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java
index f5c9d4fb3..fee02784f 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java
@@ -30,7 +30,7 @@ public class VueModulesFactory {
   private static final String PINIA_IMPORTS =
     """
     import { createPinia } from 'pinia';
-    import piniaPersist from 'pinia-plugin-persist';
+    import piniaPersist from 'pinia-plugin-persistedstate';
     """;
   private static final String PINIA_PROVIDER =
     """
@@ -147,7 +147,7 @@ public class VueModulesFactory {
     return moduleBuilder(properties)
       .packageJson()
         .addDependency(packageName("pinia"), VUE)
-        .addDependency(packageName("pinia-plugin-persist"), VUE)
+        .addDependency(packageName("pinia-plugin-persistedstate"), VUE)
         .addDevDependency(packageName("@pinia/testing"), VUE)
         .and()
       .mandatoryReplacements()
diff --git a/src/main/resources/generator/dependencies/vue/package.json b/src/main/resources/generator/dependencies/vue/package.json
index 4da871de9..7386b10e8 100644
--- a/src/main/resources/generator/dependencies/vue/package.json
+++ b/src/main/resources/generator/dependencies/vue/package.json
@@ -6,7 +6,7 @@
   "dependencies": {
     "axios": "1.7.2",
     "pinia": "2.2.0",
-    "pinia-plugin-persist": "1.0.0",
+    "pinia-plugin-persistedstate": "3.2.1",
     "vue": "3.4.34",
     "vue-router": "4.4.0"
   },


Test patch:
diff --git a/src/test/features/client/vue.feature b/src/test/features/client/vue.feature
index 355a1106e..04e355e8f 100644
--- a/src/test/features/client/vue.feature
+++ b/src/test/features/client/vue.feature
@@ -11,4 +11,4 @@ Feature: Vue.js modules
   Scenario: Should apply pinia module
     Given I apply "vue-core" module to default project with package json without parameters
     When I apply "vue-pinia" module without parameters to last project
-    Then I should have "import piniaPersist from 'pinia-plugin-persist'" in "src/main/webapp/app/main.ts"
+    Then I should have "import piniaPersist from 'pinia-plugin-persistedstate'" in "src/main/webapp/app/main.ts"
diff --git a/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java
index 39a80e0af..600b87f5a 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java
@@ -112,12 +112,12 @@ class VueModulesFactoryTest {
     )
       .hasFile("package.json")
       .containing(nodeDependency("pinia"))
-      .containing(nodeDependency("pinia-plugin-persist"))
+      .containing(nodeDependency("pinia-plugin-persistedstate"))
       .containing(nodeDependency("@pinia/testing"))
       .and()
       .hasFile("src/main/webapp/app/main.ts")
       .containing("import { createPinia } from 'pinia';")
-      .containing("import piniaPersist from 'pinia-plugin-persist';")
+      .containing("import piniaPersist from 'pinia-plugin-persistedstate';")
       .containing(
         """
         const pinia = createPinia();