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 3842b08a4f4..4a286515679 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 @@ -61,11 +61,12 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) { .addDevDependency(packageName("vitest-sonar-reporter"), COMMON) .addDependency(packageName("react"), REACT) .addDependency(packageName("react-dom"), REACT) - .addDependency(packageName("npm-run-all2"), COMMON) + .addDevDependency(packageName("npm-run-all2"), COMMON) .addScript(scriptKey("dev"), scriptCommand("npm-run-all dev:*")) .addScript(scriptKey("dev:vite"), scriptCommand("vite")) .addScript(scriptKey("build"), scriptCommand("npm-run-all build:*")) - .addScript(scriptKey("build:vite"), scriptCommand("tsc && vite build --emptyOutDir")) + .addScript(scriptKey("build:tsc"), scriptCommand("tsc")) + .addScript(scriptKey("build:vite"), scriptCommand("vite build --emptyOutDir")) .addScript(scriptKey("preview"), scriptCommand("vite preview")) .addScript(scriptKey("start"), scriptCommand("vite")) .addScript(scriptKey("lint"), scriptCommand("eslint .")) 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 fe81ff5b033..4a898ef0ad9 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 @@ -70,7 +70,8 @@ public JHipsterModule buildVueModule(JHipsterModuleProperties properties) { .addDevDependency(packageName("sinon"), VUE) .addDevDependency(packageName("npm-run-all2"), COMMON) .addScript(scriptKey("build"), scriptCommand("npm-run-all build:*")) - .addScript(scriptKey("build:vue"), scriptCommand("vue-tsc -p tsconfig.build.json --noEmit && vite build --emptyOutDir")) + .addScript(scriptKey("build:tsc"), scriptCommand("vue-tsc -p tsconfig.build.json --noEmit")) + .addScript(scriptKey("build:vite"), scriptCommand("vite build --emptyOutDir")) .addScript(scriptKey("dev"), scriptCommand("npm-run-all --parallel dev:*")) .addScript(scriptKey("dev:vite"), scriptCommand("vite")) .addScript(scriptKey("watch"), scriptCommand("npm-run-all --parallel watch:*")) @@ -78,11 +79,10 @@ public JHipsterModule buildVueModule(JHipsterModuleProperties properties) { .addScript(scriptKey("lint"), scriptCommand("eslint .")) .addScript(scriptKey("preview"), scriptCommand("vite preview")) .addScript(scriptKey("start"), scriptCommand("vite")) - .addScript(scriptKey("watch:tsc"), scriptCommand("vue-tsc -p tsconfig.build.json --noEmit --watch")) + .addScript(scriptKey("watch:tsc"), scriptCommand("npm run build:tsc -- --watch")) .addScript(scriptKey("test"), scriptCommand("npm run watch:test")) .addScript(scriptKey("watch:test"), scriptCommand("vitest --")) .addScript(scriptKey("test:coverage"), scriptCommand("vitest run --coverage")) - .addScript(scriptKey("test:watch"), scriptCommand("vitest --")) .and() .files() .add(SOURCE.template("eslint.config.js.mustache"), to("eslint.config.js")) diff --git a/src/main/java/tech/jhipster/lite/generator/typescript/core/domain/TypescriptModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/typescript/core/domain/TypescriptModuleFactory.java index 1c80856dae4..100acd2d94a 100644 --- a/src/main/java/tech/jhipster/lite/generator/typescript/core/domain/TypescriptModuleFactory.java +++ b/src/main/java/tech/jhipster/lite/generator/typescript/core/domain/TypescriptModuleFactory.java @@ -29,14 +29,17 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) { .addDevDependency(packageName("eslint-config-prettier"), COMMON) .addDevDependency(packageName("eslint-plugin-import-x"), COMMON) .addDevDependency(packageName("globals"), COMMON) + .addDevDependency(packageName("npm-run-all2"), COMMON) .addDevDependency(packageName("typescript-eslint"), COMMON) .addDevDependency(packageName("vite-tsconfig-paths"), COMMON) .addDevDependency(packageName("vitest"), COMMON) .addDevDependency(packageName("vitest-sonar-reporter"), COMMON) .addScript(scriptKey("lint"), scriptCommand("eslint .")) - .addScript(scriptKey("test"), scriptCommand("npm run test:watch")) + .addScript(scriptKey("test"), scriptCommand("npm run watch:test")) .addScript(scriptKey("test:coverage"), scriptCommand("vitest run --coverage")) - .addScript(scriptKey("test:watch"), scriptCommand("vitest --")) + .addScript(scriptKey("watch"), scriptCommand("npm-run-all --parallel watch:*")) + .addScript(scriptKey("watch:tsc"), scriptCommand("tsc --noEmit --watch")) + .addScript(scriptKey("watch:test"), scriptCommand("vitest --")) .and() .files() .batch(SOURCE, to(".")) 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 8db18cfb6d1..58d2dbbb203 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 @@ -48,7 +48,8 @@ void shouldBuildModuleWithStyle() { .containing(nodeScript("dev", "npm-run-all dev:*")) .containing(nodeScript("dev:vite", "vite")) .containing(nodeScript("build", "npm-run-all build:*")) - .containing(nodeScript("build:vite", "tsc && vite build --emptyOutDir")) + .containing(nodeScript("build:tsc", "tsc")) + .containing(nodeScript("build:vite", "vite build --emptyOutDir")) .containing(nodeScript("watch", "npm-run-all --parallel watch:*")) .containing(nodeScript("watch:tsc", "tsc --noEmit --watch")) .containing(nodeScript("preview", "vite preview")) 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 42122ebf80e..ddb1ddbd958 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 @@ -51,11 +51,12 @@ void shouldCreateVueModule() { .containing(nodeDependency("vue-router")) .containing(nodeDependency("npm-run-all2")) .containing(nodeScript("build", "npm-run-all build:*")) - .containing(nodeScript("build:vue", "vue-tsc -p tsconfig.build.json --noEmit && vite build --emptyOutDir")) + .containing(nodeScript("build:tsc", "vue-tsc -p tsconfig.build.json --noEmit")) + .containing(nodeScript("build:vite", "vite build --emptyOutDir")) .containing(nodeScript("dev", "npm-run-all --parallel dev:*")) .containing(nodeScript("dev:vite", "vite")) .containing(nodeScript("watch", "npm-run-all --parallel watch:*")) - .containing(nodeScript("watch:tsc", "vue-tsc -p tsconfig.build.json --noEmit --watch")) + .containing(nodeScript("watch:tsc", "npm run build:tsc -- --watch")) .containing(nodeScript("watch:test", "vitest --")) .containing(nodeDependency("piqure")) .containing(nodeScript("lint", "eslint .")) @@ -63,7 +64,6 @@ void shouldCreateVueModule() { .containing(nodeScript("start", "vite")) .containing(nodeScript("test", "npm run watch:test")) .containing(nodeScript("test:coverage", "vitest run --coverage")) - .containing(nodeScript("test:watch", "vitest --")) .and() .hasFile(".lintstagedrc.cjs") .containing( diff --git a/src/test/java/tech/jhipster/lite/generator/typescript/domain/core/TypescriptModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/typescript/domain/core/TypescriptModuleFactoryTest.java index 6ddf4d8eaca..0bf06af3607 100644 --- a/src/test/java/tech/jhipster/lite/generator/typescript/domain/core/TypescriptModuleFactoryTest.java +++ b/src/test/java/tech/jhipster/lite/generator/typescript/domain/core/TypescriptModuleFactoryTest.java @@ -37,9 +37,11 @@ void shouldCreateTypescriptModule() { .containing(nodeDependency("vite-tsconfig-paths")) .containing(nodeDependency("vitest")) .containing(nodeDependency("vitest-sonar-reporter")) - .containing(nodeScript("test", "npm run test:watch")) + .containing(nodeScript("test", "npm run watch:test")) .containing(nodeScript("test:coverage", "vitest run --coverage")) - .containing(nodeScript("test:watch", "vitest --")) + .containing(nodeScript("watch", "npm-run-all --parallel watch:*")) + .containing(nodeScript("watch:test", "vitest --")) + .containing(nodeScript("watch:tsc", "tsc --noEmit --watch")) .containing(nodeScript("lint", "eslint .")) .and() .hasPrefixedFiles("", "eslint.config.js", "tsconfig.json");