Skip to content

Releases: joshwcomeau/new-component

Version 6

12 Dec 19:57
Compare
Choose a tag to compare

This version changes the file extension used for JavaScript projects from .js to .jsx. This change was made because Vite stubbornly refuses to allow JSX inside JS files.

If you would like to keep generating files with the .js extension, you can use Version 5, or fork this repository and change the extension back. You can check out the commit diff to see what change needs to be made.

Version 5

09 Feb 17:24
60532a2
Compare
Choose a tag to compare

When I created this project in 2017, I was much more active in the Open Source community, and planned on developing this project into the go-to tool for generating new components. In 2023, however, I just don't have the time or enthusiasm to maintain this project as a typical open-source project.

This new version has a narrower scope. It's my personal tool, used to make my own dev life a little bit easier. If it helps other folks as well, that's wonderful!

I've added support for TypeScript with a new lang option. I've also made two breaking changes:

  • All components created are functional components. No more class / pure class components
  • The file extension can no longer be customized. It'll be .js for JavaScript components and .tsx for TypeScript components

I've also made a few more under-the-hood changes:

  • The parent directory will automatically be created, if it doesn't already exist.
  • Prettier config will be inferred more reliably.
  • A randomly-selected affirmation will be printed in the terminal output. ✨
  • An MIT license has been added

I know many folks have opened issues and PRs, and I'm sorry I haven't gotten to them! Please feel free to fork this project, to make whatever additions you'd like (eg. using .jsx instead of .js for the extension).

Thanks to @tommy-mitchell for suggesting + implementing a couple of these improvements, and offering to open a PR!