Skip to content

Commit

Permalink
Merge pull request #173 from trazek/enhancement-resolve-alias-metadata
Browse files Browse the repository at this point in the history
(enhancement) added ability to resolve aliases in meta data.
  • Loading branch information
aputinski authored Dec 20, 2018
2 parents 1412d54 + 899031e commit cd12a1b
Show file tree
Hide file tree
Showing 9 changed files with 244 additions and 114 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [8.1.1]

- Added `resolveMetaAliases` option to resolve aliases in metadata. - see [#172](https://github.com/salesforce-ux/theo/issues/172)

## [8.0.1]

- Upgraded vulnerable dependency
Expand Down
21 changes: 13 additions & 8 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,44 @@ $ theo <[file]> [options]

### Options

|Name|Description|Default|
|----|-----------|-------|
|`--transform`|valid theo transform|`raw`|
|`--format`|Comma separated list of valid theo formats|`raw.json`|
|`--dest`|The path where the result should be written|stdout|
|`--setup`|The path to an optional JS module that can set up Theo before transformation.||
| Name | Description | Default |
| ---------------------- | ----------------------------------------------------------------------------- | ---------- |
| `--transform` | valid theo transform | `raw` |
| `--format` | Comma separated list of valid theo formats | `raw.json` |
| `--dest` | The path where the result should be written | stdout |
| `--setup` | The path to an optional JS module that can set up Theo before transformation. | |
| `--resolveMetaAliases` | Resolve aliases in metadata | `false` |

### transforms / formats

Formats are valid theo supported formats, check the [documentation](https://github.com/salesforce-ux/theo#available-formats) for a full list of supported transforms and formats.

Usage example with formats:

```
$ theo tokens.yml --transform web --format scss,cssmodules.css
$ theo tokens.yml --transform web --format scss,cssmodules.css --resolveMetaAliases
```

### setup module

A valid setup module exports a function that takes theo as the first argument.

Example module (example.js):

```
module.exports = theo => {
theo.registerValueTransform(
'addpx',
prop => prop.get('type') === 'size',
'addpx',
prop => prop.get('type') === 'size',
prop => prop.get('value') + 'px'
);
theo.registerTransform("web", ['addpx']);
}
```

Usage example with setup

```
$ theo tokens.yml --setup example.js --transform web --format scss
```
Expand Down
Loading

0 comments on commit cd12a1b

Please sign in to comment.