Thank you for your interest in contributing to Apsara! This guide will help you understand how to contribute effectively to this project.
- Contributing to Apsara
Before contributing, please review our Development Guide to set up your local development environment.
Quick setup:
git clone https://github.com/raystack/apsara.git
cd apsara
pnpm install
pnpm dev-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Start the development server:
# Start both library development and documentation site pnpm start # Or start just the library development server pnpm dev
-
Make your changes in the appropriate directories:
- Components:
packages/raystack/ - Documentation:
apps/www/
- Components:
-
Test your changes:
# Run tests with Vitest pnpm test:apsara # Run tests in watch mode cd packages/raystack && pnpm test:watch # Build to ensure no build errors pnpm build
-
Format your code:
pnpm format
-
Commit your changes following conventional commit format:
git add . git commit -m "feat: add amazing new feature"
- Use TypeScript for all new code
- Follow existing component patterns
- Use Biome for code formatting:
pnpm format - Write tests for new components and features
-
Create components in
packages/raystack/ -
Follow the existing component structure:
component-name/ ├── index.ts # Export barrel file ├── component-name.tsx # Main component ├── component-name.module.css # Styles └── __tests__/ # Tests └── component-name.test.tsx -
Export new components from
packages/raystack/index.ts -
Update the component documentation in
apps/www/content/docs
The project includes a documentation website for the library apps/www:
- Built with Next.js and Fumadocs
- Uses MDX for component documentation
Each component folder in apps/www/src/content/docs/ contains:
component-name/
├── index.mdx # Main documentation with examples and usage
├── props.ts # TypeScript definitions for component props
└── demo.ts # Code for interactive playground and examples
-
Adding new component docs:
- Create a new folder in
apps/www/src/content/docs/components/ - Add
index.mdxwith component description and examples - Add
props.tswith TypeScript prop definitions - Add
demo.tswith interactive examples
- Create a new folder in
-
Testing documentation changes:
# Start the docs site cd apps/www && pnpm dev
The project includes a VS Code extension (packages/plugin-vscode/) that provides:
- Autocomplete: IntelliSense for Apsara components and design tokens
- Hover information: Component documentation and prop details
- Snippets: Quick component insertion
-
Development:
Use VS Code Command Palette: "Tasks: Run Task" → "plugin-vscode: start-dev"
This starts the extension in watch mode and opens the Extension Development Host. -
Building:
pnpm build # Build for production -
Packaging:
pnpm package # Create .vsix file for distribution
- Fork the repository
- Create a feature branch
- Make your changes
- Ensure tests pass and code builds
- Format your code
- Submit a pull request with a clear description
- Provide a clear description of what your PR does
- Include screenshots for UI changes
- Link to any relevant issues
- Ensure all tests pass
- Follow the code style guidelines
Use conventional commits for better release notes:
feat:for new featuresfix:for bug fixesdocs:for documentation changesstyle:for formatting changesrefactor:for code refactoringtest:for adding testschore:for maintenance tasks
Example:
git commit -m "feat: add new Button variant"
git commit -m "fix: resolve tooltip positioning issue"
git commit -m "docs: update component API documentation"Apsara follows an automated release process using GitHub Actions and semantic versioning.
-
Production Releases (
v1.2.3):- Released from the
mainbranch - Published to NPM with
latesttag - Triggered by pushing tags matching
v[0-9]+.[0-9]+.[0-9]+
- Released from the
-
Release Candidates (
v1.2.3-rc.1):- Released from the
mainorrelease/*branch - Published to NPM with
nexttag - Triggered by pushing tags matching
v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+
- Released from the
-
Prepare the release:
# Ensure you're on the correct branch git checkout main # for production release # OR git checkout develop # for release candidate # Pull latest changes git pull origin main # or develop
-
Create and push a tag:
# For production release git tag v1.2.3 git push origin v1.2.3 # For release candidate git tag v1.2.3-rc.1 git push origin v1.2.3-rc.1
-
GitHub Actions will automatically:
- Build the library
- Run tests (if configured)
- Bump the package version
- Publish to NPM
- Create a GitHub release with auto-generated notes
The release process includes these automated steps:
- Checkout the appropriate branch (
mainorrelease/*) - Setup Node.js 22.x and pnpm 9.3.0
- Install dependencies
- Build the library using
pnpm ci:build - Bump version in package.json based on the git tag
- Publish to NPM using
release-it - Generate GitHub release notes
The library is published as @raystack/apsara with the following structure:
# Install the library
npm install @raystack/apsara
# or
pnpm add @raystack/apsaraIf you encounter issues:
- Check if there are similar issues in the GitHub Issues
- Look at the documentation site
- Review the Development Guide
- Create a new issue if the problem persists
By participating in this project, you agree to abide by our code of conduct. Be respectful, inclusive, and collaborative in all interactions.
For technical setup and local development instructions, see the Development Guide.