This monorepo contains packages for implementing feature-flagged React components with code splitting support.
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.
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
This project uses changesets to manage versions, create changelogs, and publish to npm.
When making changes:
-
Create a changeset:
pnpm changeset
-
Follow the prompts to:
- Select which packages have changed
- Choose the version bump (major/minor/patch)
- Write a description of your changes
-
Commit the changeset file with your changes:
git add . git commit -m "feat: your feature description" git push
-
Make sure you're on master and up to date:
git checkout master git pull origin master
-
Update versions and changelogs:
pnpm version-packages
-
Review the changes, then commit:
git add . git commit -m "chore: version packages"
-
Make sure you're logged into npm with appropriate permissions:
npm login
-
Build and publish:
pnpm build pnpm publish -r
-
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
major
(1.0.0 -> 2.0.0): Breaking changesminor
(1.0.0 -> 1.1.0): New features (backwards compatible)patch
(1.0.0 -> 1.0.1): Bug fixes and minor updates
Contributions are welcome! Please read our contributing guidelines for details on our code of conduct, and the process for submitting pull requests.
This project is licensed under the European Union Public License v. 1.2 (EUPL-1.2) - see the LICENSE file for details.