Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into autogrid-list
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur- committed Sep 12, 2023
2 parents 0c7696d + da64ee4 commit 6f0fe40
Show file tree
Hide file tree
Showing 57 changed files with 347 additions and 258 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ packages/ts/*/.vite
scripts/generator/results/
packages/java/hilla/*.json
packages/java/hilla-react/*.json
packages/java/hilla/src/dev/hilla/theme
packages/java/hilla-react/src/dev/hilla/theme
packages/java/hilla/src/main/java/dev/hilla/theme/
packages/java/hilla-react/src/main/java/dev/hilla/theme/

# npm pack
packages/ts/*/*.tgz
Expand Down
58 changes: 49 additions & 9 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/java/endpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>endpoint</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<name>Hilla Endpoint</name>
<packaging>jar</packaging>

Expand Down
2 changes: 1 addition & 1 deletion packages/java/engine-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion packages/java/engine-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion packages/java/gradle-plugin/pom-portal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion packages/java/gradle-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions packages/java/hilla-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand All @@ -16,7 +16,7 @@
<packaging>pom</packaging>
<name>Hilla Platform (Bill of Materials)</name>
<description>Hilla Platform (Bill of Materials)</description>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<url>https://hilla.dev</url>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions packages/java/hilla-dev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand All @@ -16,7 +16,7 @@
<packaging>jar</packaging>
<name>Hilla Platform Development Dependencies</name>
<description>Hilla Platform Development Dependencies</description>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<url>https://hilla.dev</url>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions packages/java/hilla-react-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

<groupId>dev.hilla</groupId>
<artifactId>hilla-react-spring-boot-starter</artifactId>
<name>Hilla React Spring Boot Starter</name>
<description>Spring Boot Starter for Hilla applications using React.</description>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>

<properties>
<formatter.basedir>${project.parent.basedir}</formatter.basedir>
Expand Down
4 changes: 2 additions & 2 deletions packages/java/hilla-react/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand All @@ -16,7 +16,7 @@
<packaging>jar</packaging>
<name>Hilla Platform for React</name>
<description>Hilla Platform for React-based Applications</description>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<url>https://hilla.dev</url>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions packages/java/hilla-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

<groupId>dev.hilla</groupId>
<artifactId>hilla-spring-boot-starter</artifactId>
<name>Hilla Spring Boot Starter</name>
<description>Spring Boot Starter for Hilla applications using Lit.</description>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>

<properties>
<formatter.basedir>${project.parent.basedir}</formatter.basedir>
Expand Down
4 changes: 2 additions & 2 deletions packages/java/hilla/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand All @@ -16,7 +16,7 @@
<packaging>jar</packaging>
<name>Hilla Platform</name>
<description>Hilla Platform</description>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<url>https://hilla.dev</url>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion packages/java/maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion packages/java/parser-jvm-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;

