rubysrc-components (0.1.1)
Installation
registry=npm install rubysrc-components@0.1.1"rubysrc-components": "0.1.1"About this package
rubysrc-components
A shared React component library for the RubySrc platform. Components are built on Radix UI, styled with Tailwind CSS v4, and documented with Storybook.
Requirements
- pnpm v10
Setup
git clone https://forgejo.rubysrc.dev/ruby/rubysrc-components.git
cd rubysrc-components
pnpm install
pnpm prepare # installs Husky git hooks
Development
Start Storybook to develop and preview components in isolation:
pnpm dev
Scripts
| Command | Description |
|---|---|
pnpm dev |
Start Storybook dev server |
pnpm build |
Type-check and build the library |
pnpm build-storybook |
Build a static Storybook site |
pnpm test |
Run unit tests with Vitest |
pnpm test:coverage |
Run tests with coverage report |
pnpm lint |
Lint and format-check with Biome |
pnpm lint:fix |
Auto-fix lint and formatting issues |
Commit conventions
This project uses Conventional Commits enforced by commitlint. Your commit messages must follow the pattern:
<type>(optional scope): <description>
# Examples
feat(button): add destructive variant
fix: correct disabled pointer-events
chore: bump dependencies
The Husky commit-msg hook runs commitlint automatically on every commit.
Adding a new component
-
Create the component directory under
src/components/<ComponentName>/. -
Add the implementation file:
<ComponentName>.tsx.- Use Tailwind utility classes for all styling.
- Export a typed props interface.
-
Add stories:
<ComponentName>.stories.tsxwith at least a default story and one story per significant variant or state. -
Add tests:
<ComponentName>.test.tsxusing Vitest and@testing-library/react. Cover rendering, variants, and any interactive behaviour. -
Export the component from
src/index.ts:export { ComponentName } from "./components/ComponentName/ComponentName"; -
Create a changeset to record the change for the next release:
pnpm changesetFollow the prompts to describe the change and select a semver bump type.
CI
On every push and pull-request to main, Forgejo Actions runs two jobs:
- Commitlint: validates commit message format.
- Lint & Test: runs
tsc --noEmit,biome check, andvitest.
Releases
Merging to main triggers the release workflow. It uses Changesets to either open a "version packages" PR (when changesets are pending) or publish directly to the registry (when that PR is merged).
Dependencies
Dependencies
| ID | Version |
|---|---|
| @tailwindcss/vite | ^4.2.2 |
| clsx | ^2.1.1 |
| tailwind-merge | ^3.5.0 |
| tailwindcss | ^4.2.2 |
Development dependencies
| ID | Version |
|---|---|
| @biomejs/biome | 2.4.12 |
| @changesets/cli | ^2.31.0 |
| @changesets/config | ^3.1.4 |
| @commitlint/cli | ^20.5.2 |
| @commitlint/config-conventional | ^20.5.0 |
| @storybook/addon-a11y | 10.3.5 |
| @storybook/addon-docs | 10.3.5 |
| @storybook/addon-themes | 10.3.5 |
| @storybook/addon-vitest | 10.3.5 |
| @storybook/react-vite | 10.3.5 |
| @testing-library/jest-dom | ^6.9.1 |
| @testing-library/react | ^16.3.2 |
| @testing-library/user-event | ^14.6.1 |
| @types/node | ^24.12.2 |
| @types/react | ^19.2.14 |
| @types/react-dom | ^19.2.3 |
| @vitejs/plugin-react | ^6.0.1 |
| @vitest/browser-playwright | 4.1.4 |
| @vitest/coverage-v8 | 4.1.4 |
| @vitest/ui | 4.1.4 |
| husky | ^9.1.7 |
| jsdom | ^29.0.2 |
| playwright | ^1.60.0 |
| storybook | ^10.3.5 |
| typescript | ~6.0.2 |
| vite | ^8.0.4 |
| vitest | ^4.1.4 |
Peer dependencies
| ID | Version |
|---|---|
| radix-ui | ^1.4.3 |
| react | ^19.2.4 |
| react-dom | ^19.2.4 |