We welcome contributions to the Dataform package! This document provides guidelines for contributing to the project.
git clone https://github.com/masthead-data/dataform-package.git
cd dataform-packagenpm installRun from the root to test all supported versions:
npm testThis command iterates through all supported Dataform versions (currently v2.4.2 and v3.X.X), managing configuration file conflicts automatically.
For rapid development on the version currently installed in test-project:
npm run test:singleThis runs:
jest: Unit tests for helper functions.dataform compile: Generates the actual project graph.verify_compilation.js: In-depth JSON inspection.
Test a single Dataform version:
npm test -- 2.4.2npm run lintThe test-project is configured to use the local version of the package. In test-project/package.json:
"dependencies": {
"@masthead-data/dataform-package": "file:../"
}Note: npm ci or npm install in the test-project caches the local package. If you make changes to index.js and don't see them reflected, you may need to force an update or avoid npm ci during rapid iteration.
dataform-package/
├── index.js # Main package code
├── test/
│ └── index.test.js # Test suite
├── package.json # Package configuration
├── README.md # Main documentation
└── CHANGELOG.md # Version history
This project uses npm ci in CI/CD pipelines, which requires package-lock.json to be perfectly in sync with package.json.
Critical: Platform-Specific Bindings
The project includes optional platform-specific dependencies (e.g., @unrs/resolver-binding-*). If you update dependencies on macOS, npm might "clean" other platform bindings from the lockfile, causing CI to fail on Linux.
If CI fails with npm error EUSAGE related to missing platform bindings:
- Restore the
package-lock.jsonto a known good state. - Run
npm installto update the version/dependencies without removing optional bindings. - Verify that the lockfile still contains entries for
@unrs/resolver-binding-linux-*before committing.
- Follow the existing code style
- Use ESLint for code formatting:
npm run lint - Write meaningful commit messages
- Include tests for new functionality
- Write comprehensive tests for any new features
- Ensure all existing tests pass:
npm test - Aim for high test coverage
- Test edge cases and error conditions
- Update README.md for new features
- Add examples for new functionality
- Update CHANGELOG.md following Keep a Changelog format
- Include JSDoc comments for new functions
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Add tests for your changes
- Ensure tests pass:
npm test - Run linting:
npm run lint - Commit your changes:
git commit -m "Add your feature" - Push to your fork:
git push origin feature/your-feature-name - Submit a pull request
- Provide a clear description of the changes
- Reference any related issues
- Include tests for new functionality
- Update documentation as needed
- Ensure CI passes
- All submissions require review before merging
- Reviews focus on:
- Code quality and style
- Test coverage
- Documentation completeness
- Backward compatibility
When reporting bugs, please include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment details (Node.js version, OS, etc.)
- Code examples if applicable
For feature requests, please provide:
- Clear description of the proposed feature
- Use case and business justification
- Proposed API or interface changes
- Backward compatibility considerations
- Update
CHANGELOG.mdwith version and changes following Keep a Changelog format. - Bump version in
package.json() andREADME.md. - Run
npm testto verify matrix tests pass across all supported Dataform versions. - Commit and push to a feature branch.
- Create a Pull Request and ensure all CI checks pass.
- Merge to
main. - Execute the release script from the
mainbranch:npm run release --tag_version=x.y.z.
If you have questions about contributing, please:
- Check existing issues and documentation
- Open a new issue for discussion
- Contact the maintainers
Thank you for contributing to the Dataform package!