Skip to content

Commit 378f229

Browse files
committed
Node 24.3.1
1 parent 1b1ca56 commit 378f229

File tree

10 files changed

+93
-42
lines changed

10 files changed

+93
-42
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ kotlinx-html.version=0.12.0
2222
kotlinx-coroutines.version=1.10.2
2323

2424
# https://github.com/karakum-team/karakum/releases
25-
karakum.version=1.0.0-alpha.74
25+
karakum.version=1.0.0-alpha.76
2626

2727
# https://github.com/arrow-kt/arrow/releases
2828
arrow-kt.version=2.0.1
@@ -112,7 +112,7 @@ muix-date-pickers.npm.version=7.28.0
112112
muix-tree-view.npm.version=7.28.0
113113

114114
# https://www.npmjs.com/package/@types/node
115-
node.npm.version=^24.3.0
115+
node.npm.version=^24.3.1
116116

117117
# https://www.npmjs.com/package/null-writable
118118
null-writable.npm.version=^2.0.1

kotlin-electron/karakum/kotlin-js-store/package-lock.json

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kotlin-node/karakum/kotlin-js-store/package-lock.json

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kotlin-node/karakum/src/jsMain/kotlin/node/karakum/Main.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ suspend fun main() {
165165
input = manyOf("$nodePackage/**/*.d.ts")
166166
ignoreInput = manyOf(
167167
"$nodePackage/ts*/**",
168+
"$nodePackage/web-globals/**",
168169
"$nodePackage/assert/strict.d.ts",
169170
"$nodePackage/constants.d.ts",
170171
"$nodePackage/compatibility/disposable.d.ts",
@@ -196,6 +197,7 @@ suspend fun main() {
196197
"**/_ResponseInit.kt",
197198
"**/_Storage.kt",
198199
"**/_WebSocket.kt",
200+
"**/ErrorConstructor.kt",
199201
"**/NodeDOMException.kt",
200202
"**/NodeDOMExceptionConstructor.kt",
201203
"**/Dict.kt",
@@ -246,6 +248,7 @@ suspend fun main() {
246248
"**/buffer/ImplicitArrayBuffer.kt",
247249
"**/childProcess/exec/**",
248250
"**/childProcess/execfile/**",
251+
"**/console/console.kt",
249252
"**/crypto/generatekeypair/**",
250253
"**/crypto/global/**",
251254
"**/crypto/webcrypto/**",
@@ -272,6 +275,7 @@ suspend fun main() {
272275
"**/events/Listener.kt",
273276
"**/events/Listener1.kt",
274277
"**/events/Listener2.kt",
278+
"**/global/global.kt",
275279
"**/http/WebSocket.kt",
276280
"**/http/CloseEvent.kt",
277281
"**/http/MessageEvent.kt",
@@ -334,6 +338,7 @@ suspend fun main() {
334338
"node:node/" to "node:",
335339
"node:node:" to "node:",
336340
"node:assert(#assert)?" to "node:assert/strict",
341+
"node:globals" to "",
337342
"events#EventEmitter" to "events",
338343
"module#Module" to "module",
339344
)
@@ -486,7 +491,8 @@ suspend fun main() {
486491
"^node/([^/]+)\\.kt" to "node/$1/$1.kt",
487492
"^node/stream/consumers.kt" to "node/stream/consumers/consumers.kt",
488493
"^node/globals/globals.kt" to "node/globals.kt",
489-
"^global/nodejs" to "node"
494+
"^node/gc/gc.kt" to "node/gc.kt",
495+
"^nodejs" to "node"
490496
)
491497
importMapper = recordOf(
492498
"node:async_hooks" to ruleOf("node.asyncHooks"),

kotlin-node/karakum/src/jsMain/kotlin/node/karakum/plugins/convertTopLevelGlobals.kt

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,33 @@ package node.karakum.plugins
22

33
import arrow.core.raise.nullable
44
import io.github.sgrishchenko.karakum.extension.createPlugin
5-
import io.github.sgrishchenko.karakum.util.getParentOrNull
65
import io.github.sgrishchenko.karakum.util.getSourceFileOrNull
7-
import typescript.Node
86
import typescript.isIdentifier
9-
import typescript.isModuleDeclaration
10-
import typescript.isSourceFile
7+
import typescript.isInterfaceDeclaration
8+
import typescript.isVariableDeclaration
119

12-
// TODO: consider removing
13-
val convertTopLevelGlobals = createPlugin { node, context, render ->
10+
val convertTopLevelGlobals = createPlugin { node, _, _ ->
1411
nullable {
1512
val sourceFileName = ensureNotNull(node.getSourceFileOrNull()).fileName
1613
ensure(sourceFileName.endsWith("globals.d.ts"))
1714

18-
val sourceFile = ensureNotNull(node.getParentOrNull())
19-
ensure(isSourceFile(sourceFile))
15+
nullable {
16+
ensure(isInterfaceDeclaration(node))
17+
ensure(node.name.text == "ErrorConstructor")
2018

21-
ensure(!isNodeJsModuleDeclaration(node))
19+
""
20+
} ?: nullable {
21+
ensure(isVariableDeclaration(node))
2222

23-
""
23+
val name = node.name
24+
ensure(isIdentifier(name))
25+
ensure(
26+
name.text == "global"
27+
|| name.text == "process"
28+
|| name.text == "console"
29+
)
30+
31+
""
32+
}
2433
}
2534
}
26-
27-
private fun isNodeJsModuleDeclaration(node: Node): Boolean = nullable {
28-
ensure(isModuleDeclaration(node))
29-
30-
val identifier = node.name
31-
ensure(isIdentifier(identifier))
32-
ensure(identifier.text == "NodeJS")
33-
} != null
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Generated by Karakum - do not modify it manually!
2+
3+
package node
4+
5+
external var gc: GCFunction?
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
// Generated by Karakum - do not modify it manually!
22

3-
@file:JsModule("node:globals")
4-
53
package node
6-
7-
// Make this a module
8-
9-
// #endregion DOMException

kotlin-null-writable/karakum/kotlin-js-store/package-lock.json

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kotlin-semver/karakum/kotlin-js-store/package-lock.json

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kotlin-typescript/karakum/kotlin-js-store/package-lock.json

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)