Skip to content

Commit

Permalink
Merge branch 'main' into hash-app-names
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabarov authored Sep 11, 2024
2 parents 738e23f + c4bd620 commit f0b79e3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion flow-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.core.contenttype</artifactId>
<version>3.9.400</version>
<version>3.9.500</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -559,8 +562,14 @@ private static FrontendVersion getVersion(String tool,
throw new IOException("Process exited with non 0 exit code. ("
+ exitCode + ")");
}
return FrontendUtils.parseFrontendVersion(
streamConsumer.getNow(new Pair<>("", "")).getFirst());
String version;
try {
version = streamConsumer.get(1, TimeUnit.SECONDS).getFirst();
} catch (ExecutionException | TimeoutException e) {
getLogger().debug("Cannot read {} version", tool, e);
version = "";
}
return FrontendUtils.parseFrontendVersion(version);
} catch (InterruptedException | IOException e) {
throw new InstallationException(String.format(
"Unable to detect version of %s. %s", tool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
import com.vaadin.flow.theme.NoTheme;
import com.vaadin.flow.theme.ThemeDefinition;

import static com.vaadin.flow.server.frontend.scanner.FrontendClassVisitor.DEV;
import static com.vaadin.flow.server.frontend.scanner.FrontendClassVisitor.VALUE;
import static com.vaadin.flow.server.frontend.scanner.FrontendClassVisitor.VERSION;
import static com.vaadin.flow.server.frontend.scanner.FrontendClassVisitor.DEV;

/**
* Represents the class dependency tree of the application.
Expand Down Expand Up @@ -742,14 +742,19 @@ private void computePwaConfiguration() throws ClassNotFoundException {
.getAnnotatedClasses(PWA.class.getName())) {
if (!Arrays.asList(hopefullyAppShellClass.getInterfaces())
.contains(appShellConfiguratorClass)) {
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION);
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION
+ " " + hopefullyAppShellClass.getName()
+ " does not implement "
+ AppShellConfigurator.class.getSimpleName());
}
pwaVisitor.visitClass(hopefullyAppShellClass.getName());
}

Set<String> dependencies = pwaVisitor.getValues("name");
if (dependencies.size() > 1) {
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION);
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION
+ " Found " + dependencies.size() + " implementations: "
+ dependencies);
}
if (dependencies.isEmpty()) {
this.pwaConfiguration = new PwaConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,15 +520,20 @@ private PwaConfiguration discoverPwa() {
if (annotatedClasses.isEmpty()) {
return new PwaConfiguration();
} else if (annotatedClasses.size() != 1) {
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION);
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION
+ " Found " + annotatedClasses.size()
+ " implementations: " + annotatedClasses);
}

Class<?> hopefullyAppShellClass = annotatedClasses.iterator()
.next();
if (!Arrays.stream(hopefullyAppShellClass.getInterfaces())
.map(Class::getName).collect(Collectors.toList())
.contains(AppShellConfigurator.class.getName())) {
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION);
throw new IllegalStateException(ERROR_INVALID_PWA_ANNOTATION
+ " " + hopefullyAppShellClass.getName()
+ " does not implement "
+ AppShellConfigurator.class.getSimpleName());
}

Annotation pwa = annotationFinder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"async": "3.2.6",
"glob": "10.4.5",
"typescript": "5.5.4",
"typescript": "5.6.2",
"workbox-core": "7.1.0",
"workbox-precaching": "7.1.0",
"strip-css-comments": "5.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@babel/preset-react": "7.24.7",
"rollup-plugin-visualizer": "5.12.0",
"rollup-plugin-brotli": "3.1.0",
"vite-plugin-checker": "0.7.2",
"vite-plugin-checker": "0.8.0",
"workbox-build": "7.1.1",
"transform-ast": "2.4.4"
}
Expand Down

0 comments on commit f0b79e3

Please sign in to comment.