Thank you for your interest in contributing to NaturalTime! This document provides guidelines and instructions for contributing to the project.
- Fork the repository
- Clone your fork
git clone https://github.com/your-username/naturaltime.git cd naturaltime - Set up the development environment
# Install dependencies npm install # Build the JavaScript file make build
The core parsing functionality uses chrono-node. If you need to modify the JavaScript code:
- Edit
naturaltime.js - Build the JavaScript file:
make build
- Run tests to verify your changes:
go test ./...
- Make your changes to the Go code
- Format your code:
go fmt ./...
- Run the tests:
go test ./...
- Create a branch for your changes:
git checkout -b feature/your-feature-name
- Commit your changes with clear, descriptive commit messages
- Push your branch to your fork:
git push origin feature/your-feature-name
- Create a pull request from your branch to the
mainbranch of the original repository - In your pull request description, explain:
- What changes you've made
- Why you've made them
- How they've been tested
Please follow these guidelines for code style:
- Follow the Go Code Review Comments
- Use
go fmtandgo vetbefore submitting code - Add meaningful comments and documentation
- Write tests for new functionality
- Follow modern JavaScript practices
- Keep the JavaScript code minimal and focused on the parsing functionality
- Add tests for new functionality
- Ensure all existing tests pass
- Include examples of time expressions that your changes support
The project uses GitHub Actions for automated releases:
- To create a new release, tag your commit with a version number and the
-presuffix:git tag v1.0.0-pre git push origin v1.0.0-pre
- The GitHub Actions workflow will:
- Build the JavaScript file
- Create a new tag without the
-presuffix - Create a GitHub release
By contributing to this project, you agree that your contributions will be licensed under the project's MIT License.