-
Notifications
You must be signed in to change notification settings - Fork 1
Add comprehensive .github/copilot-instructions.md for repository onboarding #62
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
Merged
ShreckYe
merged 13 commits into
dev
from
copilot/fix-1e12ff10-bb36-42db-8915-7914dc2c7a25
Sep 29, 2025
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
eafafa1
Initial plan
Copilot 55f4924
Add comprehensive .github/copilot-instructions.md for repository onbo…
Copilot d8fc4f8
Merge branch 'dev' into copilot/fix-1e12ff10-bb36-42db-8915-7914dc2c7a25
ShreckYe dbdd173
Update .github/copilot-instructions.md with latest dependency version…
Copilot 8bedebe
Merge branch 'dev' into copilot/fix-1e12ff10-bb36-42db-8915-7914dc2c7a25
ShreckYe b745de0
Update `copilot-instructions.md` correspondingly
ShreckYe 1fb222d
Clean up copilot instructions: remove comment-only code block and red…
Copilot d8557f6
Enhance .github/copilot-instructions.md with patterns from kotlin-com…
Copilot d805058
Remove redundant "Essential Repository Setup" section
Copilot 898b6c7
Fix offline build statements and remove inappropriate tool_calling se…
Copilot 25220db
Address feedback: fix technical inaccuracies and remove version-speci…
Copilot 65493fe
Refocus publishToMavenLocal guidance for coding agents rather than hu…
Copilot 851bbcb
Prioritize ./gradlew build over publishToMavenLocal in build validation
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,188 @@ | ||
| # Copilot Instructions for Compose Multiplatform HTML Unified | ||
|
|
||
| ## Repository Overview | ||
|
|
||
| **Compose Multiplatform HTML Unified** is a Kotlin Multiplatform library that provides unified Compose Multiplatform wrappers of common and Material Design APIs for both **rendering-based Compose UI** (Android, desktop JVM, iOS, web Kotlin/Wasm) and **DOM-based Compose HTML**. This library was previously named "Compose Multiplatform Material". | ||
|
|
||
| ### Repository Statistics | ||
| - **Size**: Medium-large multiplatform project with ~15 modules | ||
| - **Language**: Kotlin (multiplatform) | ||
| - **Build System**: Gradle with Kotlin DSL | ||
| - **Target Platforms**: JVM, Android, iOS, JS (DOM), Wasm-JS (Canvas) | ||
| - **Key Dependencies**: Compose Multiplatform, Kobweb Silk, Material Web Components | ||
| - **Current Version**: 0.6.0-SNAPSHOT | ||
|
|
||
| ## Build Instructions and Environment Setup | ||
|
|
||
| ### Prerequisites | ||
| - **JDK 17**: Required (as specified in GitHub Actions workflows) | ||
| - **Network Access**: Required for initial builds to download Android Gradle Plugin and Kobweb dependencies | ||
| - **Gradle 9.1.0**: Automatically handled by wrapper | ||
|
|
||
| ### Essential Repository Setup | ||
|
|
||
| No special repository setup is required - all dependencies are available from standard repositories (mavenCentral, google). | ||
|
|
||
| ### Build Commands (In Order) | ||
|
|
||
| #### 1. Basic Project Setup | ||
| ```bash | ||
| ./gradlew --version # Verify Gradle 9.1.0 and JDK 17 | ||
| ``` | ||
|
|
||
| #### 2. Publishing to Local Maven (Primary Development Command) | ||
| ```bash | ||
| ./gradlew publishToMavenLocal | ||
| ``` | ||
| **Important**: Always run `publishToMavenLocal` first when making changes, as mentioned in CONTRIBUTING.md. This publishes libraries to your local Maven repository so dependent projects can use your changes. | ||
ShreckYe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| #### 3. Running Tests and Checks | ||
| ```bash | ||
| ./gradlew check | ||
| ``` | ||
| **Note**: The project has "limited number of tests" according to CONTRIBUTING.md, but this validates what exists. | ||
|
|
||
| #### 4. Building Demo Applications | ||
| ```bash | ||
| # Build the side-by-side demo (used for GitHub Pages) | ||
| ./gradlew :compose-multiplatform-html-unified-demo:sideBySideBrowserDistribution | ||
|
|
||
| # Individual platform builds | ||
| ./gradlew jsBrowserDistribution # JS DOM version | ||
| ./gradlew wasmJsBrowserDistribution # Wasm-JS Canvas version | ||
| ``` | ||
|
|
||
| ### Build Configuration Details | ||
|
|
||
| #### Memory Requirements | ||
| - **Gradle JVM**: 2GB memory allocated via `org.gradle.jvmargs=-Xmx2G` in gradle.properties (required for Wasm compilation) | ||
|
|
||
| #### Common Build Issues and Workarounds | ||
|
|
||
| 1. **Network Connectivity**: Initial builds require internet access for Android Gradle Plugin (8.11.2) and other dependencies. If build fails with network errors, ensure internet connectivity. | ||
|
|
||
| 2. **Memory Issues**: If Wasm compilation fails with OOM, the memory is already optimized in gradle.properties. | ||
|
|
||
| 3. **Kotlin/JS Store**: The `kotlin-js-store` directory may be generated during JS builds - this should not be committed. | ||
ShreckYe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 4. **Gradle Daemon**: May timeout on first runs. Use `--no-daemon` flag if needed: `./gradlew check --no-daemon` | ||
|
|
||
| ## Project Architecture and Layout | ||
|
|
||
| ### Module Structure | ||
| ``` | ||
| ├── common/ # Core APIs, layouts, modifiers (foundation equivalent) | ||
| ├── material-icons-core/ # Icon system core | ||
| ├── material2/ # Material Design 2 components | ||
| ├── material3/ # Material Design 3 components | ||
| ├── navigation/ # Navigation support (experimental) | ||
| ├── lifecycle-viewmodel/ # ViewModel support (experimental) | ||
| ├── demo/ # Demonstration application | ||
| └── buildSrc/ # Build configuration and dependencies | ||
| ``` | ||
|
|
||
| ### Key Configuration Files | ||
| - **buildSrc/src/main/kotlin/VersionsAndDependencies.kt**: All dependency versions | ||
| - **buildSrc/src/main/kotlin/common-conventions.gradle.kts**: Shared build configuration | ||
| - **buildSrc/src/main/kotlin/lib-conventions.gradle.kts**: Library-specific configuration | ||
| - **gradle.properties**: JVM memory settings and Kotlin MPP configuration | ||
ShreckYe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - **settings.gradle.kts**: Project structure and repository configuration | ||
|
|
||
| ### Source Set Structure (Per Module) | ||
| ``` | ||
| src/ | ||
| ├── commonMain/ # Shared APIs across all platforms | ||
| ├── composeUiMain/ # Compose UI targets (JVM, Android, iOS, Wasm) | ||
| ├── composeUiExceptAndroidMain/ # Compose UI excluding Android | ||
| ├── androidMain/ # Android-specific implementations | ||
| ├── jsMain/ # JS DOM implementations (Kobweb/HTML) | ||
| ├── jvmMain/ # Desktop JVM implementations | ||
| └── iosMain/ # iOS-specific implementations | ||
| ``` | ||
|
|
||
| ### CI/CD Workflows | ||
|
|
||
| #### `.github/workflows/ci.yml` | ||
| - **Trigger**: Push to any branch, manual dispatch | ||
| - **Platforms**: ubuntu-latest, macos-latest, windows-latest | ||
| - **JDK**: 17-temurin | ||
| - **Commands**: Uses `huanshankeji/.github/actions/[email protected]` | ||
|
|
||
| #### `.github/workflows/demo-gh-pages.yml` | ||
| - **Trigger**: Push/PR to `release` branch, manual dispatch | ||
| - **Platform**: ubuntu-latest | ||
| - **Purpose**: Builds and deploys demo to GitHub Pages | ||
| - **Build Command**: `./gradlew :compose-multiplatform-html-unified-demo:sideBySideBrowserDistribution` | ||
| - **Artifact Path**: `demo/build/dist/sideBySide/productionExecutable/` | ||
ShreckYe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Dependencies and External Integration | ||
|
|
||
| #### Required External Repositories | ||
| ```kotlin | ||
| repositories { | ||
| mavenCentral() | ||
| google() // For Android components | ||
| } | ||
| ``` | ||
|
|
||
| #### Key Dependencies | ||
| - **Kotlin**: 2.2.20 with Compose Compiler | ||
| - **Compose Multiplatform**: 1.9.0 | ||
| - **Android Gradle Plugin**: 8.11.2 | ||
| - **Kobweb**: 0.23.3 (now on Maven Central) | ||
| - **Compose HTML Material**: 0.4.1-SNAPSHOT | ||
| - **Binary Compatibility Validator**: 0.18.1 (enabled) | ||
|
|
||
| ### Platform-Specific Implementation Patterns | ||
|
|
||
| #### Compose UI Platforms (Android, JVM, iOS, Wasm) | ||
| - Delegate directly to official `androidx.compose` APIs | ||
| - Located in `composeUiMain` source sets | ||
|
|
||
| #### JS DOM Platform | ||
| - Built on **Kobweb Silk** (provides Modifier system and layouts) | ||
| - Uses **Material Web Components** via Compose HTML Material | ||
| - Located in `jsMain` source sets | ||
| - Requires CSS imports for Material Icons | ||
|
|
||
| ### Development Patterns and Conventions | ||
|
|
||
| #### API Structure | ||
| - **Common APIs**: Defined in `commonMain`, expect/actual pattern for platform differences | ||
| - **Ext Components**: Components in `ext` packages don't follow androidx.compose APIs exactly but provide more idiomatic platform-specific wrappers | ||
| - **Parameter Naming**: Parameters with "JsDom" or "ComposeUi" suffixes are platform-specific | ||
|
|
||
| #### Code Quality and Validation | ||
| - **Binary Compatibility**: Enforced via kotlinx.validation plugin | ||
ShreckYe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - **Code Style**: IntelliJ IDEA Code Cleanup and Reformat Code applied project-wide | ||
ShreckYe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - **Limited Testing**: Project acknowledges "limited number of tests" | ||
|
|
||
| ### Root Directory Files | ||
| ``` | ||
| .gitignore # Standard exclusions plus .kotlin, local.properties | ||
| build.gradle.kts # Root build file with binary compatibility validator | ||
| CHANGELOG.md # Detailed version history with breaking changes | ||
| CODE_OF_CONDUCT.md # Standard code of conduct | ||
| CONTRIBUTING.md # Development guidelines and contribution process | ||
| gradle.properties # Memory settings and Kotlin configuration | ||
| LEGACY_README.md # Previous project name reference | ||
| LICENSE # Apache 2.0 license | ||
| README.md # Comprehensive API documentation and usage guide | ||
| settings.gradle.kts # Project structure and dependency management | ||
| ``` | ||
|
|
||
| ## Validation Steps for Changes | ||
|
|
||
| 1. **Build Validation**: Run `./gradlew publishToMavenLocal` to ensure libraries compile | ||
ShreckYe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 2. **Test Validation**: Run `./gradlew check` to validate existing tests pass | ||
| 3. **Demo Validation**: Build demo with `./gradlew :compose-multiplatform-html-unified-demo:sideBySideBrowserDistribution` | ||
| 4. **CI Simulation**: Test on multiple platforms if possible (the CI runs on Ubuntu, macOS, Windows) | ||
| 5. **Binary Compatibility**: The kotlinx binary compatibility validator will catch API breaks | ||
|
|
||
| ## Important Notes for Agents | ||
|
|
||
| - **Trust These Instructions**: Only perform additional searches if information here is incomplete or incorrect | ||
| - **Network Dependency**: Initial builds require internet access - cannot work in fully offline environments | ||
| - **Memory Requirements**: Ensure adequate memory for Wasm compilation (2GB JVM heap configured) | ||
| - **Limited Test Coverage**: Don't expect comprehensive test suites - focus on build and demo validation | ||
| - **Platform Complexity**: This is a sophisticated multiplatform project with 6+ target platforms and complex expect/actual patterns | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.