https://github.com/bring-shrubbery/easy-npm-package-react
React and Typescript NPM package setup, just add your code and you should be able to publish it to NPM
https://github.com/bring-shrubbery/easy-npm-package-react
es6 esbuild eslint github-actions jest npm prettier react swc tsup typescript
Last synced: 3 days ago
JSON representation
React and Typescript NPM package setup, just add your code and you should be able to publish it to NPM
- Host: GitHub
- URL: https://github.com/bring-shrubbery/easy-npm-package-react
- Owner: bring-shrubbery
- License: mit
- Created: 2021-06-29T05:04:58.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-14T13:13:05.000Z (8 months ago)
- Last Synced: 2025-04-11T04:43:15.763Z (6 months ago)
- Topics: es6, esbuild, eslint, github-actions, jest, npm, prettier, react, swc, tsup, typescript
- Language: JavaScript
- Homepage:
- Size: 223 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# π Easy NPM Package template for React
This package is a template you can use to create [NPM](https://npmjs.org/) packages that work well with the React library.
## Project Overview
This project includes following features:
- π Ultra fast code bundling powered by [ESBuild](https://esbuild.github.io/) using [tsup](https://github.com/egoist/tsup).
- π Turbo speed testing with [`@swc/jest`](), [Jest](https://jestjs.io/) and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/).
- π Prettier for code formatting.
- π ESLint for code linting.
- π₯Ί Husky for commit validation.
- π Github action to automatically publish the package on every Github Release.
- π Github action to automatically test default branch or a new Pull Request.
- π Double build for CommonJS and ES Modules - to support all JavaScript environments.## Getting started
### `Use this template` button
The easiest way of getting started with this template is to use the `Use this template` button at the top of this page - then follow the steps to create your own repo from it.
### Degit
You can use [`degit`](https://github.com/Rich-Harris/degit) to clone this repo without the git history.
```bash
npx degit github:bring-shrubbery/easy-npm-package-react
```### Adding source code and building
All your source code should go into `src` folder.
After you do that run `yarn build` and you'll have your code compiled into `dist` folder.
You can also run `yarn test` to test your code after you add your tests.### Environment Variables
To have package automatically deployed on new release, add `npm_token` env variable to your Github repository.
## Support
Please consider following this project's author, Antoni SilvestroviΔ on [Github](https://github.com/bring-shrubbery) or [Bluesky](https://bsky.app/profile/bring-shrubbery.bsky.social), or by starring the project to show your β€οΈ and support.
## License
[MIT](https://github.com/bring-shrubbery/easy-npm-package-react/blob/main/LICENSE)