Skip to content

Commit

Permalink
Merge pull request #16 from PascalHonegger/migrate-to-ktor-3
Browse files Browse the repository at this point in the history
Migrate to ktor 3
  • Loading branch information
PascalHonegger authored Nov 1, 2024
2 parents fd5893a + 25d0d7f commit 4957d3d
Show file tree
Hide file tree
Showing 52 changed files with 1,982 additions and 1,133 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
package_json_file: Frontend/package.json
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: pnpm
cache-dependency-path: Frontend/pnpm-lock.yaml
- run: pnpm i
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
package_json_file: Frontend/package.json
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: pnpm
cache-dependency-path: Frontend/pnpm-lock.yaml
- run: pnpm i
Expand Down
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Backend/bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ application {
}

kotlin {
jvmToolchain(21)
jvmToolchain(23)
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fun Application.initializeDatabase() {
url = property("jasstracker.db.url").getString(),
user = property("jasstracker.db.user").getString(),
password = propertyOrNull("jasstracker.db.password")?.getString(),
runTestMigrations = environment.developmentMode
runTestMigrations = developmentMode
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import io.ktor.http.*
import io.ktor.serialization.kotlinx.json.*
import io.ktor.server.application.*
import io.ktor.server.plugins.autohead.*
import io.ktor.server.plugins.callloging.*
import io.ktor.server.plugins.calllogging.*
import io.ktor.server.plugins.contentnegotiation.*
import io.ktor.server.plugins.cors.routing.*
import io.ktor.server.plugins.statuspages.*
import io.ktor.server.request.*
import io.github.oshai.kotlinlogging.KotlinLogging

fun Application.configureHTTP() {
val log = KotlinLogging.logger { }
if (environment.developmentMode) {
val log = KotlinLogging.logger { }
if (developmentMode) {
install(CORS) {
allowHeader(HttpHeaders.ContentType)
allowHeader(HttpHeaders.Authorization)
Expand Down
2 changes: 1 addition & 1 deletion Backend/data-access/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

kotlin {
jvmToolchain(21)
jvmToolchain(23)
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion Backend/domain/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

kotlin {
jvmToolchain(21)
jvmToolchain(23)
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion Backend/security/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

kotlin {
jvmToolchain(21)
jvmToolchain(23)
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion Backend/web-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

kotlin {
jvmToolchain(21)
jvmToolchain(23)
}

dependencies {
Expand All @@ -19,6 +19,7 @@ dependencies {
implementation(libs.java.jwt)
implementation(libs.kotlinx.datetime)
testImplementation(libs.ktor.client.content.negotiation)
testImplementation(libs.ktor.server.content.negotiation)
testImplementation(testLibs.ktor.server.tests)
testImplementation(testLibs.kotlin.test)
testImplementation(testLibs.mockk)
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM node:20-alpine AS buildFrontend
FROM node:22-alpine AS buildFrontend
RUN corepack enable
COPY ./Frontend /home/node/src
WORKDIR /home/node/src
RUN pnpm i --frozen-lockfile
RUN pnpm build

FROM eclipse-temurin:21-jdk AS buildBackend
FROM eclipse-temurin:23-jdk-alpine AS buildBackend
COPY . /home/gradle/src
COPY --from=buildFrontend /home/node/src/dist /home/gradle/src/Backend/bootstrap/src/main/resources/static
WORKDIR /home/gradle/src
RUN ./gradlew shadowJar --no-daemon

FROM eclipse-temurin:21-jre
FROM eclipse-temurin:23-jre-alpine
EXPOSE 8080:8080
RUN mkdir /app
COPY --from=buildBackend /home/gradle/src/Backend/bootstrap/build/libs/*.jar /app/jasstracker.jar
Expand Down
2 changes: 1 addition & 1 deletion DockerfileBuiltLocally
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:21-jre
FROM eclipse-temurin:23-jre-alpine
EXPOSE 8080:8080
RUN mkdir /app
COPY ./Backend/bootstrap/build/libs/*.jar /app/jasstracker.jar
Expand Down
15 changes: 0 additions & 15 deletions Frontend/.eslintrc.cjs

This file was deleted.

21 changes: 21 additions & 0 deletions Frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import js from '@eslint/js'
import eslintPluginVue from 'eslint-plugin-vue'
import skipFormattingConfig from "@vue/eslint-config-prettier/skip-formatting";
import vueTsEslintConfig from "@vue/eslint-config-typescript";
import ts from 'typescript-eslint'

export default ts.config(
js.configs.recommended,
...ts.configs.recommended,
...eslintPluginVue.configs['flat/recommended'],
...vueTsEslintConfig(),
{
files: ['*.vue', '**/*.vue'],
languageOptions: {
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
},
skipFormattingConfig
)
43 changes: 22 additions & 21 deletions Frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jasstracker",
"version": "0.1.0",
"private": true,
"packageManager": "pnpm@9.1.2+sha512.127dc83b9ea10c32be65d22a8efb4a65fb952e8fefbdfded39bdc3c97efc32d31b48b00420df2c1187ace28c921c902f0cb5a134a4d032b8b5295cbfa2c681e2",
"packageManager": "pnpm@9.12.3+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee",
"license": "MIT",
"type": "module",
"scripts": {
Expand All @@ -11,37 +11,38 @@
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"lint": "eslint \"src/**/*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mt}\" --fix",
"format": "prettier --write src/"
},
"dependencies": {
"mande": "^2.0.9",
"pinia": "^2.1.7",
"vue": "^3.4.27",
"pinia": "^2.2.5",
"vue": "^3.5.12",
"vue-draggable-next": "^2.2.1",
"vue-router": "^4.3.2",
"vue-router": "^4.4.5",
"vue-toastification": "2.0.0-rc.5",
"vue3-charts": "^1.1.33"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.3",
"@tsconfig/node20": "^20.1.4",
"@eslint/js": "^9.14.0",
"@rushstack/eslint-patch": "^1.10.4",
"@tsconfig/node22": "^22.0.0",
"@types/d3-axis": "^3.0.6",
"@types/d3-shape": "^3.1.6",
"@types/node": "^20.12.12",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@types/node": "^22.8.6",
"@vitejs/plugin-vue": "^5.1.4",
"@vue/eslint-config-prettier": "^10.1.0",
"@vue/eslint-config-typescript": "^14.1.3",
"@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.26.0",
"npm-run-all2": "^6.2.0",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vue-tsc": "^2.0.19"
"autoprefixer": "^10.4.20",
"eslint": "^9.14.0",
"eslint-plugin-vue": "^9.30.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vue-tsc": "^2.1.10"
}
}
Loading

0 comments on commit 4957d3d

Please sign in to comment.