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

support wasmJS target #376

Open
wants to merge 2 commits into
base: main-3.3.0-alpha02
Choose a base branch
from

Conversation

ahna92
Copy link

@ahna92 ahna92 commented Dec 25, 2024

Closes

#232

Changes

  • add wasmJs support
  • I had to change jvm toolchain to 17 for local development and publish, if pipeline can pass with 11 only I can try downgrade back (ladybug comes with java 21)

Snapshot

Can check published version 3.3.0-alpha02-0.6.0-wasm.1

make sure to add maven repo

// settings.build.kts add to both pluginManagement and dependencyResolutionManagement

maven {
    url = uri("https://maven.pkg.github.com/edna-aa/sqldelight")
    credentials {
        username = "<username>"
        password = "<pat-with-read-packages>"
    }
    // Restrict this repository to specific versions containing "-wasm"
    content {
        includeGroup("app.cash.sqldelight") // Restrict to the group
        includeGroup("app.cash.paging") // Restrict to the group
        includeVersionByRegex("app.cash.sqldelight", ".*", ".*-wasm.*") // Match any artifact in the group with versions containing "-wasm"
        includeVersionByRegex("app.cash.paging", ".*", ".*-wasm.*") // Match any artifact in the group with versions containing "-wasm"
    }
}

Tested on a personal project working fine so far

@wongislandd
Copy link

Hi, the instructions listed to pull in this package don't seem to be working for me. I may be doing it wrong, does
https://maven.pkg.github.com/edna-aa/sqldelight host both the paging and sqldelight package?

And is the username and password for credentials my github username/personal-access-token?

@ahna92
Copy link
Author

ahna92 commented Jan 16, 2025

hi @wongislandd
yeah it has both , can check them here too

for token generation can check docs

@wongislandd
Copy link

hmm does this setup look right? I'm getting this error when trying to pull the dependency. Sorry if these are noob questions haha, haven't really pulled from other package repositories before

Error:

Cause 1: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find app.cash.paging:paging-compose-common:3.3.0-alpha02-0.6.0-wasm.1.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/app/cash/paging/paging-compose-common/3.3.0-alpha02-0.6.0-wasm.1/paging-compose-common-3.3.0-alpha02-0.6.0-wasm.1.pom
Required by:
    project :composeApp
Cause 2: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find app.cash.paging:paging-common:3.3.0-alpha02-0.6.0-wasm.1.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/app/cash/paging/paging-common/3.3.0-alpha02-0.6.0-wasm.1/paging-common-3.3.0-alpha02-0.6.0-wasm.1.pom
Required by:
    project :composeApp

In settings.gradle.kts

pluginManagement {
    repositories {
        google {
            mavenContent {
                includeGroupAndSubgroups("androidx")
                includeGroupAndSubgroups("com.android")
                includeGroupAndSubgroups("com.google")
            }
        }
        mavenCentral()
        gradlePluginPortal()
        maven {
            url = uri("https://maven.pkg.github.com/edna-aa/sqldelight")
            credentials {
                username = "wongislandd"
                password = "ghp_<MY_PAT>"
            }
            // Restrict this repository to specific versions containing "-wasm"
            content {
                includeGroup("app.cash.sqldelight") // Restrict to the group
                includeGroup("app.cash.paging") // Restrict to the group
                includeVersionByRegex("app.cash.sqldelight", ".*", ".*-wasm.*") // Match any artifact in the group with versions containing "-wasm"
                includeVersionByRegex("app.cash.paging", ".*", ".*-wasm.*") // Match any artifact in the group with versions containing "-wasm"
            }
        }
    }
}

In libs.versions.toml

[versions]
paging3="3.3.0-alpha02-0.6.0-wasm.1"

[libraries]
paging-compose-common = { module = "app.cash.paging:paging-compose-common", version.ref = "paging3" }
paging-common = { module = "app.cash.paging:paging-common", version.ref = "paging3" }

@ahna92
Copy link
Author

ahna92 commented Jan 16, 2025

@wongislandd

Add to both pluginManagement and dependencyResolutionManagement

pluginManagement {
    repositories {
        maven {  }
    }
}

dependencyResolutionManagement {
    repositories {
        maven {  }
    }
   
}

@wongislandd
Copy link

Ah yup that did the trick! Thank you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants