Fix examples, templates (#2359)

- move screenshot into screenshots folder
- add Readme, run configuration, .gitignore to web-template
- fix web-compose-in-js (read versions from properties)
- add global idea/ into gitignore
This commit is contained in:
Igor Demin
2022-10-05 13:44:37 +02:00
committed by GitHub
parent 521e29d687
commit 7bd0b3d1a5
40 changed files with 69 additions and 27 deletions

8
.gitignore vendored
View File

@@ -4,13 +4,7 @@ out
*.iml
.gradle
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.idea/
.DS_Store
build/
/captures

View File

@@ -4,7 +4,7 @@ MPP Code Viewer example for desktop/android written in Multiplatform Compose lib
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
### Building native desktop distribution
```

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -3,5 +3,5 @@ Falling Balls game
### Running desktop application
* To run, launch command: `./gradlew run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -3,7 +3,7 @@ An example of image gallery for remote server image viewing, based on Jetpack Co
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
### Building native desktop distribution
```

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -12,7 +12,7 @@ and allows sharing Compose runtime between multiple plugins
1. Start test IDE:
* Run the following command in terminal: `./gradlew runIde`
* Or choose **runIde** configuration in IDE and run it.
![ide-run-configuration.png](ide-run-configuration.png)
![ide-run-configuration.png](screenshots/ide-run-configuration.png)
2. Create a new project or open any existing;
3. Select `Show Compose Demo...` from the `Tools` menu.

View File

@@ -5,7 +5,7 @@ To run the example:
1. from directory `compose-jb/examples/intellij-plugin`:
* Run command in terminal `./gradlew runIde`.
* Or choose **runIde** configuration in IDE and run it.
![ide-run-configuration.png](ide-run-configuration.png)
![ide-run-configuration.png](screenshots/ide-run-configuration.png)
2. create project or open any existing
3. from menu `Tools` select `Show Compose Demo...`

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -4,7 +4,7 @@ Github Issues viewer example written in Jetpack Compose UI library.
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
### Building native desktop distribution
```

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -3,7 +3,7 @@ Notepad example for desktop written in Compose for Desktop library, using Compos
### Running desktop application
* To run, launch command: `./gradlew run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
### Building native desktop distribution
```

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -5,7 +5,7 @@ Supported targets: Android and Desktop.
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
### Building native desktop distribution
```

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -36,7 +36,7 @@ Features:
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
#### Building native desktop distribution
```
@@ -51,7 +51,7 @@ Open project in Intellij IDEA or Android Studio and run "android" configuration.
### Running Web browser application
* To run, launch command: `./gradlew :web:jsBrowserDevelopmentRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)
### Running iOS application

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -3,5 +3,5 @@ Several visual effects implmented with Compose Multiplatform, used in 1.0 releas
### Running desktop application
* To run, launch command: `./gradlew run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1,6 +1,6 @@
# 🐦 Compose Bird
![](demo.gif)
![](screenshots/demo.gif)
![latestVersion](https://img.shields.io/github/v/release/theapache64/compose-bird)
<a href="https://twitter.com/theapache64" target="_blank">
@@ -18,7 +18,7 @@
* To run, launch command: `./gradlew jsBrowserRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)
## 📦 Distribute

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@@ -70,7 +70,7 @@ config.output.library = "MyComposables";
### Running Web browser application
* To run, launch command: `./gradlew :jsBrowserDevelopmentRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)
### Building and using the output

View File

@@ -1,8 +1,8 @@
import org.jetbrains.compose.compose
plugins {
kotlin("multiplatform") version "1.6.10"
id("org.jetbrains.compose") version "1.0.1"
kotlin("multiplatform")
id("org.jetbrains.compose")
}
group = "me.user"

View File

@@ -2,3 +2,5 @@ kotlin.code.style=official
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.js.webpack.major.version=4
kotlin.version=1.7.10
compose.version=1.2.0-beta02

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -3,7 +3,11 @@ pluginManagement {
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
rootProject.name = "web-compose-in-js"

View File

@@ -3,4 +3,4 @@ Landing page of Compose for Web
### Running Web browser application
* To run, launch command: `./gradlew :jsBrowserRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -21,4 +21,4 @@ Here is a good tutorial - [Using packages from NPM](https://play.kotlinlang.org/
### Running web application
* To run, launch command: `./gradlew :jsBrowserRun`
* Or choose **browser** configuration in IDE and run it.
![browser-run-configuration.png](browser-run-configuration.png)
![browser-run-configuration.png](screenshots/browser-run-configuration.png)

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -11,7 +11,7 @@ demonstrating how to use various Material widgets.
### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](desktop-run-configuration.png)
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
### Building native desktop distribution
```

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

15
templates/web-template/.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
build/
/captures
.externalNativeBuild
.cxx

View File

@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="browser" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":jsBrowserRun" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -0,0 +1,4 @@
Compose Web Application
- `./gradlew jsBrowserRun` - run application in a browser
- `./gradlew jsBrowserProductionWebpack` - produce the output in `build/distributions`