This is a monorepo containing React UI components. It uses Nx for managing the workspace and building the packages. React Cosmos for developing.
To start developing the components locally, follow these steps:
- Clone the repository
- Install dependencies:
npm install
(postinstall
will runbuild-all
afterinstall
) - Build fixtures:
npm run cosmos
- Serve fixtures:
npm start
- View Fixtures
This will start the Cosmos development environment where you can preview and interact with the components.
To build all packages for production, run:
npm run build-all
Build outputs are stored in dist/packages/@your-org/<package>
To publish the packages to a registry like npm, run:
npm run publish:nx
This will build and publish all affected packages to the registry.
This monorepo provides several npm scripts for common tasks:
clean
: Removes node_modules and dist folderspostinstall
: Runsbuild-all
after installing dependenciesstart
: Starts the Cosmos development servergenerate:react-package
: Generates a new React package in the monorepoaffected
: Shows projects affected by changes since the main branchbuild
: Builds affected projectsbuild:nx
: Builds affected projects using Nxbuild-all
: Builds all projectspublish
: Publishes affected packagespublish:nx
: Publishes affected packages using Nxcosmos
: Starts the Cosmos development server with imports exposedprettier:check
: Checks code formatting with Prettierprettier:fix
: Fixes code formatting with Prettier
The monorepo uses the following main dependencies:
- @nx/js: Nx plugins for JavaScript projects
- esbuild: A fast JavaScript bundler
- react: React library for building user interfaces
- react-cosmos: A development environment for building scalable React UI libraries
- tailwindcss: A utility-first CSS framework
- flowbite: A Tailwind CSS component library
This project is licensed under the MIT License.