Skip to content

Commit

Permalink
Add web/templates as a Qute template root
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Feb 19, 2024
1 parent 0bce667 commit 10fcec6
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import org.jboss.logging.Logger;
Expand Down Expand Up @@ -37,16 +36,8 @@ WebDependenciesBuildItem collectDependencies(LaunchModeBuildItem launchMode,
if (entryPoints.isEmpty()) {
return new WebDependenciesBuildItem(List.of());
}
final var stream = StreamSupport.stream(curateOutcome.getApplicationModel()
.getDependenciesWithAnyFlag(DependencyFlags.COMPILE_ONLY, DependencyFlags.RUNTIME_CP).spliterator(), false);
// workaround for dev-ui deps which are currently not in the COMPILE_ONLY flag even if declared as such in the user project.
// They are in the DEPLOYMENT_CP flag and the scope is compile (Gradle) or provided (Maven)
// See https://github.com/quarkusio/quarkus/issues/38682
final Stream<ResolvedDependency> workaroundStream = StreamSupport
.stream(curateOutcome.getApplicationModel().getDependencies(DependencyFlags.DEPLOYMENT_CP).spliterator(), false)
.filter(d -> SCOPE_COMPILE.equals(d.getScope()) || SCOPE_PROVIDED.equals(d.getScope()));
List<WebDependency> webDeps = Stream.concat(stream, workaroundStream)
.distinct()
final List<WebDependency> webDeps = StreamSupport.stream(curateOutcome.getApplicationModel()
.getDependenciesWithAnyFlag(DependencyFlags.COMPILE_ONLY, DependencyFlags.RUNTIME_CP).spliterator(), false)
.filter(Dependency::isJar)
.filter(d -> WebDependencyType.anyMatch(d.toCompactCoords()))
.peek(d -> checkScope(launchMode, d, config))
Expand Down
56 changes: 28 additions & 28 deletions docs/modules/ROOT/pages/includes/quarkus-web-bundler.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ h|[[quarkus-web-bundler_configuration]]link:#quarkus-web-bundler_configuration[C
h|Type
h|Default

a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.web-root]]`link:#quarkus-web-bundler_quarkus.web-bundler.web-root[quarkus.web-bundler.web-root]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-web-root]]`link:#quarkus-web-bundler_quarkus-web-bundler-web-root[quarkus.web-bundler.web-root]`


[.description]
Expand All @@ -27,7 +27,7 @@ endif::add-copy-button-to-env-var[]
|`web`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.static]]`link:#quarkus-web-bundler_quarkus.web-bundler.static[quarkus.web-bundler.static]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-static]]`link:#quarkus-web-bundler_quarkus-web-bundler-static[quarkus.web-bundler.static]`


[.description]
Expand All @@ -44,7 +44,7 @@ endif::add-copy-button-to-env-var[]
|`static`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.bundle-path]]`link:#quarkus-web-bundler_quarkus.web-bundler.bundle-path[quarkus.web-bundler.bundle-path]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-bundle-path]]`link:#quarkus-web-bundler_quarkus-web-bundler-bundle-path[quarkus.web-bundler.bundle-path]`


[.description]
Expand All @@ -61,7 +61,7 @@ endif::add-copy-button-to-env-var[]
|`static/bundle`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.js]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.js[quarkus.web-bundler.loaders.js]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-js]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-js[quarkus.web-bundler.loaders.js]`


[.description]
Expand All @@ -78,7 +78,7 @@ endif::add-copy-button-to-env-var[]
|`js,cjs,mjs`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.jsx]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.jsx[quarkus.web-bundler.loaders.jsx]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-jsx]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-jsx[quarkus.web-bundler.loaders.jsx]`


[.description]
Expand All @@ -95,7 +95,7 @@ endif::add-copy-button-to-env-var[]
|`jsx`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.tsx]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.tsx[quarkus.web-bundler.loaders.tsx]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-tsx]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-tsx[quarkus.web-bundler.loaders.tsx]`


[.description]
Expand All @@ -112,7 +112,7 @@ endif::add-copy-button-to-env-var[]
|`tsx`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.ts]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.ts[quarkus.web-bundler.loaders.ts]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-ts]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-ts[quarkus.web-bundler.loaders.ts]`


[.description]
Expand All @@ -129,7 +129,7 @@ endif::add-copy-button-to-env-var[]
|`ts,mts,cts`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.css]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.css[quarkus.web-bundler.loaders.css]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-css]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-css[quarkus.web-bundler.loaders.css]`


[.description]
Expand All @@ -146,7 +146,7 @@ endif::add-copy-button-to-env-var[]
|`css`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.local-css]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.local-css[quarkus.web-bundler.loaders.local-css]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-local-css]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-local-css[quarkus.web-bundler.loaders.local-css]`


