-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: align preprocessor API, adjust expand API
- Loading branch information
1 parent
3486daa
commit 1cf13d4
Showing
22 changed files
with
674 additions
and
403 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
'style-dictionary': major | ||
--- | ||
|
||
BREAKING: preprocessors must now also be explicitly applied on global or platform level, rather than only registering it. This is more consistent with how the other hooks work and allows applying it on a platform level rather than only on the global level. | ||
|
||
`preprocessors` property that contains the registered preprocessors has been moved under a wrapping property called `hooks`. | ||
|
||
Before: | ||
|
||
```js | ||
export default { | ||
// register it inline or by SD.registerPreprocessor | ||
// applies automatically, globally | ||
preprocessors: { | ||
foo: (dictionary) => { | ||
// preprocess it | ||
return dictionary; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
After: | ||
|
||
```js | ||
export default { | ||
// register it inline or by SD.registerPreprocessor | ||
hooks: { | ||
preprocessors: { | ||
foo: (dictionary) => { | ||
// preprocess it | ||
return dictionary; | ||
} | ||
} | ||
}, | ||
// apply it globally | ||
preprocessors: ['foo'], | ||
platforms: { | ||
css: { | ||
// or apply is per platform | ||
preprocessors: ['foo'] | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
'style-dictionary': minor | ||
'style-dictionary': major | ||
--- | ||
|
||
BREAKING: expose getReferences and usesReference utilities as standalone utils rather than requiring them to be bound to dictionary object. This makes it easier to use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.