Thanks for your interest in contributing to Tiny UI! This guide will help you get started.
- Node.js >= 22
- pnpm (see
packageManagerinpackage.jsonfor the exact version)
# Clone the repo
git clone https://github.com/wangdicoder/tiny-design.git
cd tiny-design
# Install dependencies
pnpm install
# Start the docs site (dev server)
pnpm dev
# Run tests
pnpm test
# Build the component library
pnpm buildtiny-design/
├── packages/react/ # @tiny-design/react — component library
│ ├── src/ # Component source code
│ ├── scripts/ # Build scripts
│ └── package.json
├── apps/docs/ # Documentation site
│ ├── src/ # Site source
│ ├── guides/ # Guide markdown files
│ └── package.json
├── turbo.json # Turborepo config
└── package.json # Workspace root
- Create a new directory under
packages/react/src/your-component/ - Follow the existing component structure:
your-component/
├── your-component.tsx # Component implementation
├── types.ts # TypeScript interfaces
├── index.tsx # Barrel export
├── index.md # English documentation
├── index.zh_CN.md # Chinese documentation
├── style/
│ ├── _index.scss # Component styles
│ └── index.tsx # Style entry (imports)
├── demo/
│ └── basic.md # Usage demos
└── __tests__/
└── your-component.test.tsx
- Export the component from
packages/react/src/index.ts - Add the route in
apps/docs/src/routers.tsx
- TypeScript strict mode is enabled
- Components use
React.forwardReffor ref forwarding - CSS class names follow the
ty-component-nameconvention - SCSS variables are in
packages/react/src/style/_variables.scss
# Run all tests
pnpm test
# Run tests for a specific component
pnpm --filter @tiny-design/react test -- --testPathPattern=button
# Update snapshots
pnpm --filter @tiny-design/react test:update
# Run with coverage
pnpm --filter @tiny-design/react test:coverageWe use Conventional Commits. Each commit message should be structured as:
<type>(<scope>): <description>
Types: feat, fix, docs, style, refactor, perf, test, chore, revert
Examples:
feat(button): add loading statefix(modal): prevent scroll when opendocs(input): update API documentation
We use Changesets to manage versioning and changelogs. If your PR includes user-facing changes to @tiny-design/react, add a changeset:
pnpm changesetYou'll be prompted to:
- Select the package(s) affected (
@tiny-design/react) - Choose the semver bump type (patch / minor / major)
- Write a short summary of your change
This creates a markdown file in .changeset/ — commit it with your PR. When the PR merges, a "Version Packages" PR is automatically opened. Merging that PR publishes to npm and updates the changelog.
- Fork the repo and create a branch from
master - If you've added code, add tests
- Ensure the test suite passes (
pnpm test) - Ensure your code lints (
pnpm lint) - Add a changeset if your change affects published packages (
pnpm changeset) - Create a pull request with a clear description
Use GitHub Issues with the bug report template. Include:
- Steps to reproduce
- Expected vs actual behavior
- Browser and OS information
- A minimal reproduction if possible
By contributing, you agree that your contributions will be licensed under the MIT License.