Skip to content

Latest commit

 

History

History
108 lines (77 loc) · 2.65 KB

README.md

File metadata and controls

108 lines (77 loc) · 2.65 KB

React Component Toggle Monorepo

CI

This monorepo contains packages for implementing feature-flagged React components with code splitting support.

Packages

The main component library that enables feature-flagging of React components with full type safety and lazy loading support.

A Rollup plugin that enables efficient code-splitting of feature-flagged components.

Development

This project uses pnpm workspaces for package management. To get started:

# Install pnpm if you haven't already
npm install -g pnpm

# Install dependencies
pnpm install

# Start development
pnpm dev

# Run tests
pnpm test

Release Process

This project uses changesets to manage versions, create changelogs, and publish to npm.

Adding Changes

When making changes:

  1. Create a changeset:

    pnpm changeset
  2. Follow the prompts to:

    • Select which packages have changed
    • Choose the version bump (major/minor/patch)
    • Write a description of your changes
  3. Commit the changeset file with your changes:

    git add .
    git commit -m "feat: your feature description"
    git push

Publishing a New Version

  1. Make sure you're on master and up to date:

    git checkout master
    git pull origin master
  2. Update versions and changelogs:

    pnpm version-packages
  3. Review the changes, then commit:

    git add .
    git commit -m "chore: version packages"
  4. Make sure you're logged into npm with appropriate permissions:

    npm login
  5. Build and publish:

    pnpm build
    pnpm publish -r
  6. Create and push git tags:

    # Get the current version
    VERSION=$(node -p "require('./packages/react-component-toggle/package.json').version")
    git tag v$VERSION
    git push origin v$VERSION

Version Bump Types

  • major (1.0.0 -> 2.0.0): Breaking changes
  • minor (1.0.0 -> 1.1.0): New features (backwards compatible)
  • patch (1.0.0 -> 1.0.1): Bug fixes and minor updates

Contributing

Contributions are welcome! Please read our contributing guidelines for details on our code of conduct, and the process for submitting pull requests.

License

This project is licensed under the European Union Public License v. 1.2 (EUPL-1.2) - see the LICENSE file for details.