Skip to content

Commit

Permalink
Merge pull request #10839 from murdos/clean-client-packagejson-scripts
Browse files Browse the repository at this point in the history
Vue & React: build and test scripts adjustments
  • Loading branch information
murdos authored Sep 14, 2024
2 parents 8f199df + 0862b8b commit f6c0969
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,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 ."))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ 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:*"))
.addDevDependency(packageName("piqure"), VUE)
.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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("."))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ 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 ."))
.containing(nodeScript("preview", "vite preview"))
.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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f6c0969

Please sign in to comment.