Thank you for your interest in contributing to wiremd! This document provides guidelines and information for contributors.
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please read CODE_OF_CONDUCT.md before contributing.
Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include:
- Clear title and description
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Code samples or markdown examples
- Environment details (Node version, OS, etc.)
- Error messages or screenshots if applicable
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include:
- Clear title and description
- Use case - why would this be useful?
- Proposed solution if you have one
- Examples of how it would work
- Fork the repository and create your branch from
main - Follow the development setup below
- Make your changes following our coding standards
- Add tests for any new functionality
- Update documentation as needed
- Ensure tests pass with
npm test - Submit a pull request
- Node.js >= 18.0.0
- npm or yarn
# Clone your fork
git clone https://github.com/YOUR_USERNAME/wiremd.git
cd wiremd
# Install dependencies
npm install
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Build the project
npm run build
# Type check
npm run typecheck
# Run linter
npm run lintwiremd/
├── src/
│ ├── parser/ # Markdown + wiremd syntax parser
│ │ ├── index.ts # Main parser entry
│ │ ├── transformer.ts # MDAST to wiremd AST
│ │ ├── remark-containers.ts # ::: syntax plugin
│ │ └── remark-inline-containers.ts # [[...]] syntax plugin
│ ├── renderer/ # HTML/JSON renderer
│ │ ├── index.ts # Main renderer entry
│ │ ├── html-renderer.ts # Component HTML generation
│ │ └── styles.ts # Visual styles
│ ├── cli/ # CLI tool
│ ├── types.ts # TypeScript types
│ └── index.ts # Library entry point
├── tests/ # Test suite
└── examples/ # Example wireframes
- Use TypeScript strict mode
- Add JSDoc comments for all exported functions
- Use discriminated unions for type safety
- Prefer named exports over default exports
- Write unit tests for new functions
- Maintain or improve test coverage
- Use descriptive test names
- Test edge cases and error conditions
- Use Prettier for formatting (if configured)
- Follow existing code patterns
- Keep functions small and focused
- Use meaningful variable names
Follow conventional commits format:
type(scope): subject
body (optional)
footer (optional)
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringperf: Performance improvementschore: Build process or tooling changes
Examples:
feat(parser): add support for table components
fix(renderer): correct button style rendering
docs(readme): update installation instructions
test(parser): add tests for nested containers
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test file
npm test -- tests/parser.test.ts
# Watch mode
npm run test:watchimport { describe, it, expect } from 'vitest';
import { parse } from '../src/parser';
describe('Feature Name', () => {
it('should handle basic case', () => {
const input = '## Heading';
const result = parse(input);
expect(result).toBeDefined();
});
it('should handle edge case', () => {
// Test edge cases
});
it('should throw error for invalid input', () => {
expect(() => parse('')).toThrow();
});
});Releases are managed by project maintainers following semantic versioning (semver):
- MAJOR version: Breaking changes
- MINOR version: New features (backward compatible)
- PATCH version: Bug fixes
- Update version in
package.json - Update
CHANGELOG.mdwith changes - Run
npm run buildand verify - Run
npm test- all tests must pass - Commit:
chore: release v0.x.x - Create git tag:
git tag v0.x.x - Push:
git push && git push --tags - Publish to npm:
npm publish - Create GitHub release with changelog
- Update README.md for user-facing changes
- Update SYNTAX-SPEC-v0.1.md for syntax changes
- Add JSDoc comments for API changes
- Update examples/ for new features
- Create docs/ pages for major features
- Use clear, concise language
- Include code examples
- Show input and output for parsers/renderers
- Link to related documentation
- Keep documentation up-to-date with code
- Documentation: Check README.md and SYNTAX-SPEC-v0.1.md
- Issues: Search existing GitHub issues
- Discussions: Use GitHub Discussions for questions
- Chat: (Add Discord/Slack link if available)
Contributors will be recognized in:
- GitHub contributors page
- CHANGELOG.md for significant contributions
- README.md credits section (for major contributions)
By contributing to wiremd, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to wiremd! 🎉