Parsers Engine
Parsers Engine API reference
Configuration file
The Configuration file has common properties, and some destination specific ones
interface ConfigurationFileCommon {
version: '2';
repository: string; // @owner/repository
rules: Array<ParserRule>;
}For Specify CLI
interface CLIConfigurationFile extends ConfigurationFileCommon {
personalAccessToken?: string; // Can be set using the -p flag
}For GitHub
interface GitHubConfigurationFile extends ConfigurationFileCommon {
personalAccessToken: string; // Can be set over secret
}ParserRule
ParserRuleThe Parsers Rules help you transform your design tokens and assets the way you want.
A rule is composed of the following properties:
name
string
false
The name of your rule.
parsers
Array<BuiltInParserRuleConfiguration>
true
The parsers you want to apply to transform your token tree. For further details see Parsers.
BuiltInParserRuleConfiguration
BuiltInParserRuleConfigurationThe Parser Configuration object helps you configure the behaviour of a given parser.
The object is composed of the following properties:
options
false
The options relative to the parser you apply. Each parser has its own options. For further details see Parsers.
output
object
false
The output you want the parser to generate. In most cases, a file or a directory.
ParsersEngineDataBox
ParsersEngineDataBoxThe parsers engine can take several input types called parsers engine data boxes. On start, the Parsers engine requires one of the data box types to be passed in as initial input.
SDTF
SDTF Engine
Specify Repository
JSON
Vector
Bitmap
Asset
ParserOutput
ParserOutputThe parsers produce different types of outputs based on your configuration and their proper capabilities. If not all the parsers accept an output configuration property, the ones which do always take a standardized type as input.
File
Use case: the parser is expected to produce exactly one file.
Example with the to-css-custom-properties parser:
Directory
Use case: the parser is expected to produce 0 to N files, all placed in the given base directory.
Example with the to-svg-file parser:
Last updated
Was this helpful?