Repository: jhipster/jhipster-lite
Pull request #10734 (2024-09-02 15:12:16)

Add tsc watch scripts
Close https://github.com/jhipster/jhipster-lite/issues/10731


Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java b/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java
index 1ea8a003e..942dd4c9a 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java
@@ -62,6 +62,7 @@ public class ReactCoreModulesFactory {
         .addScript(scriptKey("preview"), scriptCommand("vite preview"))
         .addScript(scriptKey("start"), scriptCommand("vite"))
         .addScript(scriptKey("lint"), scriptCommand("eslint --ext .js,.ts,.tsx src/"))
+        .addScript(scriptKey("tsc:watch"), scriptCommand("tsc --noEmit --watch"))
         .addScript(scriptKey("test"), scriptCommand("npm run test:watch"))
         .addScript(scriptKey("test:coverage"), scriptCommand("vitest run --coverage"))
         .addScript(scriptKey("test:watch"), scriptCommand("vitest --"))
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 5ddfd395c..b694ea402 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
@@ -77,6 +77,7 @@ public class VueModulesFactory {
         .addScript(scriptKey("lint"), scriptCommand("eslint --ext .js,.ts,.vue src/"))
         .addScript(scriptKey("preview"), scriptCommand("vite preview"))
         .addScript(scriptKey("start"), scriptCommand("vite"))
+        .addScript(scriptKey("tsc:watch"), scriptCommand("vue-tsc -p tsconfig.build.json --noEmit --watch"))
         .addScript(scriptKey("test"), scriptCommand("npm run test:watch"))
         .addScript(scriptKey("test:coverage"), scriptCommand("vitest run --coverage"))
         .addScript(scriptKey("test:watch"), scriptCommand("vitest --"))


Test patch:
diff --git a/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java
index 40efed70c..a3332deda 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.java
@@ -43,6 +43,7 @@ class ReactCoreModulesFactoryTest {
       .containing(nodeDependency("react-dom"))
       .containing(nodeScript("dev", "vite"))
       .containing(nodeScript("build", "tsc && vite build --emptyOutDir"))
+      .containing(nodeScript("tsc:watch", "tsc --noEmit --watch"))
       .containing(nodeScript("preview", "vite preview"))
       .containing(nodeScript("start", "vite"))
       .containing(nodeScript("lint", "eslint --ext .js,.ts,.tsx src/"))
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 d35d8985c..b151d7b41 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
@@ -49,6 +49,7 @@ class VueModulesFactoryTest {
         .containing(nodeDependency("axios"))
         .containing(nodeDependency("vue-router"))
         .containing(nodeScript("build", "vue-tsc -p tsconfig.build.json --noEmit && vite build --emptyOutDir"))
+        .containing(nodeScript("tsc:watch", "vue-tsc -p tsconfig.build.json --noEmit --watch"))
         .containing(nodeScript("dev", "vite"))
         .containing(nodeScript("lint", "eslint --ext .js,.ts,.vue src/"))
         .containing(nodeScript("preview", "vite preview"))