简体   繁体   English

如何在 intellij idea 中添加我自己的 dukat 版本

[英]How can I add my own version of dukat in intellij idea

I am trying to generate external Declaration for a NPM package but it is giving errors But when I tried the same with dukat@next version it worked Tell me either how can I include my generated declarations to my kotlinJs project or how can I update to dukat@next in IDE to automatically generate declarations and use it我正在尝试为 NPM package 生成外部声明但是它给出了错误但是当我尝试使用 dukat@next 版本时它起作用了告诉我如何将生成的声明包含到我的 kotlinJs 项目中或者我如何更新到 dukat @next in IDE 自动生成声明并使用

I am expecting for dukat to generate my Declarations and i can work with my npm module我期待 dukat 生成我的声明,我可以使用我的 npm 模块

The Kotlin/JS Gradle plugin configures the version of Dukat via an extension on the root Gradle project (even if the root project does not have the Kotlin/JS plugin applied). Kotlin/JS Gradle 插件通过项目 Gradle 上的扩展配置 Dukat 的版本(即使根项目没有应用 Kotlin/JS 插件)。

The latest version of Dukat can be found on npmjs.com .最新版本的 Dukat 可以在npmjs.com上找到。 Right now, the latest version is 0.5.8-rc.4-dev.20221020现在,最新版本是0.5.8-rc.4-dev.20221020

// build.gradle.kts

import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin

rootProject.plugins.withType<NodeJsRootPlugin> {
  configure<NodeJsRootExtension> {
    versions.apply {
      dukat.version = "0.5.8-rc.4-dev.20221020"
    }
  }
}

There are actually a lot of versions that can be configured.其实有很多版本可以配置。 The full list (for Kotlin v1.8.0) can be viewed in NpmVersions.kt完整列表(Kotlin v1.8.0)可以在NpmVersions.kt查看

I wouldn't rely on Dukat too much though.不过我不会太依赖杜卡特。 It's still highly experimental, and is updated rarely.它仍然是高度实验性的,并且很少更新。 Further development has been postponed a number of times.进一步的开发已被多次推迟 It rarely generates correct code, but it can be used as a good starting point ( read more ).它很少生成正确的代码,但可以用作一个很好的起点(阅读更多)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在IntelliJ IDEA中配置用于暂存文件的Kotlin版本? - How can I configure the Kotlin version used for scratch files in IntelliJ IDEA? 如何在IntelliJ IDEA / Android Studio中添加自定义Kotlin后缀完成? - How can I add a custom Kotlin postfix completion in IntelliJ IDEA / Android Studio? 当我尝试在 intellij idea 社区版本 2021.2 中运行我的第一个 kotlin 代码时出现错误 - I get an error when i try to run my first kotlin code in intellij idea community version 2021.2 如何停止 IntelliJ IDEA 打印空的新行? - How can I stop IntelliJ IDEA printing an empty new line? 为什么我无法在新版本的 IntelliJ Idea 中运行我的旧 Kotlin 程序? - Why I am unable to run my old Kotlin program in new version of IntelliJ Idea? 如何在IntelliJ IDEA中忽略针对Kotlin的所有警告? - How can I ignore all warnings for Kotlin in IntelliJ IDEA? 我应该如何使用 Intellij Idea 创建我的 Kotlin 多模块项目? - How should I create my Kotlin multi-module project with Intellij Idea? 如何更改 IntelliJ 上的 Kotlin 编译器版本? - How can I change the Kotlin compiler version on IntelliJ? 我怎么能自己叫垃圾收集器? - How can I call garbage collector by my own? 如何添加com.intellij.javascript.nodejs以创建想法插件? - How to add com.intellij.javascript.nodejs for create idea plugin?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM