Contributing to Draftly
August 18, 2026 · View on GitHub
Thank you for your interest in contributing to Draftly! We welcome contributions from the community and are excited to have you on board.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Submitting a Pull Request
- Coding Guidelines
- Reporting Issues
Code of Conduct
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone. Please be kind and constructive in all interactions.
Getting Started
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/draftly.git cd draftly - Add the upstream remote:
git remote add upstream https://github.com/NeuroNexul/draftly.git
Development Setup
Prerequisites
- Node.js >= 20
- Bun >= 1.3.5 (package manager)
Install Dependencies
bun install
Start Development Server
bun dev
This starts the development server with hot reloading for both the web app and the draftly package.
Build
bun run build
Lint & Format
# Lint all packages (read-only; fails on errors)
bun run lint
# Apply Biome's safe lint fixes across all packages
bun run lint:fix
# Format code with Biome
bun run format
# Lint + format the whole repo in one pass, from the root
bun run check # report only
bun run check:fix # write fixes
Project Structure
This is a monorepo managed with Turborepo.
draftly/
├── apps/
│ └── web/ # Next.js web application (playground)
├── packages/
│ └── draftly/ # Core library (published to npm)
│ ├── src/
│ │ ├── editor/ # CodeMirror editor integration
│ │ ├── plugins/ # Built-in plugins
│ │ └── preview/ # Static HTML renderer
│ └── package.json
├── package.json # Root workspace config
├── turbo.json # Turborepo config
└── README.md
Making Changes
Branch Naming
Use descriptive branch names:
feature/add-table-plugin– New featuresfix/image-rendering-bug– Bug fixesdocs/update-readme– Documentationrefactor/plugin-architecture– Code refactoring
Commit Messages
Follow Conventional Commits:
feat: add table plugin support
fix: resolve image widget rendering issue
docs: update installation instructions
refactor: simplify plugin registration
chore: update dependencies
Changesets
We use Changesets for versioning. If your change affects the public API or fixes a bug, add a changeset:
bun run changeset
Follow the prompts to describe your changes. This creates a file in .changeset/ that will be used to generate the changelog.
Submitting a Pull Request
-
Sync with upstream:
git fetch upstream git rebase upstream/main -
Push your branch:
git push origin your-branch-name -
Open a Pull Request on GitHub against the
mainbranch. -
Fill out the PR template with:
- A clear description of the changes
- Related issue numbers (if any)
- Screenshots for UI changes
-
Wait for review – maintainers will review your PR and may request changes.
Coding Guidelines
TypeScript
- Use strict TypeScript – avoid
anywhere possible. - Export types from
index.tsfiles. - Use descriptive variable and function names.
Code Style
- We use Biome for both linting and formatting – run
bun run check:fixbefore committing. - Shared configuration lives in
packages/biome-config; each workspace has a smallbiome.jsonthat extends it. See that package's README for the layer breakdown. - Formatting matches the repository's previous Prettier settings: 2 spaces, double quotes,
semicolons,
printWidth/lineWidth120, ES5 trailing commas, LF.
Plugins
When creating a new plugin:
- Create a new file in
packages/draftly/src/plugins/. - Extend the
DraftlyPluginbase class. - Export the plugin from
packages/draftly/src/plugins/index.ts. - Add the plugin to the
createEssentialPlugins()factory if it should be included by default. If it pulls a heavy third-party dependency, give it its own entry point instead (seesrc/plugins/mermaid.ts) and add it tocreateAllPlugins()insrc/plugins/all.ts. - Update documentation if needed.
Testing
- Test your changes in the playground app (
apps/web). - Ensure the build passes:
bun run build. - Ensure linting passes:
bun run lint.
Reporting Issues
Found a bug or have a feature request? Open an issue with:
- Bug reports: Steps to reproduce, expected behavior, actual behavior, screenshots if applicable.
- Feature requests: Clear description of the feature and its use case.
Questions?
Feel free to open a Discussion or reach out to the maintainers.
Thank you for contributing! 🎉