{"id":25937100,"url":"https://github.com/nathanfallet/kotlin-js-fix","last_synced_at":"2026-04-09T16:02:37.739Z","repository":{"id":279875395,"uuid":"940280356","full_name":"nathanfallet/kotlin-js-fix","owner":"nathanfallet","description":"Allows to export Kotlin/JS interfaces to JavaScript, and use them in TypeScript without __doNotUseOrImplementIt","archived":false,"fork":false,"pushed_at":"2025-03-02T08:35:58.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T09:28:26.837Z","etag":null,"topics":["gradle-plugin","javascript","kotlin-js","typescript"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathanfallet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["nathanfallet"]}},"created_at":"2025-02-27T22:54:50.000Z","updated_at":"2025-03-02T08:35:36.000Z","dependencies_parsed_at":"2025-03-02T09:28:30.141Z","dependency_job_id":null,"html_url":"https://github.com/nathanfallet/kotlin-js-fix","commit_stats":null,"previous_names":["nathanfallet/kotlin-js-interface-fix","nathanfallet/kotlin-js-fix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanfallet%2Fkotlin-js-fix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanfallet%2Fkotlin-js-fix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanfallet%2Fkotlin-js-fix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanfallet%2Fkotlin-js-fix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanfallet","download_url":"https://codeload.github.com/nathanfallet/kotlin-js-fix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241773225,"owners_count":20018065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gradle-plugin","javascript","kotlin-js","typescript"],"created_at":"2025-03-04T02:56:08.921Z","updated_at":"2025-12-31T01:03:18.551Z","avatar_url":"https://github.com/nathanfallet.png","language":"Kotlin","funding_links":["https://github.com/sponsors/nathanfallet"],"categories":[],"sub_categories":[],"readme":"# kotlin-js-fix\n\n[![License](https://img.shields.io/github/license/nathanfallet/kotlin-js-fix)](LICENSE)\n[![Issues](https://img.shields.io/github/issues/nathanfallet/kotlin-js-fix)]()\n[![Pull Requests](https://img.shields.io/github/issues-pr/nathanfallet/kotlin-js-fix)]()\n[![Code Size](https://img.shields.io/github/languages/code-size/nathanfallet/kotlin-js-fix)]()\n\nA simple Gradle plugin to fix for Kotlin/JS compiler issues.\n\nIt allows to temporarily fix Kotlin/JS compiler, like export interfaces to JS and use them in TypeScript without __\ndoNotUseOrImplementIt.\n\nThe idea was to fix [KT-56618](https://youtrack.jetbrains.com/issue/KT-56618),\n[KT-75584](https://youtrack.jetbrains.com/issue/KT-75584) and [KT-75592](https://youtrack.jetbrains.com/issue/KT-75592)\neasily, without having to wait for JetBrains to fix it in the Compiler.\n\n## Add the plugin to your project\n\nSimply add the gradle plugin to your `build.gradle(.kts)`:\n\n```kotlin\nplugins {\n    id(\"me.nathanfallet.kotlinjsfix\") version \"1.0.1\"\n}\n```\n\nYou can optionally configure which feature of the plugin is enabled:\n\n```kotlin\nkotlinjsfix {\n    flattenCjsExports = false // Optional, default is false / Only for CommonJS\n    exportJsInterfaces = true // Optional, default is false\n    removeDoNotUseOrImplementIt = true // Optional, default is false\n}\n```\n\n## Example\n\nWe will show you what the plugin does with the following Kotlin/JS code:\n\n```kotlin\n@JsExport\ninterface MyInterface {\n    fun doSomething()\n}\n\n@JsExport\nclass MyClass : MyInterface {\n    override fun doSomething() {\n        println(\"Hello, world!\")\n    }\n}\n```\n\n### Without the plugin\n\nHere are the generated JavaScript and TypeScript code:\n\n```javascript\ninitMetadataForInterface(MyInterface, 'MyInterface');\ninitMetadataForClass(MyClass, 'MyClass', MyClass, VOID, [MyInterface]);\n\nfunction MyClass() {\n}\n\nprotoOf(MyClass).doSomething = function () {\n    println('Hello, world!');\n};\n\nfunction MyInterface() {\n}\n\nexport {\n    MyClass as MyClass,\n};\n```\n\n```typescript\ntype Nullable\u003cT\u003e = T | null | undefined\n\nexport declare class MyClass implements MyInterface {\n    constructor();\n\n    doSomething(): void;\n\n    readonly __doNotUseOrImplementIt: MyInterface[\"__doNotUseOrImplementIt\"];\n}\n\nexport declare interface MyInterface {\n    doSomething(): void;\n\n    readonly __doNotUseOrImplementIt: {\n        readonly \"me.nathanfallet.sample.MyInterface\": unique symbol;\n    };\n}\n```\n\nYou can see that in the JavaScript code, the `MyInterface` is not exported, and in the TypeScript code, the\n`__doNotUseOrImplementIt` is present.\n\n### With the plugin\n\n```javascript\ninitMetadataForInterface(MyInterface, 'MyInterface');\ninitMetadataForClass(MyClass, 'MyClass', MyClass, VOID, [MyInterface]);\n\nfunction MyClass() {\n}\n\nprotoOf(MyClass).doSomething = function () {\n    println('Hello, world!');\n};\n\nfunction MyInterface() {\n}\n\nexport {\n    MyClass as MyClass,\n    MyInterface as MyInterface,\n};\n```\n\n```typescript\ntype Nullable\u003cT\u003e = T | null | undefined\n\nexport declare class MyClass implements MyInterface {\n    constructor();\n\n    doSomething(): void;\n}\n\nexport declare interface MyInterface {\n    doSomething(): void;\n}\n```\n\nNow, the `MyInterface` is exported in the JavaScript code, and the `__doNotUseOrImplementIt` is removed from the\nTypeScript code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanfallet%2Fkotlin-js-fix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanfallet%2Fkotlin-js-fix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanfallet%2Fkotlin-js-fix/lists"}