Skip to content

andrewdyer/react-package-template

Repository files navigation

React Package Template

📦 React Package Template

A template for creating React packages.

📄 License

Licensed under the MIT license and is free for private or commercial projects.

✨ Introduction

This template is designed to provide a solid foundation to help you hit the ground running and save valuable time when starting a new React package. With all the necessary tools and configurations included, you can focus on building your package without worrying about the initial setup.

📋 Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js: Version 20.x (as specified in .nvmrc) is required.
  • npm: Dependency management tool, version 9.x or higher.
  • yalc (optional): For local package development and testing.

🛠️ Features

This template includes the following tools and configurations:

  • TypeScript for static type checking, with configurations for both ESM and CommonJS modules.
  • Jest for unit testing, along with React Testing Library for testing React components.
  • Storybook for building and testing UI components in isolation.
  • Prettier for consistent code formatting across the codebase.
  • Husky for Git hooks to automate tasks such as formatting, type-checking, and testing before commits.
  • CI (Continuous Integration) setup with GitHub Actions for automated testing, building, type-checking, and publishing the package to npmjs.

🚀 Getting Started

If you like what you've seen so far and think this setup fits your needs, you can quickly get started by clicking the Use this template button at the top of the repository on GitHub.

🎬 Quick Start

Once you've created your package, follow these steps to get up and running:

  1. Clone Your Repository

    Clone your repository and navigate into the package directory:

    git clone https://github.com/YOUR_USERNAME/YOUR_PACKAGE.git
    cd YOUR_PACKAGE
  2. Install Dependencies

    Ensure you have the required tools installed and then run:

    npm install

Now you can start building your package - happy coding! 🎉

📝 Note: For a more in-depth setup guide, including details on running tests and Storybook, check out the development setup section in the contributing documentation.

🤝 Contributing

Before contributing to this package, please refer to the contributing documentation.