[.description]
Expand All @@ -163,7 +163,7 @@ endif::add-copy-button-to-env-var[]
|`.module.css`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.global-css]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.global-css[quarkus.web-bundler.loaders.global-css]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-global-css]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-global-css[quarkus.web-bundler.loaders.global-css]`


[.description]
Expand All @@ -180,7 +180,7 @@ endif::add-copy-button-to-env-var[]
|


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.file]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.file[quarkus.web-bundler.loaders.file]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-file]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-file[quarkus.web-bundler.loaders.file]`


[.description]
Expand All @@ -197,7 +197,7 @@ endif::add-copy-button-to-env-var[]
|`aac,abw,arc,avif,avi,azw,bin,bmp,bz,bz2,cda,csv,yaml,yml,doc,docx,eot,epub,gz,gif,htm,html,ico,ics,jar,jpeg,jpg,jsonld,mid,midi,mp3,mp4,mpeg,mpkg,odp,ods,odt,oga,ogv,ogx,opus,otf,png,pdf,ppt,pptx,rar,rtf,svg,tar,tif,tiff,ttf,vsd,wav,weba,webm,webp,woff,woff2,xhtml,xls,xlsx,xml,xul,zip,3gp,3g2,7z`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.copy]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.copy[quarkus.web-bundler.loaders.copy]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-copy]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-copy[quarkus.web-bundler.loaders.copy]`


[.description]
Expand All @@ -214,7 +214,7 @@ endif::add-copy-button-to-env-var[]
|


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.base64]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.base64[quarkus.web-bundler.loaders.base64]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-base64]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-base64[quarkus.web-bundler.loaders.base64]`


[.description]
Expand All @@ -231,7 +231,7 @@ endif::add-copy-button-to-env-var[]
|


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.binary]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.binary[quarkus.web-bundler.loaders.binary]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-binary]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-binary[quarkus.web-bundler.loaders.binary]`


[.description]
Expand All @@ -248,7 +248,7 @@ endif::add-copy-button-to-env-var[]
|


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.data-url]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.data-url[quarkus.web-bundler.loaders.data-url]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-data-url]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-data-url[quarkus.web-bundler.loaders.data-url]`


[.description]
Expand All @@ -265,7 +265,7 @@ endif::add-copy-button-to-env-var[]
|


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.empty]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.empty[quarkus.web-bundler.loaders.empty]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-empty]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-empty[quarkus.web-bundler.loaders.empty]`


[.description]
Expand All @@ -282,7 +282,7 @@ endif::add-copy-button-to-env-var[]
|


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.text]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.text[quarkus.web-bundler.loaders.text]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-text]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-text[quarkus.web-bundler.loaders.text]`


[.description]
Expand All @@ -299,7 +299,7 @@ endif::add-copy-button-to-env-var[]
|`txt`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.loaders.json]]`link:#quarkus-web-bundler_quarkus.web-bundler.loaders.json[quarkus.web-bundler.loaders.json]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-loaders-json]]`link:#quarkus-web-bundler_quarkus-web-bundler-loaders-json[quarkus.web-bundler.loaders.json]`


[.description]
Expand All @@ -316,7 +316,7 @@ endif::add-copy-button-to-env-var[]
|`json`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.external-imports]]`link:#quarkus-web-bundler_quarkus.web-bundler.external-imports[quarkus.web-bundler.external-imports]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-external-imports]]`link:#quarkus-web-bundler_quarkus-web-bundler-external-imports[quarkus.web-bundler.external-imports]`


[.description]
Expand All @@ -333,7 +333,7 @@ endif::add-copy-button-to-env-var[]
|`{quarkus.http.root-path}static/*`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.bundle-splitting]]`link:#quarkus-web-bundler_quarkus.web-bundler.bundle-splitting[quarkus.web-bundler.bundle-splitting]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-bundle-splitting]]`link:#quarkus-web-bundler_quarkus-web-bundler-bundle-splitting[quarkus.web-bundler.bundle-splitting]`


[.description]
Expand All @@ -350,7 +350,7 @@ endif::add-copy-button-to-env-var[]
|`true`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.dependencies.node-modules]]`link:#quarkus-web-bundler_quarkus.web-bundler.dependencies.node-modules[quarkus.web-bundler.dependencies.node-modules]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-dependencies-node-modules]]`link:#quarkus-web-bundler_quarkus-web-bundler-dependencies-node-modules[quarkus.web-bundler.dependencies.node-modules]`


