Skip to content

NpmPublishTask

Summary

A task to publish a given NpmPackage to a given NpmRegistry. The task can be created and configured in a build.gradle.kts file by registering it with correct type.

build.gradle.kts
1
2
3
4
5
tasks {
  register("name", dev.petuska.npm.publish.task.NpmPublishTask::class) {
    ...
  }
}

Properties

Property Type Default When Kotlin plugin is present
registry NpmRegistry
packageDir Directory
dry Boolean false
tag String
Property CLI System/Gradle Environment
registry
packageDir
dry --dry
tag --tag
build.gradle.kts
tasks {
  register("name", dev.petuska.npm.publish.task.NpmPublishTask::class) {
    registry {
      ...
    }
    packageDir.set(layout.projectDirectory.dir("src/main/js"))
    dry.set(true)
    tag.set("latest")
  }
}

registry

A registry to publish to

packageDir

The directory where the assembled and ready-to-publish package is

dry

Controls dry-tun mode for the execution.

tag

Sets a tag to label published package version More info