aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE21
-rw-r--r--Module.md7
-rw-r--r--build.gradle67
-rw-r--r--dokka/kvision-dokka-helper.jarbin0 -> 7284 bytes
-rw-r--r--examples/helloworld/.gitignore5
-rw-r--r--examples/helloworld/build.gradle92
-rw-r--r--examples/helloworld/detekt.yml292
-rw-r--r--examples/helloworld/gradle.properties2
-rw-r--r--examples/helloworld/gradle/wrapper/gradle-wrapper.jarbin54712 -> 0 bytes
-rw-r--r--examples/helloworld/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xexamples/helloworld/gradlew172
-rw-r--r--examples/helloworld/gradlew.bat84
-rw-r--r--examples/helloworld/package.json.d/project.info3
-rw-r--r--examples/helloworld/settings.gradle1
-rw-r--r--examples/helloworld/src/main/kotlin/com/example/Helloworld.kt32
-rw-r--r--examples/helloworld/src/main/kotlin/com/example/Main.kt42
-rw-r--r--examples/helloworld/src/main/resources/css/style.css3
-rw-r--r--examples/helloworld/src/main/web/index.html19
-rw-r--r--examples/helloworld/src/test/kotlin/test/com/example/HelloworldSpec.kt21
-rw-r--r--examples/helloworld/src/test/kotlin/test/com/example/TestUtil.kt32
-rw-r--r--examples/helloworld/webpack.config.d/bootstrap.js4
-rw-r--r--examples/helloworld/webpack.config.d/css.js2
-rw-r--r--examples/helloworld/webpack.config.d/dce.js2
-rw-r--r--examples/helloworld/webpack.config.d/file.js6
-rw-r--r--examples/helloworld/webpack.config.d/jquery.js4
-rw-r--r--examples/helloworld/webpack.config.d/minify.js4
-rw-r--r--examples/showcase/.gitignore5
-rw-r--r--examples/showcase/build.gradle92
-rw-r--r--examples/showcase/detekt.yml292
-rw-r--r--examples/showcase/gradle.properties2
-rw-r--r--examples/showcase/gradle/wrapper/gradle-wrapper.jarbin54712 -> 0 bytes
-rw-r--r--examples/showcase/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xexamples/showcase/gradlew172
-rw-r--r--examples/showcase/gradlew.bat84
-rw-r--r--examples/showcase/package.json.d/project.info3
-rw-r--r--examples/showcase/settings.gradle1
-rw-r--r--examples/showcase/src/main/kotlin/com/example/BasicTab.kt38
-rw-r--r--examples/showcase/src/main/kotlin/com/example/ButtonsTab.kt48
-rw-r--r--examples/showcase/src/main/kotlin/com/example/ContainersTab.kt95
-rw-r--r--examples/showcase/src/main/kotlin/com/example/DataTab.kt74
-rw-r--r--examples/showcase/src/main/kotlin/com/example/DropDownTab.kt63
-rw-r--r--examples/showcase/src/main/kotlin/com/example/FormTab.kt137
-rw-r--r--examples/showcase/src/main/kotlin/com/example/LayoutsTab.kt160
-rw-r--r--examples/showcase/src/main/kotlin/com/example/Main.kt42
-rw-r--r--examples/showcase/src/main/kotlin/com/example/ModalsTab.kt78
-rw-r--r--examples/showcase/src/main/kotlin/com/example/Showcase.kt43
-rw-r--r--examples/showcase/src/main/resources/css/style.css0
-rw-r--r--examples/showcase/src/main/resources/img/cat.jpgbin39488 -> 0 bytes
-rw-r--r--examples/showcase/src/main/resources/img/dog.jpgbin119870 -> 0 bytes
-rw-r--r--examples/showcase/src/main/web/index.html19
-rw-r--r--examples/showcase/src/test/kotlin/test/com/example/ShowcaseSpec.kt19
-rw-r--r--examples/showcase/src/test/kotlin/test/com/example/TestUtil.kt32
-rw-r--r--examples/showcase/webpack.config.d/bootstrap.js4
-rw-r--r--examples/showcase/webpack.config.d/css.js2
-rw-r--r--examples/showcase/webpack.config.d/dce.js2
-rw-r--r--examples/showcase/webpack.config.d/file.js6
-rw-r--r--examples/showcase/webpack.config.d/jquery.js4
-rw-r--r--examples/showcase/webpack.config.d/minify.js4
-rw-r--r--examples/todomvc/.gitignore5
-rw-r--r--examples/todomvc/build.gradle100
-rw-r--r--examples/todomvc/detekt.yml292
-rw-r--r--examples/todomvc/gradle.properties2
-rw-r--r--examples/todomvc/gradle/wrapper/gradle-wrapper.jarbin54712 -> 0 bytes
-rw-r--r--examples/todomvc/gradle/wrapper/gradle-wrapper.properties6
-rwxr-xr-xexamples/todomvc/gradlew172
-rw-r--r--examples/todomvc/gradlew.bat84
-rw-r--r--examples/todomvc/package.json.d/project.info3
-rw-r--r--examples/todomvc/settings.gradle1
-rw-r--r--examples/todomvc/src/main/kotlin/com/example/Main.kt40
-rw-r--r--examples/todomvc/src/main/kotlin/com/example/Todomvc.kt245
-rw-r--r--examples/todomvc/src/main/web/index.html22
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-app-css/index.css376
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-app-css/package.json61
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-app-css/readme.md28
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/base.css141
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/base.js249
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/package.json57
-rw-r--r--examples/todomvc/src/main/web/node_modules/todomvc-common/readme.md15
-rw-r--r--examples/todomvc/src/main/web/package-lock.json16
-rw-r--r--examples/todomvc/src/main/web/package.json7
-rw-r--r--examples/todomvc/src/test/kotlin/test/com/example/TestUtil.kt32
-rw-r--r--examples/todomvc/webpack.config.d/bootstrap.js4
-rw-r--r--examples/todomvc/webpack.config.d/css.js2
-rw-r--r--examples/todomvc/webpack.config.d/dce.js2
-rw-r--r--examples/todomvc/webpack.config.d/file.js6
-rw-r--r--examples/todomvc/webpack.config.d/jquery.js4
-rw-r--r--examples/todomvc/webpack.config.d/minify.js4
-rw-r--r--gradle/wrapper/gradle-wrapper.jarbin54712 -> 54333 bytes
-rw-r--r--gradle/wrapper/gradle-wrapper.properties3
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/ApplicationBase.kt21
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/HMR.kt15
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Component.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt4
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/html/Label.kt (renamed from src/main/kotlin/pl/treksoft/kvision/basic/Label.kt)2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/SplitPanel.kt5
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/data/DataContainerSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/html/LabelSpec.kt (renamed from src/test/kotlin/test/pl/treksoft/kvision/basic/LabelSpec.kt)6
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/DockPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/FlexPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/GridPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/HPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/ResponsiveGridPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/SplitPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/StackPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/TabPanelSpec.kt2
-rw-r--r--src/test/kotlin/test/pl/treksoft/kvision/panel/VPanelSpec.kt2
107 files changed, 130 insertions, 4376 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..b4f8e8b2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2017-2018 Robert Jaros
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+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.
diff --git a/Module.md b/Module.md
new file mode 100644
index 00000000..753c7fbe
--- /dev/null
+++ b/Module.md
@@ -0,0 +1,7 @@
+# Module KVision
+
+KVision - object oriented Web UI framework for Kotlin/JS.
+
+# Package pl.treksoft.kvision
+
+Base interfaces, classes and functions declarations necessary to develop KVision applications.
diff --git a/build.gradle b/build.gradle
index c714b81a..532af293 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,5 +1,6 @@
buildscript {
ext.kotlin_version = '1.2.21'
+ ext.dokka_version = '0.9.16-eap-3'
ext.production = (findProperty('prod') ?: 'false') == 'true'
ext.npmdeps = new File("npm.dependencies").getText()
@@ -7,12 +8,14 @@ buildscript {
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
maven { url "https://plugins.gradle.org/m2/" }
+ maven { url 'https://bintray.com/kotlin/kotlin-eap/dokka' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.26"
classpath "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0.RC6-2"
+ classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
}
}
@@ -21,9 +24,14 @@ plugins {
id "com.jfrog.bintray" version "1.7.3"
}
-apply plugin: 'kotlin2js'
+if (!project.gradle.startParameter.taskNames.contains("dokka")) {
+ apply plugin: 'kotlin2js'
+} else {
+ apply plugin: 'kotlin'
+}
apply plugin: 'org.jetbrains.kotlin.frontend'
apply plugin: "io.gitlab.arturbosch.detekt"
+apply plugin: 'org.jetbrains.dokka'
group = 'pl.treksoft'
version = '0.0.1'
@@ -35,8 +43,13 @@ repositories {
}
dependencies {
- compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
- compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" // for now only compile configuration is supported
+ if (!project.gradle.startParameter.taskNames.contains("dokka")) {
+ compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
+ compile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version" // for now only compile configuration is supported
+ } else {
+ compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ compile "org.jetbrains.kotlin:kotlin-test:$kotlin_version" // for now only compile configuration is supported
+ }
compile "com.github.snabbdom:snabbdom-kotlin:0.1.1"
compile "pl.treksoft:navigo-kotlin:0.0.2"
compile "pl.treksoft:jquery-kotlin:0.0.3"
@@ -62,16 +75,16 @@ kotlinFrontend {
}
task cleanLibs(type: Delete) {
- delete 'build/js', 'build/libs'
+ delete 'build/js', 'build/libs'
}
-if (project.gradle.startParameter.taskNames.contains("jar")){
+if (project.gradle.startParameter.taskNames.contains("jar")) {
compileKotlin2Js.dependsOn 'cleanLibs'
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
- excludes = [ "package.json" ]
+ excludes = ["package.json"]
}
task sourcesJar(type: Jar, dependsOn: classes) {
@@ -88,18 +101,30 @@ detekt {
}
}
-compileKotlin2Js {
- kotlinOptions.metaInfo = true
- kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js"
- kotlinOptions.sourceMap = !production
- kotlinOptions.moduleKind = 'commonjs'
+dokka {
+ includes = ['Module.md']
+ classpath = [new File("dokka/kvision-dokka-helper.jar")]
+ outputFormat = 'html'
+ outputDirectory = "$buildDir/kdoc"
+ impliedPlatforms = ["JS"]
}
-compileTestKotlin2Js {
- kotlinOptions.metaInfo = true
- kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js"
- kotlinOptions.sourceMap = !production
- kotlinOptions.moduleKind = 'commonjs'
+if (!project.gradle.startParameter.taskNames.contains("dokka")) {
+
+ compileKotlin2Js {
+ kotlinOptions.metaInfo = true
+ kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js"
+ kotlinOptions.sourceMap = !production
+ kotlinOptions.moduleKind = 'commonjs'
+ }
+
+ compileTestKotlin2Js {
+ kotlinOptions.metaInfo = true
+ kotlinOptions.outputFile = "$project.buildDir.path/js-tests/${project.name}-tests.js"
+ kotlinOptions.sourceMap = !production
+ kotlinOptions.moduleKind = 'commonjs'
+ }
+
}
task copyResources(type: Copy) {
@@ -112,9 +137,11 @@ task copyResourcesForTests(type: Copy) {
into file(buildDir.path + "/js-tests/")
}
-afterEvaluate {
- tasks.getByName("webpack-bundle") { dependsOn(copyResources) }
- tasks.getByName("webpack-run") { dependsOn(copyResources, copyResourcesForTests) }
+if (!project.gradle.startParameter.taskNames.contains("dokka")) {
+ afterEvaluate {
+ tasks.getByName("webpack-bundle") { dependsOn(copyResources) }
+ tasks.getByName("webpack-run") { dependsOn(copyResources, copyResourcesForTests) }
+ }
}
publishing {
@@ -148,7 +175,7 @@ bintray {
vcsUrl = "https://github.com/rjaros/${project.name}.git"
version {
name = "${project.version}"
- desc = 'Object oriented Web UI framework for Kotlin.'
+ desc = 'Object oriented Web UI framework for Kotlin/JS'
released = new Date()
}
}
diff --git a/dokka/kvision-dokka-helper.jar b/dokka/kvision-dokka-helper.jar
new file mode 100644
index 00000000..752a1311
--- /dev/null
+++ b/dokka/kvision-dokka-helper.jar
Binary files differ
diff --git a/examples/helloworld/.gitignore b/examples/helloworld/.gitignore
deleted file mode 100644
index 631a8b87..00000000
--- a/examples/helloworld/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.*/
-build/
-out/
-*.iml
-/refresh.sh
diff --git a/examples/helloworld/build.gradle b/examples/helloworld/build.gradle
deleted file mode 100644
index 8ffec081..00000000
--- a/examples/helloworld/build.gradle
+++ /dev/null
@@ -1,92 +0,0 @@
-buildscript {
- ext.kotlin_version = '1.2.21'
- ext.production = (findProperty('prod') ?: 'false') == 'true'
- ext.npmdeps = new URL("file:///home/rjaros/git/kvision/npm.dependencies").getText()
-
- repositories {
- jcenter()
- maven { url 'https://dl.bintray.