Skip to content

Commit

Permalink
Rework vue-core
Browse files Browse the repository at this point in the history
  • Loading branch information
DamnClin committed Aug 31, 2024
1 parent 799ff6f commit b5f5ca2
Show file tree
Hide file tree
Showing 37 changed files with 3,938 additions and 540 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@
public class VueModulesFactory {

private static final JHipsterSource SOURCE = from("client/vue");
private static final JHipsterSource APP_SOURCE = from("client/vue/webapp/app");
private static final JHipsterSource DOCUMENTATION_SOURCE = SOURCE.append("documentation");
private static final JHipsterSource TEST_SOURCE = SOURCE.append("test/unit");
private static final JHipsterSource IMAGE_SOURCE = SOURCE.append("webapp/content/images");
private static final JHipsterSource COMMON_PRIMARY_SOURCE = SOURCE.append("webapp/app/common/primary");
private static final JHipsterSource COMMON_PRIMARY_TEST_SOURCE = SOURCE.append("test/unit/common/primary");
private static final JHipsterSource SOURCE_COMMON = from("client/common");

private static final JHipsterDestination MAIN_DESTINATION = to("src/main/webapp/app");
private static final JHipsterDestination TEST_DESTINATION = to("src/test/webapp/unit");
private static final JHipsterDestination MAIN_PRIMARY_DESTINATION = MAIN_DESTINATION.append("common/primary");
private static final JHipsterDestination COMMON_PRIMARY_TEST_DESTINATION = to("src/test/webapp/unit/common/primary");

private static final String IMPORT_NEEDLE = "// jhipster-needle-main-ts-import";
private static final String PROVIDER_NEEDLE = "// jhipster-needle-main-ts-provider";
Expand Down Expand Up @@ -72,6 +67,7 @@ public JHipsterModule buildVueModule(JHipsterModuleProperties properties) {
.addDevDependency(packageName("vue-tsc"), VUE)
.addDevDependency(packageName("@types/sinon"), VUE)
.addDevDependency(packageName("sinon"), VUE)
.addDevDependency(packageName("piqure"), VUE)
.addScript(scriptKey("build"), scriptCommand("vue-tsc -p tsconfig.build.json --noEmit && vite build --emptyOutDir"))
.addScript(scriptKey("dev"), scriptCommand("vite"))
.addScript(scriptKey("lint"), scriptCommand("eslint --ext .js,.ts,.vue src/"))
Expand All @@ -85,7 +81,6 @@ public JHipsterModule buildVueModule(JHipsterModuleProperties properties) {
.add(SOURCE.file(".eslintrc.cjs"), to(".eslintrc.cjs"))
.add(SOURCE.file("tsconfig.json"), to("tsconfig.json"))
.add(SOURCE.file("tsconfig.build.json"), to("tsconfig.build.json"))
.add(SOURCE.template("webapp/app/http/AxiosHttp.ts.mustache"), MAIN_DESTINATION.append("http/AxiosHttp.ts"))
.batch(SOURCE, to("."))
.addTemplate("vite.config.ts")
.addTemplate("vitest.config.ts")
Expand All @@ -94,49 +89,24 @@ public JHipsterModule buildVueModule(JHipsterModuleProperties properties) {
.addFile(".eslintignore")
.addFile(".npmrc")
.and()
.batch(SOURCE.file("test/unit/http"), to("src/test/webapp/unit/http"))
.addTemplate("AxiosHttp.spec.ts")
.addTemplate("AxiosHttpStub.ts")
.addTemplate("AxiosStub.ts")
.and()
.add(SOURCE.template("webapp/index.html"), to("src/main/webapp/index.html"))
.batch(SOURCE.append("webapp/app"), MAIN_DESTINATION)
.batch(APP_SOURCE, MAIN_DESTINATION)
.addTemplate("env.d.ts")
.addTemplate("main.ts")
.and()
.batch(COMMON_PRIMARY_SOURCE.append("app"), MAIN_PRIMARY_DESTINATION.append("app"))
.addTemplate("App.component.ts")
.addTemplate("App.html")
.addTemplate("AppVue.vue")
.addTemplate("index.ts")
.addTemplate("injections.ts")
.addTemplate("router.ts")
.and()
.batch(APP_SOURCE.append("home"), MAIN_DESTINATION.append("home"))
.addTemplate("application/HomeRouter.ts")
.addTemplate("infrastructure/primary/HomepageVue.vue")
.and()
.add(APP_SOURCE.template("shared/http/infrastructure/secondary/AxiosHttp.ts.mustache"), MAIN_DESTINATION.append("shared/http/infrastructure/secondary/AxiosHttp.ts"))
.batch(IMAGE_SOURCE, to("src/main/webapp/content/images"))
.addFile("JHipster-Lite-neon-green.png")
.addFile("VueLogo.png")
.and()
.add(COMMON_PRIMARY_TEST_SOURCE.template("app/App.spec.ts"), COMMON_PRIMARY_TEST_DESTINATION.append("app/App.spec.ts"))
.batch(COMMON_PRIMARY_SOURCE.append("homepage"), MAIN_PRIMARY_DESTINATION.append("homepage"))
.addTemplate("Homepage.component.ts")
.addTemplate("Homepage.html")
.addTemplate("HomepageVue.vue")
.addTemplate("index.ts")
.and()
.add(COMMON_PRIMARY_TEST_SOURCE.template("homepage/Homepage.spec.ts"), COMMON_PRIMARY_TEST_DESTINATION.append("homepage/Homepage.spec.ts"))
.add(SOURCE.template("webapp/app/router/router.ts"), MAIN_DESTINATION.append("router/router.ts"))
.add(SOURCE.template("test/unit/router/Router.spec.ts"), to("src/test/webapp/unit/router/Router.spec.ts"))
.batch(SOURCE.append("webapp/app/common/domain"), MAIN_DESTINATION.append("common/domain"))
.addTemplate("Logger.ts")
.addTemplate("Message.ts")
.and()
.add(SOURCE.template("webapp/app/common/secondary/ConsoleLogger.ts"), MAIN_DESTINATION.append("common/secondary/ConsoleLogger.ts"))
.add(SOURCE.template("test/unit/common/domain/Logger.fixture.ts"), to("src/test/webapp/unit/common/domain/Logger.fixture.ts"))
.add(SOURCE.template("test/unit/common/secondary/ConsoleLogger.spec.ts"), to("src/test/webapp/unit/common/secondary/ConsoleLogger.spec.ts"))
.add(SOURCE.file("webapp/app/vue/VueProp.ts"), to("src/main/webapp/app/vue/VueProp.ts"))
.batch(TEST_SOURCE.append("vue/vue-prop"), TEST_DESTINATION.append("vue/vue-prop"))
.addFile("ArrayComponentVue.vue")
.addFile("ObjectComponentVue.vue")
.addFile("VueProp.spec.ts")
.and()
.add(SOURCE.template("webapp/app/router.ts"), MAIN_DESTINATION.append("router.ts"))
.and()
.build();
//@formatter:on
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b5f5ca2

Please sign in to comment.