seek-oss / playroom

Design with JSX, powered by your own component library.
MIT License
4.45k stars 183 forks source link

Feat: add support for loading mjs config files #299

Closed nib-bturner closed 8 months ago

nib-bturner commented 8 months ago

As a consumer, I want to be able to define my playroom config using ESM compatible JS code. I noticed today when trying this behaviour out that sadly playroom does not currently support this, so I've prepared this PR to add support for this behaviour.

As this PR replaces require with import for loading config files, it is important that the bin/cli.js file is still loaded as CommonJS code. To force this behaviour (when users might specify "type":"module" in their package.jsons) I have renamed it bin/cli.cjs.

Unsure if this is best released as a minor or major change. I can modify the changeset command as needed.

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: 4508c0acce9f0a8331491e0705e08af95d20dce7

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

This PR includes changesets to release 1 package | Name | Type | | -------- | ----- | | playroom | 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

nib-bturner commented 8 months ago

Hi @askoufis, I noticed you're the most recent reviewer on this project. Is there any chance you can have a look over this feature request?

Thanks 🙏🏼

askoufis commented 8 months ago

Looks like the eslint config needs to be tweaked, but then this should be good to go.