A clean boilerplate for creating reusable packages in React.
To install, simply clone the repository to your desired location.
- Click the
Use this template
button and clone the repository. - Run
pnpm i
in the root directory. - Code your desired functionality in the
/src
folder, remembering to export it in the/src/index.ts
file.
Example folder structure:
- react-package-template
- your-app
- Create a new React app in a separate folder (in this example,
your-app
). - Run
pnpm i
in your React app, specifying the path to the package withpnpm i ../react-package-template
. This will includereact-package-template
in thedependencies
section ofyour-app
'spackage.json
file. - Run
pnpm watch
in the package directory to automatically build the package when code changes are made. - Run your React app to test the package live.
To build the package, run pnpm run build
in the package directory.
To release the package, run pnpm release
in the package directory.
- npm release
- commitlint
- Storybook integration
- ...
This project is licensed under the MIT License.