Skip to content

Commit

Permalink
Migrate to Kotlin React
Browse files Browse the repository at this point in the history
  • Loading branch information
terrakok committed Jan 2, 2024
1 parent f3d7cc9 commit e72fd66
Show file tree
Hide file tree
Showing 101 changed files with 2,651 additions and 4,041 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,29 @@ jobs:
- name: Checkout
uses: actions/[email protected]

- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Test
run: |
./gradlew check
- name: Upload Reports
uses: actions/upload-artifact@v2
with:
name: Test-Reports
path: build/reports
if: always()

- name: Build
run: |
./gradlew jsBrowserProductionWebpack
Expand All @@ -24,4 +43,4 @@ jobs:
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build/distributions
folder: build/dist/js/productionExecutable
32 changes: 29 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,42 @@
name: Test

on:
pull_request_review:
types: [submitted]
pull_request:
branches:
- master

workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest ]
steps:
- name: Checkout
uses: actions/[email protected]

- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Test
run: |
./gradlew check
- name: Upload Reports
uses: actions/upload-artifact@v2
with:
name: Test-Reports
path: build/reports
if: always()
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/build
local.properties
# Project exclude paths
.gradle
build
.idea
**yarn.lock
kotlin-js-store
local.properties
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Konstantin Tckhovrebov
Copyright (c) 2024 Konstantin Tskhovrebov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -17,5 +17,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Kotlin Multiplatform Wizard

[![](https://raw.githubusercontent.com/terrakok/kmp-web-wizard/master/img/img.png)](https://terrakok.github.io/kmp-web-wizard/)

This is JB hackathon project.
Try it out [here](https://terrakok.github.io/kmp-web-wizard/)

It is a fun project with bleeding-edge technologies: Kotlin JS + Compose for Web.

If you see some problems (especially with CSS 😅) or want to add some cool feature PR is welcome! :)

Team:
[@terrakok](https://github.com/terrakok)
[@vkormushkin](https://github.com/vkormushkin)
[@ALD110](https://github.com/ALD110)
[@atyrin](https://github.com/atyrin)
# KMP Web Wizard

[![](https://raw.githubusercontent.com/terrakok/kmp-web-wizard/master/img/page-screenshot.png)](https://terrakok.github.io/kmp-web-wizard/)
52 changes: 20 additions & 32 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
plugins {
kotlin("multiplatform") version "1.8.10"
id("org.jetbrains.compose") version "1.4.0-alpha01-dev980"
kotlin("multiplatform").version("1.9.21")
}

repositories {
mavenCentral()
google()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}

kotlin {
jvm() //for common tests
js(IR) {
jvm()
js {
browser {
testTask {
enabled = false
Expand All @@ -20,37 +17,28 @@ kotlin {
binaries.executable()
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.runtime)
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
implementation("org.apache.commons:commons-compress:1.2")
}
jsMain.dependencies {
implementation(dependencies.enforcedPlatform("org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom:1.0.0-pre.666"))
implementation("org.jetbrains.kotlin-wrappers:kotlin-react")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom")
implementation("org.jetbrains.kotlin-wrappers:kotlin-emotion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-mui-material")
implementation("org.jetbrains.kotlin-wrappers:kotlin-mui-icons-material")

implementation(npm("file-saver", "2.0.5"))
implementation(npm("jszip", "3.10.1"))
implementation(npm("stream", "0.0.2"))
}
val jsMain by getting {
dependencies {
implementation(compose.web.core)
implementation(npm("highlight.js", "11.7.0"))
implementation(npm("file-saver", "2.0.5"))
implementation(npm("jszip", "3.10.1"))
implementation(npm("stream", "0.0.2"))
}
commonTest.dependencies {
implementation(kotlin("test"))
}
}
}

task<Copy>("fixMissingResources") {
task<Copy>("fixMissingJvmResources") {
dependsOn("jvmProcessResources")
tasks.findByPath("jvmTest")?.dependsOn(this)

from("$buildDir/processedResources/jvm/main")
into("$buildDir/resources/")
from(project.layout.buildDirectory.dir("processedResources/jvm/main"))
into(project.layout.buildDirectory.dir("resources"))
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.caching=true
org.gradle.configuration-cache=true
kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
kotlin.js.compiler=ir
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 1 addition & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MSYS* | MINGW* )
MINGW* )
msys=true
;;
NONSTOP* )
Expand All @@ -82,7 +82,6 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -130,7 +129,6 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
25 changes: 18 additions & 7 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

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

Expand All @@ -40,7 +37,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +51,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute
if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,14 +61,28 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
Expand Down
Binary file removed img/img.png
Binary file not shown.
Binary file added img/page-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
}
rootProject.name = "kmp-web-wizard"
rootProject.name = "kotlin-multiplatform-wizard"

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e72fd66

Please sign in to comment.