- Clone the repository
- Install dependencies:
npm install - Run tests to ensure everything works:
npm test
SIGIL follows a Test-Driven Development (TDD) approach:
- Write tests first: Create failing tests for the new feature
- Watch tests fail: Run
npm testto confirm tests fail as expected - Implement code: Write the minimal code to make tests pass
- Verify tests pass: Run
npm testto confirm implementation works - Refactor if needed: Clean up code while keeping tests green
npm run build- Compile TypeScript to JavaScriptnpm run dev- Watch mode compilation for developmentnpm test- Run all testsnpm test:watch- Run tests in watch modenpm run example- Run the example to see SIGIL in actionnpm run clean- Remove compiled files
SIGIL uses standard-version for automated versioning and changelog generation based on conventional commits.
Follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat:- New features (triggers minor version bump)fix:- Bug fixes (triggers patch version bump)docs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoring without changing functionalitytest:- Adding or updating testschore:- Maintenance tasks, dependency updates
Breaking changes:
- Add
BREAKING CHANGE:in the footer or use!after type (triggers major version bump)
For complete release instructions, see docs/release-process.md.
- Create a new branch:
git checkout -b feature-name - Add examples first: Update examples to show the new feature
- Write comprehensive tests: Cover edge cases and error conditions
- Implement incrementally: Start with the simplest case
- Update documentation: Add to README if user-facing
src/index.ts- Main API exportssrc/template-engine.ts- Core SIGIL processing logicsrc/parser.ts- YAML parsing and validationsrc/yaml-loader.ts- File loading utilitiessrc/markov-generator.ts- Markov chain text generationtest/- All test files (mirror src/ structure)examples/- Usage examples and sample data
- Test file naming:
test-[module].ts - Use descriptive test names that explain the behavior
- Test both success and failure cases
- Include edge cases (empty strings, null values, etc.)
- Mock external dependencies when appropriate
If you're unsure about anything, feel free to:
- Run
npm run release:dry-runto preview changes - Check existing tests for patterns
- Look at recent commits for examples
- Open an issue for discussion
Remember: when in doubt, write a test first!