Skip to content

Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.

License

Notifications You must be signed in to change notification settings

DanySK/npm-publish

 
 

Repository files navigation

NOTE: This is a fork of https://github.com/mpetuska/npm-publish. I'll try to keep it in sync, and patch here when needed.

NPM-PUBLISH GRADLE PLUGIN

Important

Unfortunately I no longer have the capacity to maintain this plugin. If anyone out there is willing to take over the effort and for the repository, feel free to contact me to add references to your forks in this archived repository.

Gradle plugin enabling NPM publishing (essentially maven-publish for NPM packages). Integrates seamlessly with Kotlin/JS/MPP plugin if applied, providing auto configurations.

Check the latest release for verified JVM, Kotlin and Gradle tooling versions

Setup

Here's a bare minimum setup when using together with one of the kotlin plugins. This setup would produce the following tasks:

  • assembleJsPackage
  • packJsPackage
  • publishJsPackageToNpmjsRegistry
plugins {
    id("org.danilopianini.npm.publish") version "<VERSION>"
    kotlin("multiplatform") version "<VERSION>>" // Optional, also supports "js"
}

kotlin {
    js(IR) {
        binaries.library()
        browser() // or nodejs()
    }
}

npmPublish {
    registries {
        // For registries expecting an authentiation token, use authToken
        register("npmjs") {
            uri.set("https://registry.npmjs.org")
            authToken.set("obfuscated")
        }
        
        // For registries expecting a username and password, use auth or username + password
        register("nexus") {
            uri.set("https://nexus.example.com/repository/npm-internal")
            username.set("obfuscated")
            password.set("obfuscated")
            // Or:
            // auth.set("base64-encoded-string")
        }
    }
}

Full documentation can be found on npm-publish.petuska.dev

Contributing

See CONTRIBUTING

Thanks to all the people who contributed to npm-publish!

About

Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 99.3%
  • JavaScript 0.7%