diff --git a/base/src/main/java/io/quarkus/code/service/PlatformOverride.java b/base/src/main/java/io/quarkus/code/service/PlatformOverride.java index 5639cd56c..eb35206cb 100644 --- a/base/src/main/java/io/quarkus/code/service/PlatformOverride.java +++ b/base/src/main/java/io/quarkus/code/service/PlatformOverride.java @@ -2,7 +2,9 @@ import io.quarkus.code.model.CodeQuarkusExtension; import io.quarkus.code.model.Preset; +import io.quarkus.code.model.ProjectDefinition; +import java.nio.file.Path; import java.util.List; import java.util.Set; import java.util.function.Function; @@ -15,6 +17,8 @@ public interface PlatformOverride { List presets(); + void onNewProject(ProjectDefinition projectDefinition, Path dir); + List extensionTagsMapper(List tags); class DefaultPlatformOverride implements PlatformOverride { @@ -32,6 +36,11 @@ public List presets() { return PlatformService.DEFAULT_PRESETS; } + @Override + public void onNewProject(ProjectDefinition projectDefinition, Path dir) { + + } + @Override public List extensionTagsMapper(List tags) { return tags.stream().filter(TAGS::contains).toList(); diff --git a/base/src/main/java/io/quarkus/code/service/PlatformService.java b/base/src/main/java/io/quarkus/code/service/PlatformService.java index 08eae0426..02e291d7d 100644 --- a/base/src/main/java/io/quarkus/code/service/PlatformService.java +++ b/base/src/main/java/io/quarkus/code/service/PlatformService.java @@ -27,6 +27,7 @@ import io.quarkus.registry.ExtensionCatalogResolver; import io.quarkus.registry.catalog.PlatformRelease; import io.quarkus.runtime.LaunchMode; +import io.smallrye.common.annotation.Blocking; import jakarta.enterprise.event.Observes; import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; @@ -106,6 +107,7 @@ public class PlatformService { private final ExtensionCatalogResolver catalogResolver; private final AtomicReference platformServiceCacheRef = new AtomicReference<>(); + @Blocking public void onStart(@Observes StartupEvent e) { reload(); } diff --git a/base/src/main/java/io/quarkus/code/service/QuarkusProjectService.java b/base/src/main/java/io/quarkus/code/service/QuarkusProjectService.java index 417adf1cb..46fa0a824 100644 --- a/base/src/main/java/io/quarkus/code/service/QuarkusProjectService.java +++ b/base/src/main/java/io/quarkus/code/service/QuarkusProjectService.java @@ -12,6 +12,8 @@ import io.quarkus.devtools.project.QuarkusProjectHelper; import io.quarkus.devtools.project.compress.QuarkusProjectCompress; +import jakarta.enterprise.inject.Instance; +import jakarta.inject.Inject; import jakarta.inject.Singleton; import java.io.IOException; import java.io.OutputStream; @@ -25,11 +27,15 @@ @Singleton public class QuarkusProjectService { + @Inject + Instance platformOverride; + public byte[] create(PlatformInfo platformInfo, ProjectDefinition projectDefinition) throws IOException, QuarkusCommandException { Path path = createTmp(platformInfo, projectDefinition); long time = System.currentTimeMillis() - 24 * 3600000; Path zipPath = Files.createTempDirectory("zipped-").resolve("project.zip"); + QuarkusProjectCompress.zip(path, zipPath, true, time); return Files.readAllBytes(zipPath); } @@ -54,6 +60,9 @@ public Path createTmp( boolean silent) throws IOException, QuarkusCommandException { Path location = Files.createTempDirectory("generated-").resolve(projectDefinition.artifactId()); createProject(platformInfo, projectDefinition, location, isGitHub, silent); + if (platformOverride != null && platformOverride.isResolvable()) { + platformOverride.get().onNewProject(projectDefinition, location); + } return location; } diff --git a/base/src/main/resources/application.properties b/base/src/main/resources/application.properties index a475caa4a..2078ef162 100644 --- a/base/src/main/resources/application.properties +++ b/base/src/main/resources/application.properties @@ -6,19 +6,16 @@ io.quarkus.code.git-commit-id=${git.commit.id} # code.quarkus configuration io.quarkus.code.ui.name=code.quarkus.io -io.quarkus.code.ui.id=community +io.quarkus.code.ui.id=community-app io.quarkus.code.quarkus-platforms.reload-cron-expr=0 */5 * * * ? # bundling -quarkus.web-bundler.dependencies.node-modules=node_modules quarkus.web-bundler.bundle.app=false -quarkus.web-bundler.bundle.lib.key=${io.quarkus.code.ui.id} -quarkus.web-bundler.bundle.community-app.key=${io.quarkus.code.ui.id} +quarkus.web-bundler.bundle.lib=true +quarkus.web-bundler.bundle.lib.output=false -%dev.quarkus.web-bundler.bundle.lib=true %dev.quarkus.web-bundler.bundle.community-app=true -%playwright.quarkus.web-bundler.bundle.lib=true %playwright.quarkus.web-bundler.bundle.community-app=true diff --git a/base/src/main/resources/web/lib/components/code-quarkus.scss b/base/src/main/resources/web/lib/components/code-quarkus.scss index 3dcc92d10..6a9508d18 100755 --- a/base/src/main/resources/web/lib/components/code-quarkus.scss +++ b/base/src/main/resources/web/lib/components/code-quarkus.scss @@ -1,4 +1,4 @@ -@import "config"; +@use "config" as config; body { margin: 0; @@ -30,23 +30,23 @@ code { .responsive-container { max-width: 1200px; - @media screen and (max-width: $tabletWidth) { + @media screen and (max-width: config.$tabletWidth) { max-width: 900px; } - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { max-width: 100%; } } .mobile-only { - @media screen and (min-width: $mobileWidth) { + @media screen and (min-width: config.$mobileWidth) { display: none !important; } } .desktop-only { - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { display: none !important; } } diff --git a/base/src/main/resources/web/lib/components/extensions-picker/extension-row.scss b/base/src/main/resources/web/lib/components/extensions-picker/extension-row.scss index f7c414f9e..c9e0eb6d7 100644 --- a/base/src/main/resources/web/lib/components/extensions-picker/extension-row.scss +++ b/base/src/main/resources/web/lib/components/extensions-picker/extension-row.scss @@ -1,4 +1,4 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; #extension-origin-platform-tooltip > .tooltip-inner { max-width: 400px; @@ -63,7 +63,7 @@ .extension-selector { - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { display: none; } } @@ -104,7 +104,7 @@ height: 24px; outline: none; color: var(--extensionsPickerIdTextColor); - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { display: none; } } diff --git a/base/src/main/resources/web/lib/components/extensions-picker/extension-search-bar.scss b/base/src/main/resources/web/lib/components/extensions-picker/extension-search-bar.scss index f2ab6847d..009fb37ae 100644 --- a/base/src/main/resources/web/lib/components/extensions-picker/extension-search-bar.scss +++ b/base/src/main/resources/web/lib/components/extensions-picker/extension-search-bar.scss @@ -1,4 +1,4 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; .search-bar { margin: 0 auto; @@ -18,7 +18,7 @@ gap: 5px; background-color: var(--extensionsPickerSearchClearButtonBg); - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { span { display: none; } @@ -41,7 +41,7 @@ margin-right: 5px !important; } - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { display: none; } @@ -59,7 +59,7 @@ background-color: var(--extensionsPickerSearchBg); - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { margin: 0 10px; } @@ -128,7 +128,7 @@ display: flex; gap: 3px; - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { display: none; } diff --git a/base/src/main/resources/web/lib/components/extensions-picker/extensions-picker.scss b/base/src/main/resources/web/lib/components/extensions-picker/extensions-picker.scss index c84458253..01331a01e 100644 --- a/base/src/main/resources/web/lib/components/extensions-picker/extensions-picker.scss +++ b/base/src/main/resources/web/lib/components/extensions-picker/extensions-picker.scss @@ -1,4 +1,4 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; .extensions-picker { @@ -51,7 +51,7 @@ flex-basis: 350px; order: 2; flex-grow: 1; - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { flex-basis: calc(100% - 32px); } } @@ -75,7 +75,7 @@ z-index: 99; padding-top: 20px; - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { top: 0; } @@ -108,7 +108,7 @@ flex-grow: 1; overflow: hidden; - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { padding: 0px 0px 200px; } diff --git a/base/src/main/resources/web/lib/components/header/code-quarkus-header.scss b/base/src/main/resources/web/lib/components/header/code-quarkus-header.scss index 0b87dc69a..5d41dc269 100644 --- a/base/src/main/resources/web/lib/components/header/code-quarkus-header.scss +++ b/base/src/main/resources/web/lib/components/header/code-quarkus-header.scss @@ -1,4 +1,4 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; .header { height: 70px; @@ -64,7 +64,7 @@ width: auto; } - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { margin-left: 10px; img { height: 20px; diff --git a/base/src/main/resources/web/lib/components/header/code-quarkus-io-header.scss b/base/src/main/resources/web/lib/components/header/code-quarkus-io-header.scss index cedfe3583..06b96f4d4 100644 --- a/base/src/main/resources/web/lib/components/header/code-quarkus-io-header.scss +++ b/base/src/main/resources/web/lib/components/header/code-quarkus-io-header.scss @@ -1,4 +1,4 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; .header { .enterprise-support { @@ -66,7 +66,7 @@ } - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width:config.$mobileWidth) { display: none; } } diff --git a/base/src/main/resources/web/lib/components/header/stream-picker.scss b/base/src/main/resources/web/lib/components/header/stream-picker.scss index 23cbec32c..3e2add0b2 100644 --- a/base/src/main/resources/web/lib/components/header/stream-picker.scss +++ b/base/src/main/resources/web/lib/components/header/stream-picker.scss @@ -1,4 +1,4 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; .stream-picker { z-index: 1500; @@ -114,7 +114,7 @@ } } - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { display: none; } } diff --git a/base/src/main/resources/web/lib/components/info-picker/info-picker.scss b/base/src/main/resources/web/lib/components/info-picker/info-picker.scss index 4fc6e7d9c..13df82e20 100644 --- a/base/src/main/resources/web/lib/components/info-picker/info-picker.scss +++ b/base/src/main/resources/web/lib/components/info-picker/info-picker.scss @@ -1,4 +1,4 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; .info-picker { height: 118px; @@ -15,7 +15,7 @@ padding: 0; } - @media screen and (max-width: $tabletWidth) { + @media screen and (max-width: config.$tabletWidth) { .extended-settings, .toggle-button { display: none; diff --git a/base/src/main/resources/web/lib/components/quarkus-project/quarkus-project-edition-form.scss b/base/src/main/resources/web/lib/components/quarkus-project/quarkus-project-edition-form.scss index b10e3d03e..7cde50b81 100644 --- a/base/src/main/resources/web/lib/components/quarkus-project/quarkus-project-edition-form.scss +++ b/base/src/main/resources/web/lib/components/quarkus-project/quarkus-project-edition-form.scss @@ -1,9 +1,9 @@ -@import "../_config.scss"; +@use "../_config.scss" as config; .quarkus-project-edition-form { padding-bottom: 30px; - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { margin: 0; } @@ -25,7 +25,7 @@ margin: 0 auto; } - @media screen and (max-width: $mobileWidth) { + @media screen and (max-width: config.$mobileWidth) { display: none; } } @@ -69,7 +69,7 @@ color: var(--mainContainerTextColor); text-align: center; margin-top: 20px; - @media screen and (min-width: $mobileWidth) { + @media screen and (min-width: config.$mobileWidth) { display: none; } } diff --git a/community-app/src/main/resources/application.properties b/community-app/src/main/resources/application.properties index 45c3065a8..02f24ca57 100644 --- a/community-app/src/main/resources/application.properties +++ b/community-app/src/main/resources/application.properties @@ -1,2 +1 @@ -quarkus.web-bundler.bundle.lib=true quarkus.web-bundler.bundle.community-app=true \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6d214112f..07173e572 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 3.5.4 - 1.9.3 + 2.0.0.CR8 2.2.1 3.4.4