hypermod-io / hypermod-community

Community-owned global registry and documentation hub for codemods. Write & run codemods, share them with your friends!
http://www.codeshiftcommunity.com/
MIT License
130 stars 18 forks source link

Adds ability to whitelist devDeps of the package to be installed #226

Closed danieldelcore closed 5 months ago

danieldelcore commented 5 months ago

When co-locating codemods with existing packages such as react etc, you will likely need to install various dependencies to perform various tasks like utils, parsing, etc. These dependencies when added to your package increase the bundlesize for regular consumers even if they're not using the codemods.

This change introduces a way around this by adding a new property to the config object dependencies where you can specify the devDeps you would like to whitelist.

dependencies: ['@hypermod/utils', 'postcss']

These will be ready by hypermod and referenced against the package.json, then installed with the package at transformation time avoiding the bundlesize bloat for regular consumers.

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: 0f471c556f2e74e36fa3060f373af84b731fcae9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages | Name | Type | | ------------------- | ----- | | @hypermod/types | Minor | | @hypermod/fetcher | Minor | | @hypermod/cli | Minor | | @hypermod/validator | Patch | | @codeshift/cli | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

danieldelcore commented 5 months ago