Skip to content

Commit e7fa51f

Browse files
Move UI part to own module (#2)
1 parent fc0a7cc commit e7fa51f

File tree

10 files changed

+124
-92
lines changed

10 files changed

+124
-92
lines changed

deployment/pom.xml

Lines changed: 5 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
<artifactId>quarkus-github-app</artifactId>
6363
<version>${project.version}</version>
6464
</dependency>
65+
<dependency>
66+
<groupId>io.quarkiverse.githubapp</groupId>
67+
<artifactId>quarkus-github-app-ui</artifactId>
68+
<version>${project.version}</version>
69+
</dependency>
6570
<dependency>
6671
<groupId>io.quarkus</groupId>
6772
<artifactId>quarkus-junit5-internal</artifactId>
@@ -99,87 +104,6 @@
99104
</annotationProcessorPaths>
100105
</configuration>
101106
</plugin>
102-
<plugin>
103-
<groupId>org.apache.maven.plugins</groupId>
104-
<artifactId>maven-dependency-plugin</artifactId>
105-
<executions>
106-
<execution>
107-
<id>install-ui</id>
108-
<phase>generate-sources</phase>
109-
<goals>
110-
<goal>unpack</goal>
111-
</goals>
112-
<configuration>
113-
<artifactItems>
114-
<!-- Fomantic UI -->
115-
<artifactItem>
116-
<groupId>org.webjars.npm</groupId>
117-
<artifactId>fomantic-ui-css</artifactId>
118-
<version>${webjar.fomantic-ui.version}</version>
119-
<type>jar</type>
120-
<overWrite>true</overWrite>
121-
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/css/</outputDirectory>
122-
<includes>META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/semantic.min.css,META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/themes/default/**</includes>
123-
<fileMappers>
124-
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
125-
<pattern>^META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/</pattern>
126-
<replacement>./</replacement>
127-
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
128-
</fileMappers>
129-
</artifactItem>
130-
<artifactItem>
131-
<groupId>org.webjars.npm</groupId>
132-
<artifactId>fomantic-ui-css</artifactId>
133-
<version>${webjar.fomantic-ui.version}</version>
134-
<type>jar</type>
135-
<overWrite>true</overWrite>
136-
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/js/</outputDirectory>
137-
<includes>META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/semantic.min.js</includes>
138-
<fileMappers>
139-
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
140-
<pattern>^META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/</pattern>
141-
<replacement>./</replacement>
142-
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
143-
</fileMappers>
144-
</artifactItem>
145-
<!-- Vue.js -->
146-
<artifactItem>
147-
<groupId>org.webjars.npm</groupId>
148-
<artifactId>vue</artifactId>
149-
<version>${webjar.vue.version}</version>
150-
<type>jar</type>
151-
<overWrite>true</overWrite>
152-
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/js/</outputDirectory>
153-
<includes>META-INF/resources/webjars/vue/${webjar.vue.version}/dist/vue.min.js</includes>
154-
<fileMappers>
155-
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
156-
<pattern>^META-INF/resources/webjars/vue/${webjar.vue.version}/dist/</pattern>
157-
<replacement>./</replacement>
158-
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
159-
</fileMappers>
160-
</artifactItem>
161-
<!-- jQuery -->
162-
<artifactItem>
163-
<groupId>org.webjars.npm</groupId>
164-
<artifactId>jquery</artifactId>
165-
<version>${webjar.jquery.version}</version>
166-
<type>jar</type>
167-
<overWrite>true</overWrite>
168-
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/js/</outputDirectory>
169-
<includes>META-INF/resources/webjars/jquery/${webjar.jquery.version}/dist/jquery.min.js</includes>
170-
<fileMappers>
171-
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
172-
<pattern>^META-INF/resources/webjars/jquery/${webjar.jquery.version}/dist/</pattern>
173-
<replacement>./</replacement>
174-
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
175-
</fileMappers>
176-
</artifactItem>
177-
<!-- favico.js is a version coming from the master branch of https://github.com/ejci/favico.js/ -->
178-
</artifactItems>
179-
</configuration>
180-
</execution>
181-
</executions>
182-
</plugin>
183107
</plugins>
184108
</build>
185109

deployment/src/main/java/io/quarkiverse/githubapp/deployment/GitHubAppProcessor.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
import io.quarkus.runtime.util.HashUtil;
124124
import io.quarkus.vertx.http.deployment.HttpRootPathBuildItem;
125125
import io.quarkus.vertx.http.deployment.RouteBuildItem;
126-
import io.quarkus.vertx.http.deployment.devmode.NotFoundPageDisplayableEndpointBuildItem;
127126
import io.quarkus.vertx.http.deployment.webjar.WebJarBuildItem;
128127
import io.quarkus.vertx.http.deployment.webjar.WebJarResultsBuildItem;
129128
import io.smallrye.graphql.client.dynamic.api.DynamicGraphQLClient;
@@ -153,9 +152,9 @@ class GitHubAppProcessor {
153152
.createSimple("com.infradna.tool.bridge_method_injector.WithBridgeMethods");
154153

155154
private static final GACT QUARKIVERSE_GITHUB_APP_GACT = new GACT("io.quarkiverse.githubapp",
156-
"quarkus-github-app-deployment", null, "jar");
155+
"quarkus-github-app-ui", null, "jar");
157156
private static final String REPLAY_UI_RESOURCES_PREFIX = "META-INF/resources/replay-ui/";
158-
private static final String REPLAY_UI_PATH = "/replay";
157+
private static final String REPLAY_UI_PATH = "replay";
159158

160159
@BuildStep
161160
FeatureBuildItem feature() {
@@ -328,8 +327,7 @@ void replayUi(GitHubAppRecorder recorder,
328327
WebJarResultsBuildItem webJarResults,
329328
HttpRootPathBuildItem httpRootPath,
330329
ShutdownContextBuildItem shutdownContext,
331-
BuildProducer<RouteBuildItem> routes,
332-
BuildProducer<NotFoundPageDisplayableEndpointBuildItem> displayableEndpoints) throws IOException {
330+
BuildProducer<RouteBuildItem> routes) throws IOException {
333331
if (launchMode.getLaunchMode() != LaunchMode.DEVELOPMENT) {
334332
return;
335333
}
@@ -339,12 +337,17 @@ void replayUi(GitHubAppRecorder recorder,
339337
return;
340338
}
341339

342-
Handler<RoutingContext> handler = recorder.replayUiHandler(webJarResult.getFinalDestination(), REPLAY_UI_PATH,
340+
String replayUiPath = httpRootPath.resolvePath(REPLAY_UI_PATH);
341+
342+
Handler<RoutingContext> handler = recorder.replayUiHandler(webJarResult.getFinalDestination(), replayUiPath,
343343
webJarResult.getWebRootConfigurations(), shutdownContext);
344-
routes.produce(httpRootPath.routeBuilder().route(REPLAY_UI_PATH).handler(handler).build());
344+
routes.produce(httpRootPath.routeBuilder()
345+
.route(REPLAY_UI_PATH)
346+
.handler(handler)
347+
.displayOnNotFoundPage("Replay UI")
348+
.build());
345349
routes.produce(httpRootPath.routeBuilder().route(REPLAY_UI_PATH + "/*").handler(handler).build());
346350

347-
displayableEndpoints.produce(new NotFoundPageDisplayableEndpointBuildItem(REPLAY_UI_PATH + "/", "Replay UI"));
348351
}
349352

350353
private static Collection<EventDefinition> getAllEventDefinitions(IndexView index) {

deployment/src/main/java/io/quarkiverse/githubapp/deployment/devui/GitHubAppDevUIProcessor.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import io.quarkus.deployment.IsDevelopment;
44
import io.quarkus.deployment.annotations.BuildProducer;
55
import io.quarkus.deployment.annotations.BuildStep;
6+
import io.quarkus.deployment.builditem.LaunchModeBuildItem;
67
import io.quarkus.devui.spi.page.CardPageBuildItem;
78
import io.quarkus.devui.spi.page.ExternalPageBuilder;
89
import io.quarkus.devui.spi.page.Page;
9-
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem;
10+
import io.quarkus.vertx.http.deployment.HttpRootPathBuildItem;
11+
import io.quarkus.vertx.http.runtime.management.ManagementInterfaceBuildTimeConfig;
1012

1113
/**
1214
* Dev UI card for displaying important details such as the GitHub App Replay UI.
@@ -15,10 +17,12 @@ public class GitHubAppDevUIProcessor {
1517

1618
@BuildStep(onlyIf = IsDevelopment.class)
1719
void createDevCard(BuildProducer<CardPageBuildItem> cardPageBuildItemBuildProducer,
18-
NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem) {
20+
HttpRootPathBuildItem httpRootPathBuildItem,
21+
ManagementInterfaceBuildTimeConfig managementInterfaceBuildTimeConfig,
22+
LaunchModeBuildItem launchModeBuildItem) {
1923
final CardPageBuildItem card = new CardPageBuildItem();
2024

21-
final String uiPath = nonApplicationRootPathBuildItem.resolvePath("/replay/");
25+
String uiPath = httpRootPathBuildItem.resolvePath("replay");
2226

2327
final ExternalPageBuilder versionPage = Page.externalPageBuilder("Replay UI")
2428
.icon("font-awesome-solid:play")

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
<modules>
4141
<module>events</module>
42+
<module>ui</module>
4243
<module>deployment</module>
4344
<module>runtime</module>
4445
<module>command-airline</module>

ui/pom.xml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>io.quarkiverse.githubapp</groupId>
6+
<artifactId>quarkus-github-app-parent</artifactId>
7+
<version>999-SNAPSHOT</version>
8+
<relativePath>../pom.xml</relativePath>
9+
</parent>
10+
11+
<artifactId>quarkus-github-app-ui</artifactId>
12+
<name>Quarkus - GitHub App - UI</name>
13+
14+
<build>
15+
<plugins>
16+
<plugin>
17+
<groupId>org.apache.maven.plugins</groupId>
18+
<artifactId>maven-dependency-plugin</artifactId>
19+
<executions>
20+
<execution>
21+
<id>install-ui</id>
22+
<phase>generate-sources</phase>
23+
<goals>
24+
<goal>unpack</goal>
25+
</goals>
26+
<configuration>
27+
<artifactItems>
28+
<!-- Fomantic UI -->
29+
<artifactItem>
30+
<groupId>org.webjars.npm</groupId>
31+
<artifactId>fomantic-ui-css</artifactId>
32+
<version>${webjar.fomantic-ui.version}</version>
33+
<type>jar</type>
34+
<overWrite>true</overWrite>
35+
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/css/</outputDirectory>
36+
<includes>META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/semantic.min.css,META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/themes/default/**</includes>
37+
<fileMappers>
38+
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
39+
<pattern>^META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/</pattern>
40+
<replacement>./</replacement>
41+
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
42+
</fileMappers>
43+
</artifactItem>
44+
<artifactItem>
45+
<groupId>org.webjars.npm</groupId>
46+
<artifactId>fomantic-ui-css</artifactId>
47+
<version>${webjar.fomantic-ui.version}</version>
48+
<type>jar</type>
49+
<overWrite>true</overWrite>
50+
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/js/</outputDirectory>
51+
<includes>META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/semantic.min.js</includes>
52+
<fileMappers>
53+
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
54+
<pattern>^META-INF/resources/webjars/fomantic-ui-css/${webjar.fomantic-ui.version}/</pattern>
55+
<replacement>./</replacement>
56+
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
57+
</fileMappers>
58+
</artifactItem>
59+
<!-- Vue.js -->
60+
<artifactItem>
61+
<groupId>org.webjars.npm</groupId>
62+
<artifactId>vue</artifactId>
63+
<version>${webjar.vue.version}</version>
64+
<type>jar</type>
65+
<overWrite>true</overWrite>
66+
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/js/</outputDirectory>
67+
<includes>META-INF/resources/webjars/vue/${webjar.vue.version}/dist/vue.min.js</includes>
68+
<fileMappers>
69+
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
70+
<pattern>^META-INF/resources/webjars/vue/${webjar.vue.version}/dist/</pattern>
71+
<replacement>./</replacement>
72+
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
73+
</fileMappers>
74+
</artifactItem>
75+
<!-- jQuery -->
76+
<artifactItem>
77+
<groupId>org.webjars.npm</groupId>
78+
<artifactId>jquery</artifactId>
79+
<version>${webjar.jquery.version}</version>
80+
<type>jar</type>
81+
<overWrite>true</overWrite>
82+
<outputDirectory>${project.build.directory}/classes/META-INF/resources/replay-ui/js/</outputDirectory>
83+
<includes>META-INF/resources/webjars/jquery/${webjar.jquery.version}/dist/jquery.min.js</includes>
84+
<fileMappers>
85+
<org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
86+
<pattern>^META-INF/resources/webjars/jquery/${webjar.jquery.version}/dist/</pattern>
87+
<replacement>./</replacement>
88+
</org.codehaus.plexus.components.io.filemappers.RegExpFileMapper>
89+
</fileMappers>
90+
</artifactItem>
91+
<!-- favico.js is a version coming from the master branch of https://github.com/ejci/favico.js/ -->
92+
</artifactItems>
93+
</configuration>
94+
</execution>
95+
</executions>
96+
</plugin>
97+
</plugins>
98+
</build>
99+
100+
</project>

deployment/src/main/resources/META-INF/resources/replay-ui/css/main.css renamed to ui/src/main/resources/META-INF/resources/replay-ui/css/main.css

File renamed without changes.

deployment/src/main/resources/META-INF/resources/replay-ui/images/favicon.ico renamed to ui/src/main/resources/META-INF/resources/replay-ui/images/favicon.ico

File renamed without changes.

deployment/src/main/resources/META-INF/resources/replay-ui/images/quarkus_icon_rgb_reverse.svg renamed to ui/src/main/resources/META-INF/resources/replay-ui/images/quarkus_icon_rgb_reverse.svg

File renamed without changes.

deployment/src/main/resources/META-INF/resources/replay-ui/index.html renamed to ui/src/main/resources/META-INF/resources/replay-ui/index.html

File renamed without changes.

deployment/src/main/resources/META-INF/resources/replay-ui/js/favico.js renamed to ui/src/main/resources/META-INF/resources/replay-ui/js/favico.js

File renamed without changes.

0 commit comments

Comments
 (0)