:wave: Hello Kotlin Community! I’m excited to int...
# javascript
s
👋 Hello Kotlin Community! I’m excited to introduce my new Kotlin compiler plugin: Missing Annotations Therapist! 🎉 🚀 Why We Created It: We manage several large legacy Kotlin JS projects, and with Kotlin 1.9, classes aren’t exported by default. To streamline our workflow, we developed MissingAnnotationsTherapist to automate the addition of necessary annotations, ensuring seamless interoperability and export of classes. Example Usage: Given the following code:
Copy code
package com.project.common.dto

class LoginRequestDto(
  val etc: String
)
With the missing-annotations-therapist plugin configured as follows:
Copy code
configure<MissingAnnotationsTherapist> {
  annotations = listOf(
    Annotate(
      annotationsToAdd = listOf(Annotation(fqName = "kotlin.js.JsExport")),
      packageTarget = listOf(PackageTarget(pattern = "com.project.common.dto")),
      classTargets = listOf(ClassTypeTarget.REGULAR_CLASS),
      sourceSets = listOf("commonMain", "jsMain"),
    ),
  )
}
The transformed code will include the specified annotation:
Copy code
package com.project.common.dto

@kotlin.js.JsExport
class LoginRequestDto(
  val etc: String
)
🔗 Check it out on GitHub I’d love to hear your feedback and suggestions. Let me know what you think!
K 1