hcl/cmd/hcldec/examples/npm-package/spec.hcldec
Martin Atkins ee147d9ee6 cmd/hcldec: Command-line tool for converting HCL config to JSON
This is essentially a CLI wrapper around the hcldec package, accepting a
decoding specification via a HCL-based language and using it to translate
input HCL files into JSON values while performing basic structural and
type validation of the input files.
2018-02-03 15:37:11 -08:00

137 lines
2.2 KiB
Plaintext

object {
attr "name" {
type = string
required = true
}
attr "version" {
type = string
required = true
}
attr "description" {
type = string
}
attr "keywords" {
type = list(string)
}
attr "homepage" {
# "homepage_url" in input file is translated to "homepage" in output
name = "homepage_url"
}
block "bugs" {
object {
attr "url" {
type = string
}
attr "email" {
type = string
}
}
}
attr "license" {
type = string
}
block "author" {
object {
attr "name" {
type = string
}
attr "email" {
type = string
}
attr "url" {
type = string
}
}
}
block_list "contributors" {
block_type = "contributor"
object {
attr "name" {
type = string
}
attr "email" {
type = string
}
attr "url" {
type = string
}
}
}
attr "files" {
type = list(string)
}
attr "main" {
type = string
}
attr "bin" {
type = map(string)
}
attr "man" {
type = list(string)
}
attr "directories" {
type = map(string)
}
block "repository" {
object {
attr "type" {
type = string
required = true
}
attr "url" {
type = string
required = true
}
}
}
attr "scripts" {
type = map(string)
}
attr "config" {
type = map(string)
}
attr "dependencies" {
type = map(string)
}
attr "devDependencies" {
name = "dev_dependencies"
type = map(string)
}
attr "peerDependencies" {
name = "peer_dependencies"
type = map(string)
}
attr "bundledDependencies" {
name = "bundled_dependencies"
type = map(string)
}
attr "optionalDependencies" {
name = "optional_dependencies"
type = map(string)
}
attr "engines" {
type = map(string)
}
attr "os" {
type = list(string)
}
attr "cpu" {
type = list(string)
}
attr "prefer_global" {
type = bool
}
default "private" {
attr {
name = "private"
type = bool
}
literal {
value = false
}
}
attr "publishConfig" {
type = map(any)
}
}