-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/native
# Conflicts: # .github/workflows/deployment-ci.yml # .github/workflows/docs-ci.yml # .github/workflows/gradle-wrapper-validation.yml # buildSrc/src/main/kotlin/kord-multiplatform-module.gradle.kts # gradle/libs.versions.toml
- Loading branch information
Showing
12 changed files
with
40 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -14,6 +14,7 @@ kotlin { | |
jvm() | ||
js { | ||
nodejs() | ||
useCommonJs() | ||
} | ||
jvmToolchain(Jvm.target) | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
@file:JsModule("fast-zlib") | ||
@file:JsNonModule | ||
|
||
package dev.kord.gateway.internal | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,19 +1,11 @@ | ||
package dev.kord.test | ||
|
||
import io.ktor.utils.io.* | ||
import js.iterable.toList | ||
import node.buffer.Buffer | ||
import node.buffer.BufferEncoding | ||
import node.fs.readFile | ||
import node.process.process | ||
|
||
internal suspend fun nodeFile(project: String, path: String): String = | ||
node.fs.readFile("${process.env["PROJECT_ROOT"]}/$project/src/commonTest/resources/$path") | ||
.toString(BufferEncoding.utf8) | ||
readFile("${process.env["PROJECT_ROOT"]}/$project/src/commonTest/resources/$path", BufferEncoding.utf8) | ||
|
||
internal suspend fun nodeReadFile(project: String, path: String): ByteReadChannel { | ||
val buffer = node.fs.readFile("${process.env["PROJECT_ROOT"]}/$project/src/commonTest/resources/$path") | ||
|
||
return ByteReadChannel(buffer.toByteArray()) | ||
} | ||
|
||
private fun Buffer.toByteArray() = values().toList().toByteArray() | ||
internal suspend fun nodeReadFile(project: String, path: String) = ByteReadChannel(nodeFile(project, path)) |