Thank you for your interest in contributing to NextJS-HTK! This document provides guidelines and instructions for contributing to the project.
NextJS-HTK is currently in Phase 1: Foundation development. We are building the core framework infrastructure and establishing patterns that will be used across all packages.
- Node.js >= 20.0.0 (check
.nvmrcfor exact version) - pnpm >= 8.0.0
- Git
-
Clone the repository:
git clone https://github.com/hacktoolkit/nextjs-htk.git cd nextjs-htk -
Install dependencies:
pnpm install
-
Build all packages:
pnpm build
-
Run in development mode:
pnpm dev
This is a pnpm workspace monorepo:
nextjs-htk/
├── packages/ # Framework packages
│ ├── core/ # Core components and utilities
│ ├── content/ # Content source adapters
│ ├── templates/ # Site template components
│ ├── cli/ # Command-line tools
│ └── build-tools/ # Build and deployment utilities
├── templates/ # Starter templates
├── docs/ # Documentation site
└── examples/ # Example implementations
-
Navigate to the package directory:
cd packages/core -
Make your changes
-
Run the package in watch mode:
pnpm dev
-
Test your changes:
pnpm test
We use ESLint and Prettier to maintain code quality:
# Check linting
pnpm lint
# Format code
pnpm formatCode style guidelines:
- Use TypeScript for all new code
- Follow existing patterns in the codebase
- Write descriptive variable and function names
- Add JSDoc comments for public APIs
- Keep functions small and focused
We follow conventional commit messages:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(core): add BaseLayout component
Add a base layout component that provides common page structure
including header, footer, and SEO meta tags.
feat(content): add markdown content adapter
Implement markdown content source using gray-matter and remark.
Supports frontmatter parsing and HTML conversion.
fix(build-tools): correct sitemap generation paths
Ensure sitemap URLs use trailing slashes for consistency
with Next.js static export configuration.
master- Main development branchfeature/<name>- Feature branchesfix/<name>- Bug fix branchesdocs/<name>- Documentation branches
Workflow:
- Create a branch from
master - Make your changes
- Push your branch
- Create a pull request
- Create component file in
packages/core/src/components/ - Export from
packages/core/src/components/index.ts - Add TypeScript types in component or
packages/core/src/types/ - Update package README with usage example
- Add tests (when test infrastructure is ready)
- Create adapter in
packages/content/src/<adapter-name>/ - Implement the content adapter interface
- Export from
packages/content/src/index.ts - Add documentation and examples
- Add tests
- Create template directory in
templates/<template-name>/ - Set up Next.js project structure
- Configure htk.config.ts
- Add README with template documentation
- Ensure it builds and exports correctly
Testing infrastructure is being developed. Guidelines will be added here once established.
For now, ensure:
- Code compiles without TypeScript errors
- Package builds successfully
- Manual testing shows expected behavior
- Update README files when adding features
- Add JSDoc comments to public APIs
- Update the main documentation site (when available)
- Include code examples in documentation
- Create PR with descriptive title and description
- Link related issues if applicable
- Ensure CI passes (linting, builds, tests)
- Request review from maintainers
- Address feedback promptly
- Squash commits if requested before merge
PR Description Template:
## Description
Brief description of what this PR does
## Changes
- List of changes
- Another change
## Testing
How this was tested
## Related Issues
Closes #123When reviewing PRs:
- Be constructive and respectful
- Focus on code quality, not personal preferences
- Suggest improvements with examples
- Approve when changes meet quality standards
- Review existing code for patterns
- Ask questions in pull request comments
- Open a discussion in GitHub Discussions
- Reach out to maintainers
Current priorities (Phase 1):
- Core components (BaseLayout, Header, Footer, SEO)
- Content adapters (Markdown, JSON, API)
- Build tools (sitemap, GitHub Pages optimizer)
- Documentation site
- Example templates
Check the GitHub issues for specific tasks and feature requests.
By contributing to NextJS-HTK, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in:
- Project README
- Release notes
- Documentation site (when available)
Thank you for contributing to NextJS-HTK!