Thank you for your interest in contributing to Hyperbook! This document provides guidelines and instructions for contributing to the project.
Before you begin, ensure you have the following installed:
- Node.js 18 or higher
- pnpm 8 or higher (required package manager)
To install pnpm globally:
npm install -g pnpm-
Fork and clone the repository
git clone https://github.com/openpatch/hyperbook.git cd hyperbook -
Install dependencies
pnpm install
-
Build all packages
pnpm build
-
Run tests to verify setup
pnpm test
Hyperbook is a monorepo with the following structure:
packages/hyperbook/- Main CLI tool and builderpackages/fs/- File system operations and configuration handlingpackages/markdown/- Markdown processing with custom directivespackages/types/- TypeScript type definitionspackages/web-component-excalidraw/- Excalidraw integration componentplatforms/vscode/- VSCode extensionwebsite/- Documentation website (self-documenting)scripts/- Build and utility scripts
Build all packages in the monorepo:
pnpm buildBuild a specific package:
pnpm --filter hyperbook build
pnpm --filter @hyperbook/fs buildWatch mode for development (watches all packages):
pnpm devRun all tests:
pnpm testRun tests for a specific package:
pnpm --filter hyperbook testRun linting across all packages:
pnpm lintTo work on the documentation website:
pnpm install
pnpm build
pnpm website:devEdit files in the website/ folder. The documentation is available in English (website/en/) and German (website/de/).
To develop the VSCode extension:
pnpm install
pnpm build
pnpm --filter hyperbook-studio watch
pnpm --filter hyperbook-studio openThis will open a new VSCode window with the extension loaded for testing.
-
Ensure all tests pass
pnpm test -
Build all packages successfully
pnpm build
-
Run linting
pnpm lint
-
Commit your changes
We use Husky pre-commit hooks that run tests automatically. Ensure your commits pass all checks.
- Create a clear, descriptive title for your PR
- Provide a detailed description of the changes and why they're needed
- Reference any related issues using GitHub keywords (e.g., "Fixes #123")
- Keep PRs focused on a single feature or fix
- Update documentation if your changes affect user-facing functionality
- Add tests for new features or bug fixes
We use Changesets for version management. If your PR includes user-facing changes:
-
Add a changeset
pnpm changeset
-
Follow the prompts to describe your changes
-
Commit the generated changeset file with your PR
- We use Prettier for code formatting
- TypeScript is required for all new code
- Follow existing code patterns and conventions
- Write clear, descriptive variable and function names
- Add comments only when necessary to clarify complex logic
- Matrix Chat: https://matrix.to/#/#openpatch:matrix.org
- Documentation: https://hyperbook.openpatch.org
- Issues: https://github.com/openpatch/hyperbook/issues
If you need help or have questions:
- Check the documentation
- Ask in our Matrix community
- Open an issue on GitHub
- Contact the maintainer: Mike Barkmin (@mikebarkmin)
By contributing to Hyperbook, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Hyperbook! Your efforts help make interactive documentation better for everyone.