amzn / style-dictionary

A build system for creating cross-platform styles.
https://amzn.github.io/style-dictionary/#/
Apache License 2.0
3.74k stars 524 forks source link

Change `@zip.js/zip.js` to dependency instead of devDependency #1218

Closed daanvosdewael closed 1 month ago

daanvosdewael commented 1 month ago

In the v4 branch the @zip.js/zip.js dependency is used in lib/utils/convertToDTCG.js:

https://github.com/amzn/style-dictionary/blob/5763a7702a686a49d9f4efd9435ceaf2e76b6065/lib/utils/convertToDTCG.js#L9

But in the package.json this dependency is included as a devDependency:

https://github.com/amzn/style-dictionary/blob/5763a7702a686a49d9f4efd9435ceaf2e76b6065/package.json#L132

This means that it will not be installed as a dependency when you use the style-dictionary package, resulting in the following error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@zip.js/zip.js' imported from /node_modules/style-dictionary/lib/utils/convertToDTCG.js

The package should be listed as a normal dependency instead of a devDependency.

jorenbroekema commented 1 month ago

Oops that's my bad, I hadn't initially planned on exposing the utility in the Style Dictionary library, but then I changed my mind and made it public API but didn't think to switch it from dev dep to real dep.

PRs welcome to fix! Otherwise I'll fix it start of next week somewhere.

Quick workaround would be to install that dependency yourself

daanvosdewael commented 1 month ago

No worries! That's development :)

I made a PR 🙏

jorenbroekema commented 1 month ago

Thanks for the PR! https://github.com/amzn/style-dictionary/pull/1219