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

Upgrade to k2, remove Kotlin/js #172

Merged
merged 6 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/gradle-build-with-detekt.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Gradle Build With Detekt

on: [push, pull_request]
on: [workflow_dispatch]

jobs:
build:
Expand All @@ -18,4 +18,4 @@ jobs:
- uses: gradle/[email protected]
with:
arguments: build --stacktrace -PrunDetekt


1 change: 0 additions & 1 deletion aliasFrontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"axios": "^0.27.2",
"common-types": "file:common/build/libs/common-types",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand Down
3 changes: 1 addition & 2 deletions aliasFrontend/src/components/AliasCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {alias} from "common-types";
import Card = alias.JsCard;
import {Card} from '../models/Card';

type AliasCardProps = {
card: Card | null
Expand Down
5 changes: 2 additions & 3 deletions aliasFrontend/src/components/Leaderboard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {alias} from "common-types";
import Team = alias.JsTeam;
import {Team} from "../models/Team";

type LeaderboardProps = {
teams: Array<Team>
Expand All @@ -20,4 +19,4 @@ export default function Leaderboard({teams}: LeaderboardProps) {
}
</div>
</div>)
}
}
3 changes: 1 addition & 2 deletions aliasFrontend/src/components/screens/GameRoundScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {useEffect, useState} from "react";
import axios from "axios";
import {alias} from "common-types";
import Card = alias.JsCard;
import {Card} from '../../models/Card';
import {GameState} from "../GameScreen";
import {GameTeams} from "../../models/Team";
import AliasCard from "../AliasCard";
Expand Down
3 changes: 1 addition & 2 deletions aliasFrontend/src/components/screens/PreviousGamesScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {GameState} from "../GameScreen";
import {useEffect, useState} from "react";
import {alias} from "common-types";
import Team = alias.JsTeam;
import {Team} from "../../models/Team";
import Leaderboard from "../Leaderboard";
import axios from "axios";

Expand Down
3 changes: 1 addition & 2 deletions aliasFrontend/src/components/screens/TeamsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {GameState} from "../GameScreen";
import {GameTeams} from "../../models/Team";
import axios from "axios";
import {alias} from "common-types";
import Team = alias.JsTeam;
import {Team} from "../../models/Team";
import {useState} from "react";

type TeamsScreenProps = {
Expand Down
9 changes: 9 additions & 0 deletions aliasFrontend/src/models/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export class Card {
id: number
words: Array<string>

constructor(id: number, words: Array<string>) {
this.id = id
this.words = words
}
}
15 changes: 12 additions & 3 deletions aliasFrontend/src/models/Team.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import {alias} from "common-types";
import Team = alias.JsTeam;
export class Team {
id: number
points: number = 0
name: string

constructor(id: number, points: number, name: string) {
this.id = id
this.points = points
this.name = name
}
}

export class GameTeams {
teams: Array<Team>
Expand All @@ -18,4 +27,4 @@ export class GameTeams {
this.currentTeamIndex = 0
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package jetbrains.kotlin.course.alias.card

import alias.JsCard
import org.springframework.web.bind.annotation.*

typealias Card = String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package jetbrains.kotlin.course.alias.card

data class JsCard(
val id: Int,
val words: Array<String>
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jetbrains.kotlin.course.alias.results

import alias.JsTeam
import jetbrains.kotlin.course.alias.team.JsTeam
import org.springframework.web.bind.annotation.*

typealias GameResult = String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package jetbrains.kotlin.course.alias.team

data class JsTeam(
val id: Int,
val points: Int,
val name: String,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package jetbrains.kotlin.course.alias.team

import alias.JsTeam
import org.springframework.web.bind.annotation.*

@RestController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jetbrains.kotlin.course.alias.util

import alias.JsTeam
import jetbrains.kotlin.course.alias.team.JsTeam
import jetbrains.kotlin.course.alias.team.Team

fun Team.toJsTeam(): JsTeam = JsTeam(this.id, this.points, this.name)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"files": {
"main.css": "/static/css/main.9629e922.css",
"main.js": "/static/js/main.6f70c592.js",
"static/js/787.281e1195.chunk.js": "/static/js/787.281e1195.chunk.js",
"main.css": "/static/css/main.242c9780.css",
"main.js": "/static/js/main.d5fc3866.js",
"static/js/453.6846c50c.chunk.js": "/static/js/453.6846c50c.chunk.js",
"static/media/Kotlin_Alias_cover.svg": "/static/media/Kotlin_Alias_cover.4088f27960b405fba209d6531940b03e.svg",
"static/media/finish_game_button.svg": "/static/media/finish_game_button.5802af17c68793ad5611.svg",
"static/media/play_button.svg": "/static/media/play_button.aad770749eabbe8ac9b1.svg",
Expand All @@ -15,12 +15,12 @@
"index.html": "/index.html",
"static/media/Kotlin_Alias_bg.svg": "/static/media/Kotlin_Alias_bg.36ac84bcfc4b1fa64b64.svg",
"static/media/Kotlin_Alias_bg_white.svg": "/static/media/Kotlin_Alias_bg_white.00acddcc6609eb49c481.svg",
"main.9629e922.css.map": "/static/css/main.9629e922.css.map",
"main.6f70c592.js.map": "/static/js/main.6f70c592.js.map",
"787.281e1195.chunk.js.map": "/static/js/787.281e1195.chunk.js.map"
"main.242c9780.css.map": "/static/css/main.242c9780.css.map",
"main.d5fc3866.js.map": "/static/js/main.d5fc3866.js.map",
"453.6846c50c.chunk.js.map": "/static/js/453.6846c50c.chunk.js.map"
},
"entrypoints": [
"static/css/main.9629e922.css",
"static/js/main.6f70c592.js"
"static/css/main.242c9780.css",
"static/js/main.d5fc3866.js"
]
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@200;300;900&display=swap" rel="stylesheet"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Alias</title><script defer="defer" src="/static/js/main.6f70c592.js"></script><link href="/static/css/main.9629e922.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@200;300;900&display=swap" rel="stylesheet"><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Alias</title><script defer="defer" src="/static/js/main.d5fc3866.js"></script><link href="/static/css/main.242c9780.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

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

Loading
Loading