Thank you for your interest in contributing to bxp-code! Every contribution — whether it's a bug report, feature request, documentation improvement, or code change — helps make this project better for everyone.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Development Workflow
- Pull Request Process
- Reporting Issues
- Commit Conventions
- Style Guide
- License
This project follows a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior by opening an issue.
- Node.js >= 18.0.0
- A package manager: npm, pnpm, yarn, or bun
- Git
-
Fork the repository on GitHub.
-
Clone your fork locally:
git clone https://github.com/<your-username>/bxp-code.git cd bxp-code
-
Add the upstream remote:
git remote add upstream https://github.com/saqibbedar/bxp-code.git
-
Create a new branch for your work:
git checkout -b feat/my-feature
Install dependencies:
npm installStart the Vite dev server (playground page):
npm run devStart the VitePress documentation site:
npm run docsbxp-code/
├── src/
│ ├── lib/ # Library source (published to npm)
│ │ ├── BxpCode.tsx # Single code block component
│ │ ├── BxpCodeTabs.tsx # Multi-tab code block component
│ │ ├── CodeContainer.tsx # Shared container with sticky headers
│ │ └── themes/ # Custom Shiki themes (bxp-dark, bxp-light)
│ ├── components/ # Playground page
│ │ ├── ui/ # CoverPage, ExamplesPage
│ │ └── common/ # Header, Footer
│ ├── App.tsx # Router setup
│ ├── main.tsx # Entry point
│ └── index.ts # Public API exports
├── docs/ # VitePress documentation
│ ├── .vitepress/config.ts # VitePress config
│ ├── guide/ # Guides (getting started, usage, themes, etc.)
│ ├── api/ # API reference pages
│ └── blog/ # Release blog posts
├── public/ # Static assets
├── vite.config.ts # Vite config (library mode)
├── tsconfig.json # TypeScript config
└── package.json
| Directory | Purpose |
|---|---|
src/lib/ |
Core library code — this is what gets published to npm |
src/components/ |
Playground page & interactive examples |
docs/ |
VitePress documentation site |
| Command | Description |
|---|---|
npm run dev |
Start Vite dev server for the Playground page |
npm run host |
Start Vite dev server for the Playground page (mobile) |
npm run build |
Type-check with tsc and build the library with Vite |
npm run lint |
Run ESLint across the project |
npm run docs |
Start VitePress dev server for documentation |
npm run docs:build |
Build the VitePress documentation site |
npm run docs:preview |
Preview the built documentation site |
npm run playground:build |
Build the playground demo app (outputs to dist-playground) |
npm run playground:preview |
Preview the built playground locally on port 4174 |
- Library code (
src/lib/): Changes here affect the published package. Make sure to runnpm run buildto verify the build succeeds. - Documentation (
docs/): Runnpm run docsto preview changes locally. - Playground (
src/components/): Runnpm run devto see changes in the browser.
Before submitting a pull request, make sure:
# Type-check and build
npm run build
# Lint
npm run lint
# Build docs (catches VitePress build errors)
npm run docs:build-
Update your branch with the latest upstream changes:
git fetch upstream git rebase upstream/main
-
Ensure all checks pass — build, lint, and docs build should all succeed.
-
Write a clear PR description that explains:
- What the change does
- Why the change is needed
- Any breaking changes or migration steps
-
Keep PRs focused — one feature or fix per PR. Smaller PRs are easier to review and merge.
-
Update documentation if your change affects the public API or user-facing behavior.
-
Add screenshots for UI changes to the playground.
When opening an issue, please include:
- Description: A clear and concise description of the problem or suggestion.
- Steps to reproduce (for bugs): Minimal steps to reproduce the behavior.
- Expected behavior: What you expected to happen.
- Actual behavior: What actually happened.
- Environment: Node.js version, browser, OS, and
bxp-codeversion. - Code sample: A minimal code snippet demonstrating the issue, if applicable.
We follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation changes |
style |
Code style changes (formatting, no logic change) |
refactor |
Code refactoring (no feature or fix) |
perf |
Performance improvements |
test |
Adding or updating tests |
chore |
Build process, tooling, or dependency updates |
feat(tabs): add closable tabs support
fix(theme): correct dark theme background color
docs(api): add missing props to BxpCodeTabs reference
chore(deps): update shiki to v4.1.0
- TypeScript: All source code is written in TypeScript. Use proper types — avoid
any. - React: Functional components with hooks. No class components.
- Formatting: Run
npm run lintbefore committing. Follow the existing code style. - Naming: Use
PascalCasefor components,camelCasefor variables and functions,UPPER_SNAKE_CASEfor constants. - Exports: All public API exports go through
src/index.ts.
By contributing to bxp-code, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing! If you have any questions, feel free to open an issue or start a discussion.