-
Notifications
You must be signed in to change notification settings - Fork 13
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
Bump Three from v1.120 to v1.168 #617
Merged
Merged
Conversation
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
Rebuilt kotlin stubs using hacked dukat with this diff from d50b9be9: ``` diff --git a/model-lowerings-common/src/org/jetbrains/dukat/model/commonLowerings/ModelContext.kt b/model-lowerings-common/src/org/jetbrains/dukat/model/commonLowerings/ModelContext.kt index 3adb0077..4925f68c 100644 --- a/model-lowerings-common/src/org/jetbrains/dukat/model/commonLowerings/ModelContext.kt +++ b/model-lowerings-common/src/org/jetbrains/dukat/model/commonLowerings/ModelContext.kt @@ -155,7 +155,14 @@ class ModelContext(sourceSetModel: SourceSetModel) { fun getAllParents(classLikeModel: ClassLikeModel): List<ResolvedClassLike<out ClassLikeModel>> { val immediateParents = getParents(classLikeModel) - return immediateParents + immediateParents.flatMap { immediateParent -> getAllParents(immediateParent.classLike) } + return immediateParents + immediateParents.flatMap { immediateParent -> + if (immediateParent.classLike == classLikeModel) { + println("circular dependency detected: ${classLikeModel.name}") + emptyList() + } else { + getAllParents(immediateParent.classLike) + } + } } fun getClassLikeIterable(): Iterable<ClassLikeModel> { diff --git a/translator-string/src/org/jetbrains/dukat/translatorString/translators.kt b/translator-string/src/org/jetbrains/dukat/translatorString/translators.kt index c6714c69..a28def9f 100644 --- a/translator-string/src/org/jetbrains/dukat/translatorString/translators.kt +++ b/translator-string/src/org/jetbrains/dukat/translatorString/translators.kt @@ -182,11 +182,11 @@ fun compileUnits(translatedUnits: List<TranslationUnitResult>, outDir: String): translatedUnits.forEach { translationUnitResult -> if (translationUnitResult is ModuleTranslationUnit) { - val targetName = "${translationUnitResult.name}.kt" + val targetName = "${File(translationUnitResult.fileName).namSe}.kt" val resolvedTarget = dirFile.resolve(targetName) - println(resolvedTarget.name) + println(resolvedTarget.absoluteFile.name) output.add(resolvedTarget.name) diff --git a/typescript/ts-translator/src/org/jetbrains/dukat/ts/translator/TypescriptLowerer.kt b/typescript/ts-translator/src/org/jetbrains/dukat/ts/translator/TypescriptLowerer.kt index a4506065..603ee996 100644 --- a/typescript/ts-translator/src/org/jetbrains/dukat/ts/translator/TypescriptLowerer.kt +++ b/typescript/ts-translator/src/org/jetbrains/dukat/ts/translator/TypescriptLowerer.kt @@ -47,9 +47,32 @@ import org.jetbrains.dukat.tsLowerings.ResolveTypeAliases import org.jetbrains.dukat.tsLowerings.ResolveTypescriptUtilityTypes import org.jetbrains.dukat.tsLowerings.SpecifyUnionType import org.jetbrains.dukat.tsLowerings.CollectKotlinStdlibCollision +import org.jetbrains.dukat.tsLowerings.TsLowering import org.jetbrains.dukat.tsLowerings.lower +import org.jetbrains.dukat.tsmodel.ModuleDeclaration +import org.jetbrains.dukat.tsmodel.SourceFileDeclaration import org.jetbrains.dukat.tsmodel.SourceSetDeclaration +private fun ModuleDeclaration.addPackageName(packageName: NameEntity): ModuleDeclaration { + return copy(name = packageName.toString()) +} + +private fun SourceFileDeclaration.addPackageName(packageName: NameEntity): SourceFileDeclaration { + return copy(root = root.addPackageName(packageName)) +} + +private fun SourceSetDeclaration.addPackageName(packageName: NameEntity?): SourceSetDeclaration { + return packageName?.let { packageNameResolved -> + copy(sources = sources.map { it.addPackageName(packageNameResolved) }) + } ?: this +} + +class AddPackageName(private val packageName: NameEntity?): TsLowering { + override fun lower(source: SourceSetDeclaration): SourceSetDeclaration { + return source.addPackageName(packageName) + } +} + open class TypescriptLowerer( private val moduleNameResolver: ModuleNameResolver, private val packageName: NameEntity?, @@ -61,6 +84,7 @@ open class TypescriptLowerer( override fun lower(sourceSet: SourceSetDeclaration): SourceSetModel { val declarations = sourceSet .lower( + AddPackageName(packageName), ReplaceExpressionExtension(), RemoveConstructSignature(), IntroduceMissingConstructors(), ``` --- ... and these files copied into /command-line: ``` command-line/d.ts.libs/lib.d.ts command-line/resources/stdlib.dukat command-line/runtime/kotlin-stdlib-js.jar ``` ... then `./gradlew node-package:npmPublish --dry-run` (which fails at the very end; ignore) ... then `node ./node-package/build/distrib/bin/dukat-cli.js -p three.js -m three -d _DIR_/src/jsMain/kotlin/three _DIR_/build/js/node_modules/@types/three/index.d.ts ... then `cd _DIR_ && for file in *; do mv "$file" "${file//d\.ts/module_three}"; done` Good luck reproducing!
…tead of Numbers, etc.
* Move wrappers into new gradle project. * Some refactoring of JsMapper and SwirlyPixelArranger.
xian
pushed a commit
that referenced
this pull request
Sep 12, 2024
Bump Three from v1.120 to v1.168
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.