-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: remove default export, use named (#9)
- Loading branch information
1 parent
9a99611
commit 00c39e3
Showing
6 changed files
with
69 additions
and
29 deletions.
There are no files selected for viewing
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,27 @@ | ||
--- | ||
'@divriots/style-dictionary-to-figma': minor | ||
--- | ||
|
||
BREAKING: no longer using default export, this is considered an anti-pattern for JS libraries. [Re-export wildstars with default exports in ESM](https://twitter.com/DasSurma/status/1509835337295609865) is one example quirk, another example is [CommonJS not supporting default exports next to named exports in a single file](https://github.com/divriots/style-dictionary-to-figma/issues/7). Now, the main export is a named export called "transform" and you have to import it as such. | ||
|
||
Before: | ||
|
||
```js | ||
// ESM | ||
import styleDictionaryToFigma from '@divriots/style-dictionary-to-figma'; | ||
// CommonJS | ||
const styleDictionaryToFigma = require('@divriots/style-dictionary-to-figma'); | ||
|
||
styleDictionaryToFigma({...}) // figma object | ||
``` | ||
|
||
After: | ||
|
||
```js | ||
// ESM | ||
import { transform } from '@divriots/style-dictionary-to-figma'; | ||
// CommonJS | ||
const { transform } = require('@divriots/style-dictionary-to-figma'); | ||
|
||
transform({...}) // figma object | ||
``` |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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