Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(misc): revamp #1

Merged
merged 28 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a2411d5
wip(misc): updated dependencies
bouassaba Oct 30, 2024
9b711a0
fix(ui): remove wrong props
bouassaba Oct 30, 2024
149b0ba
chore(ui): update README.md
bouassaba Oct 30, 2024
1a47c8b
fix(ui): add missing package classnames
bouassaba Oct 30, 2024
76879ea
fix(api): several issues
bouassaba Oct 30, 2024
dc89987
docs(misc): update DEVELOPMENT.md
bouassaba Oct 30, 2024
be5e573
chore(api): format code
bouassaba Oct 30, 2024
76cc8ee
ci(api): check on PR
bouassaba Oct 30, 2024
ce7acf0
ci(api): update GitHub action runner
bouassaba Oct 30, 2024
d17cd79
fix(api): linter errors
bouassaba Oct 30, 2024
d77cc17
chore(api): update README.md
bouassaba Oct 30, 2024
068d72c
ci(api): update lint GitHub action
bouassaba Oct 30, 2024
9eaca90
ci(api): update lint GitHub action
bouassaba Oct 30, 2024
a1aac42
ci(api): update lint GitHub action
bouassaba Oct 30, 2024
326cc34
ci(api): update lint GitHub action
bouassaba Oct 30, 2024
33d20ce
ci(api): update lint GitHub action
bouassaba Oct 30, 2024
36343a1
ci(api): check linter, will be reverted next
bouassaba Oct 30, 2024
c1b80f6
ci(api): format code, checking linter
bouassaba Oct 30, 2024
80a7858
ci(api): revert last commit
bouassaba Oct 30, 2024
0e51a1a
ci(ui): check on PR
bouassaba Oct 30, 2024
327854d
ci(ui): update GitHub action
bouassaba Oct 30, 2024
4401aea
ci(ui): update GitHub action
bouassaba Oct 30, 2024
fc439c8
chore(ui): format code
bouassaba Oct 30, 2024
2342187
chore(ui): format code
bouassaba Oct 30, 2024
36c85e3
fix(ui): several code quality issues
bouassaba Oct 30, 2024
c4b0a3e
ci(sqlgen): check on PR
bouassaba Oct 30, 2024
a444ed7
fix(sqlgen): revamp
bouassaba Oct 30, 2024
e1c5238
fix(misc): Dockerfiles
bouassaba Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/check-on-pr-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint rolldebee/api

on:
pull_request:
branches:
- main
paths:
- "api/**/*.kt"
- "api/**/*.kts"
- "!api/README.md"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.4.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
- name: Lint using ktlint
run: |
ktlint --reporter=checkstyle,output=build/ktlint-report.xml "api/**/*.kt"
continue-on-error: true
- uses: yutailang0119/action-ktlint@v4
with:
report-path: build/*.xml # Support glob patterns by https://www.npmjs.com/package/@actions/glob
continue-on-error: false # If annotations contain error of severity, action-ktlint exit 1.
permissions:
contents: read
pull-requests: read
checks: write
30 changes: 30 additions & 0 deletions .github/workflows/check-on-pr-sqlgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint rolldebee/sqlgen

on:
pull_request:
branches:
- main
paths:
- "sqlgen/**/*.kt"
- "sqlgen/**/*.kts"
- "!sqlgen/README.md"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.4.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
- name: Lint using ktlint
run: |
ktlint --reporter=checkstyle,output=build/ktlint-report.xml "sqlgen/**/*.kt"
continue-on-error: true
- uses: yutailang0119/action-ktlint@v4
with:
report-path: build/*.xml # Support glob patterns by https://www.npmjs.com/package/@actions/glob
continue-on-error: false # If annotations contain error of severity, action-ktlint exit 1.
permissions:
contents: read
pull-requests: read
checks: write
38 changes: 38 additions & 0 deletions .github/workflows/check-on-pr-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint rolldebee/ui

on:
pull_request:
branches:
- main
paths:
- "ui/**"
- "!ui/.env"
- "!ui/README.md"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install packages
run: npm i --legacy-peer-deps
working-directory: ui

- name: Run TypeScript Compiler
run: npm run tsc
working-directory: ui

- name: Run ESLint
run: npm run lint
working-directory: ui
permissions:
contents: read
pull-requests: read
checks: write
5 changes: 1 addition & 4 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
### Run Infrastructure Services With Docker

```shell
docker compose up -d \
db \
oracle \
adminer
docker compose up -d db oracle
```

### Run Microservices
Expand Down
3 changes: 0 additions & 3 deletions api/.vscode/settings.json

This file was deleted.

4 changes: 2 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM gradle:jdk17 as builder
FROM gradle:jdk21 as builder
WORKDIR /build
COPY . .
RUN gradle assemble

FROM gradle:jdk17
FROM gradle:jdk21
WORKDIR /app
COPY --from=builder /build/build/libs .
COPY --from=builder /build/src/main/resources/application.yml .
Expand Down
6 changes: 6 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Format code:
ktlint --format
```

Lint:

```shell
ktlint
```

Run for development:

```shell
Expand Down
47 changes: 29 additions & 18 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "2.6.4"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
kotlin("jvm") version "1.6.10"
kotlin("plugin.spring") version "1.6.10"
kotlin("plugin.jpa") version "1.6.10"
kotlin("plugin.serialization") version "1.6.10"
id("org.springframework.boot") version "3.3.5"
id("io.spring.dependency-management") version "1.1.6"
kotlin("jvm") version "1.9.25"
kotlin("plugin.spring") version "1.9.25"
kotlin("plugin.jpa") version "1.9.25"
kotlin("plugin.serialization") version "1.9.25"
}

group = "rolldebee"
version = "1.0.0"
java.sourceCompatibility = JavaVersion.VERSION_17

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

configurations {
compileOnly {
Expand All @@ -30,23 +33,31 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-devtools")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.hashids:hashids:1.0.3")
runtimeOnly("mysql:mysql-connector-java")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.sqids:sqids:0.1.0")
runtimeOnly("mysql:mysql-connector-java:8.0.33")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("com.oracle.ojdbc:ojdbc10:19.3.0.0")
runtimeOnly("com.oracle.database.jdbc:ojdbc11:23.5.0.24.07")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}

allOpen {
annotation("jakarta.persistence.Entity")
annotation("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
}

tasks.withType<Test> {
useJUnitPlatform()
}
Binary file modified api/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion api/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
41 changes: 28 additions & 13 deletions api/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,18 +198,28 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
Loading