multiplatform-paging icon indicating copy to clipboard operation
multiplatform-paging copied to clipboard

support wasmJS target

Open ahna92 opened this issue 1 year ago • 5 comments

Closes

https://github.com/cashapp/multiplatform-paging/issues/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

ahna92 avatar Dec 25 '24 07:12 ahna92

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?

wongislandd avatar Jan 16 '25 03:01 wongislandd

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

for token generation can check docs

ahna92 avatar Jan 16 '25 03:01 ahna92

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" }

wongislandd avatar Jan 16 '25 03:01 wongislandd

@wongislandd

Add to both pluginManagement and dependencyResolutionManagement

pluginManagement {
    repositories {
        maven {  }
    }
}

dependencyResolutionManagement {
    repositories {
        maven {  }
    }
   
}

ahna92 avatar Jan 16 '25 03:01 ahna92

Ah yup that did the trick! Thank you 😄

wongislandd avatar Jan 16 '25 14:01 wongislandd