[.description]
Expand All @@ -367,7 +367,7 @@ endif::add-copy-button-to-env-var[]
|`node_modules will be in the build/target directory`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.dependencies.compile-only]]`link:#quarkus-web-bundler_quarkus.web-bundler.dependencies.compile-only[quarkus.web-bundler.dependencies.compile-only]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-dependencies-compile-only]]`link:#quarkus-web-bundler_quarkus-web-bundler-dependencies-compile-only[quarkus.web-bundler.dependencies.compile-only]`


[.description]
Expand All @@ -384,7 +384,7 @@ endif::add-copy-button-to-env-var[]
|`true`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.bundle-redirect]]`link:#quarkus-web-bundler_quarkus.web-bundler.bundle-redirect[quarkus.web-bundler.bundle-redirect]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-bundle-redirect]]`link:#quarkus-web-bundler_quarkus-web-bundler-bundle-redirect[quarkus.web-bundler.bundle-redirect]`


[.description]
Expand All @@ -401,7 +401,7 @@ endif::add-copy-button-to-env-var[]
|`false`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.charset]]`link:#quarkus-web-bundler_quarkus.web-bundler.charset[quarkus.web-bundler.charset]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-charset]]`link:#quarkus-web-bundler_quarkus-web-bundler-charset[quarkus.web-bundler.charset]`


[.description]
Expand All @@ -419,7 +419,7 @@ endif::add-copy-button-to-env-var[]
|`UTF-8`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle]]`link:#quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle[quarkus.web-bundler.bundle."bundle"]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-bundle-bundle]]`link:#quarkus-web-bundler_quarkus-web-bundler-bundle-bundle[quarkus.web-bundler.bundle."bundle"]`


[.description]
Expand All @@ -436,7 +436,7 @@ endif::add-copy-button-to-env-var[]
|`true`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle-.dir]]`link:#quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle-.dir[quarkus.web-bundler.bundle."bundle".dir]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-bundle-bundle-dir]]`link:#quarkus-web-bundler_quarkus-web-bundler-bundle-bundle-dir[quarkus.web-bundler.bundle."bundle".dir]`


[.description]
Expand All @@ -453,7 +453,7 @@ endif::add-copy-button-to-env-var[]
|`the bundle map key`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle-.key]]`link:#quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle-.key[quarkus.web-bundler.bundle."bundle".key]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-bundle-bundle-key]]`link:#quarkus-web-bundler_quarkus-web-bundler-bundle-bundle-key[quarkus.web-bundler.bundle."bundle".key]`


[.description]
Expand All @@ -470,7 +470,7 @@ endif::add-copy-button-to-env-var[]
|`the bundle map key`


a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle-.qute-tags]]`link:#quarkus-web-bundler_quarkus.web-bundler.bundle.-bundle-.qute-tags[quarkus.web-bundler.bundle."bundle".qute-tags]`
a|icon:lock[title=Fixed at build time] [[quarkus-web-bundler_quarkus-web-bundler-bundle-bundle-qute-tags]]`link:#quarkus-web-bundler_quarkus-web-bundler-bundle-bundle-qute-tags[quarkus.web-bundler.bundle."bundle".qute-tags]`


[.description]
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.version>3.7.0</quarkus.version>
<quarkus.version>3.7.3</quarkus.version>

<esbuild-java.version>1.2.0.CR1</esbuild-java.version>
<esbuild-java.version>1.2.0</esbuild-java.version>
<scrimage-core.version>4.1.1</scrimage-core.version>
<yuicompressor.version>2.4.8</yuicompressor.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.quarkiverse.web.bundler.qute.components.deployment;

import io.quarkiverse.web.bundler.deployment.WebBundlerConfig;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceDirectoryBuildItem;
import io.quarkus.qute.deployment.TemplateRootBuildItem;

class WebBundlerQuteTemplateRootProcessor {

@BuildStep
void provideWebTemplateRoot(
BuildProducer<NativeImageResourceDirectoryBuildItem> nativeImageResourceDirectoryProducer,
BuildProducer<TemplateRootBuildItem> templateRootProducer,
WebBundlerConfig config) {
templateRootProducer.produce(new TemplateRootBuildItem(config.fromWebRoot("templates")));
nativeImageResourceDirectoryProducer
.produce(new NativeImageResourceDirectoryBuildItem(config.fromWebRoot("templates")));
}

}

0 comments on commit 10fcec6

Please sign in to comment.