final class ClassInfoReflectionModel extends ClassInfoModel
implements ReflectionModel {
Expand Down Expand Up @@ -197,7 +195,6 @@ protected List<AnnotationInfoModel> prepareAnnotations() {
@Override
protected List<FieldInfoModel> prepareFields() {
return Arrays.stream(origin.getDeclaredFields()).map(FieldInfoModel::of)
.sorted(FieldInfoModel.FIELD_ORDER)
.collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ protected List<AnnotationInfoModel> prepareAnnotations() {
@Override
protected List<FieldInfoModel> prepareFields() {
return origin.getDeclaredFieldInfo().stream().map(FieldInfoModel::of)
.sorted(FieldInfoModel.FIELD_ORDER)
.collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
package dev.hilla.parser.models;

import javax.annotation.Nonnull;

import java.lang.reflect.Field;
import java.util.Comparator;
import java.util.Objects;

import javax.annotation.Nonnull;

import io.github.classgraph.FieldInfo;

public abstract class FieldInfoModel extends AnnotatedAbstractModel
implements ClassMemberModel {
static final Comparator<FieldInfoModel> FIELD_ORDER = Comparator
.comparing(FieldInfoModel::getName);
private ClassInfoModel owner;
private SignatureModel type;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package dev.hilla.parser.core.dependency;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.net.URISyntaxException;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.util.Set;

import dev.hilla.parser.core.Parser;
import dev.hilla.parser.testutils.ResourceLoader;

import io.swagger.v3.oas.models.OpenAPI;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class DependencyTests {
private static final List<String> classPath;
Expand Down Expand Up @@ -61,12 +62,12 @@ public void should_ResolveDependenciesCorrectly_When_ResolvingMethods() {

@Test
public void should_ResolveDependencyMembersCorrectly() {
var expected = List.of("bar", "dependencyEntityThree", "foo", "foo2",
var expected = Set.of("bar", "dependencyEntityThree", "foo", "foo2",
"foo3");

var actual = openApi.getExtensions()
Collection<String> actual = (Collection<String>) openApi.getExtensions()
.get(DependencyPlugin.DEPS_MEMBERS_STORAGE_KEY);

assertEquals(expected, actual);
assertEquals(expected, new HashSet<>(actual));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ public void should_GetAllInnerClasses(ClassInfoModel model,
@ArgumentsSource(ModelProvider.class)
public void should_GetClassFields(ClassInfoModel model, ModelKind kind) {
var expected = getDeclaredFields(Dependency.Sample.class)
.map(FieldInfoModel::of).sorted(FieldInfoModel.FIELD_ORDER)
.collect(Collectors.toList());
.map(FieldInfoModel::of).collect(Collectors.toList());
var actual = model.getFields();

assertEquals(expected, actual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -47,10 +48,11 @@ public void setUp() {
@ArgumentsSource(ModelProvider.class)
public void should_HaveCorrectType(JacksonPropertyModel model,
String name) {
var expectedTypes = JacksonPropertySharedTests.stringifiedTypes
.get(name);
assertEquals(expectedTypes, model.getAssociatedTypes().stream()
.map(Model::get).map(Object::toString).toList());
var expectedTypes = new HashSet<>(
JacksonPropertySharedTests.stringifiedTypes.get(name));
assertEquals(expectedTypes,
model.getAssociatedTypes().stream().map(Model::get)
.map(Object::toString).collect(Collectors.toSet()));
}

@DisplayName("It should pass equality check")
Expand Down Expand Up @@ -172,8 +174,9 @@ record Expected(boolean hasField, Optional<FieldInfoModel> field) {
var expected = switch (name) {
case "propertyGetterOnly", "propertySetterOnly" -> new Expected(false,
Optional.empty());
default -> new Expected(true, Optional.of(FieldInfoModel
.of(getDeclaredField(JacksonPropertySharedTests.Sample.class, name))));
default -> new Expected(true,
Optional.of(FieldInfoModel.of(getDeclaredField(
JacksonPropertySharedTests.Sample.class, name))));
};

assertEquals(expected.hasField(), model.hasField());
Expand All @@ -193,7 +196,8 @@ record Expected(boolean hasGetter, Optional<MethodInfoModel> getter) {
false, Optional.empty());
default -> new Expected(true,
Optional.of(MethodInfoModel.of(getDeclaredMethod(
JacksonPropertySharedTests.Sample.class, toGetterName(name)))));
JacksonPropertySharedTests.Sample.class,
toGetterName(name)))));
};

assertEquals(expected.hasGetter(), model.hasGetter());
Expand All @@ -210,7 +214,8 @@ record Expected(boolean hasSetter, Optional<MethodInfoModel> setter) {

var expected = switch (name) {
case "privatePropertyWithAccessors", "propertySetterOnly" -> new Expected(
true, getAnyDeclaredMethod(JacksonPropertySharedTests.Sample.class,
true,
getAnyDeclaredMethod(JacksonPropertySharedTests.Sample.class,
toSetterName(name)).map(MethodInfoModel::of));
default -> new Expected(false, Optional.empty());
};
Expand Down
2 changes: 1 addition & 1 deletion packages/java/parser-jvm-plugin-backbone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.hilla</groupId>
<artifactId>hilla-project</artifactId>
<version>2.2-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

public final class PropertyPlugin
extends AbstractPlugin<BackbonePluginConfiguration> {
private static final Comparator<JacksonPropertyModel> sorter = Comparator
.comparing(JacksonPropertyModel::getName);
private SerializationConfig serializationConfig = new JacksonObjectMapperFactory.Json()
.build().getSerializationConfig();

Expand Down Expand Up @@ -87,7 +85,7 @@ private Stream<JacksonPropertyModel> collectProperties(
.introspect(serializationConfig.constructType((Class<?>) cls));

var processor = new PropertyProcessor(description);
return processor.stream().sorted(sorter);
return processor.stream();
}

private JacksonObjectMapperFactory loadJacksonObjectMapperFactory() {
Expand Down
Loading

0 comments on commit 6f0fe40

Please sign in to comment.