CLI config API
Typed project configuration from @primitree/cli/config.
Interfaces
PrimitreeOutputConfig
Build output settings for one token source.
Properties
directory
readonlydirectory:string
A separate build output folder under the config file's folder.
formats?
readonlyoptionalformats?: readonlyPrimitreeOutputFormat[]
File sets to create.
Default Value
['dtcg', 'css', 'typescript', 'tailwind']
PrimitreeLayerConfig
One layer used when checking a token source.
Properties
id
readonlyid:string
Name used in findings.
roots
readonlyroots: readonlystring[]
Exact first path segments assigned to this layer.
values
readonlyvalues:PolicyValueRule
Value forms allowed in this layer.
references?
readonlyoptionalreferences?: readonlystring[]
Layers that this layer may reference.
PrimitreeArchitectureConfig
Layer rules for one token source.
Properties
layers
readonlylayers: readonlyPrimitreeLayerConfig[]
One to four ordered layers.
PrimitreeDTCGSourceConfig
One local DTCG token source.
Properties
type
readonlytype:"dtcg"
Identifies a DTCG token document.
file
readonlyfile:string
Token file path, relative to the config file.
architecture
readonlyarchitecture:PrimitreeArchitectureConfig
Layer rules checked for this source.
ownership?
readonlyoptionalownership?:PolicyOwnershipInput
Default owners and owners for exact root paths.
outputs?
readonlyoptionaloutputs?:PrimitreeOutputConfig
Files created after this source passes its checks.
PrimitreeConfig
Primitree project settings.
Properties
schemaVersion
readonlyschemaVersion:1
Config format version. Primitree 1.0 accepts version 1.
sources
readonlysources:Readonly<Record<string,PrimitreeDTCGSourceConfig>>
Each object key is a source name.
Type Aliases
PrimitreeOutputFormat
PrimitreeOutputFormat =
"dtcg"|"css"|"typescript"|"tailwind"
A file set that primitree build can create from one DTCG source.
Functions
defineConfig()
defineConfig(
config):PrimitreeConfig
Add TypeScript checks to a Primitree project config.
Parameters
config
Project settings.
Returns
The same object.