PackageJson

abstract class PackageJson : GenericJsonObject

A class representing package.json schema. Custom fields can be added as regular map entries.

Constructors

Link copied to clipboard
fun PackageJson()

Functions

Link copied to clipboard
fun author(action: Action<Person>)

Override and configure the author field

Link copied to clipboard
fun bin(action: Action<JsonObject<String>>)

Override and configure the bin field

Link copied to clipboard
fun bugs(action: Action<Bugs>)

Override and configure the bugs field

Link copied to clipboard
infix fun String.by(value: GenericJsonObject.() -> Unit)
infix fun String.by(value: Action<GenericJsonObject>)

Set a custom object value for this JsonObject

infix fun String.by(value: Any)

Set a custom value for this JsonObject

Link copied to clipboard
fun config(action: Action<GenericJsonObject>)

Override and configure the config field

Link copied to clipboard
fun dependencies(action: Action<JsonObject<String>>)

Override and configure the dependencies field

Link copied to clipboard
fun devDependencies(action: Action<JsonObject<String>>)

Override and configure the devDependencies field

Link copied to clipboard
fun directories(action: Action<Directories>)

Override and configure the directories field

Link copied to clipboard
fun engines(action: Action<JsonObject<String>>)

Override and configure the engines field

Link copied to clipboard
open override fun finalise(): MutableMap<String, Any>

Resolves the underlying json value to a MutableMap instance, recursively merging known and custom properties and resolving all Provider values

Link copied to clipboard
fun json(value: GenericJsonObject.() -> Unit): GenericJsonObject
fun json(value: Action<GenericJsonObject>): GenericJsonObject

Build a custom object value

Link copied to clipboard
fun man(action: Action<JsonObject<String>>)

Override and configure the man field

Link copied to clipboard
fun optionalDependencies(action: Action<JsonObject<String>>)

Override and configure the optionalDependencies field

Link copied to clipboard
fun peerDependencies(action: Action<JsonObject<String>>)

Override and configure the peerDependencies field

Link copied to clipboard
fun Person(action: Action<Person>): Person

Create and configure an instance of Person

Link copied to clipboard
fun publishConfig(action: Action<PublishConfig>)

Override and configure the publishConfig field

Link copied to clipboard
fun repository(action: Action<Repository>)

Override and configure the repository field

Link copied to clipboard
fun scripts(action: Action<JsonObject<String>>)

Override and configure the scripts field

Link copied to clipboard
operator fun set(key: String, value: Any)

Set a custom value

operator fun set(key: String, value: Provider<Any>)

Set a custom value provider to be resolved when finalise is invoked

Properties

Link copied to clipboard
@get:Optional
abstract val author: Property<Person>
Link copied to clipboard
@get:Optional
abstract val bin: Property<JsonObject<String>>
Link copied to clipboard
@get:Input
@get:Optional
abstract val browser: Property<String>
Link copied to clipboard
@get:Optional
abstract val bugs: Property<Bugs>
Link copied to clipboard
@get:Input
@get:Optional
abstract val bundledDependencies: SetProperty<String>

bundledDependencies Top priority if set, disregards all the other configurations

Link copied to clipboard
@get:Optional
abstract val config: Property<GenericJsonObject>
Link copied to clipboard
@get:Optional
abstract val contributors: SetProperty<Person>
Link copied to clipboard
@get:Input
@get:Optional
abstract val cpu: ListProperty<String>
Link copied to clipboard
@get:Optional
abstract val dependencies: Property<JsonObject<String>>
Link copied to clipboard
@get:Input
@get:Optional
abstract val description: Property<String>
Link copied to clipboard
@get:Optional
abstract val devDependencies: Property<JsonObject<String>>
Link copied to clipboard
@get:Optional
abstract val directories: Property<Directories>
Link copied to clipboard
@get:Optional
abstract val engines: Property<JsonObject<String>>
Link copied to clipboard
@get:Input
@get:Optional
abstract val files: SetProperty<String>
Link copied to clipboard
@get:Input
@get:Optional
abstract val homepage: Property<String>
Link copied to clipboard
@get:Input
@get:Optional
abstract val keywords: SetProperty<String>
Link copied to clipboard
@get:Input
@get:Optional
abstract val license: Property<String>
Link copied to clipboard
@get:Input
@get:Optional
abstract val main: Property<String>
Link copied to clipboard
@get:Optional
abstract val man: Property<JsonObject<String>>
Link copied to clipboard
@get:Input
@get:Optional
abstract val name: Property<String>
Link copied to clipboard
@get:Optional
abstract val optionalDependencies: Property<JsonObject<String>>
Link copied to clipboard
@get:Input
@get:Optional
abstract val os: ListProperty<String>
Link copied to clipboard
@get:Optional
abstract val peerDependencies: Property<JsonObject<String>>
Link copied to clipboard
@get:Input
@get:Optional
abstract val private: Property<Boolean>
Link copied to clipboard
@get:Optional
abstract val publishConfig: Property<PublishConfig>
Link copied to clipboard
@get:Optional
abstract val repository: Property<Repository>
Link copied to clipboard
@get:Optional
abstract val scripts: Property<JsonObject<String>>
Link copied to clipboard
@get:Input
@get:Optional
abstract val types: Property<String>
Link copied to clipboard
@get:Input
@get:Optional
abstract val version: Property<String>