Thank you for your interest in contributing to the Design Tokens Format Module! This document provides guidelines and instructions to help you get started.
- Node.js (preferably the latest LTS version)
- npm
- Fork the repository on GitHub
- Clone your fork locally
git clone https://github.com/YOUR-USERNAME/design-tokens-format-module.git cd design-tokens-format-module - Add the original repository as an upstream remote
git remote add upstream https://github.com/nclsndr/design-tokens-format-module.git
- Install dependencies
npm install
-
Create a new branch for your feature or bugfix
git checkout -b feature/your-feature-name
or
git checkout -b fix/issue-you-are-fixing
-
Make your changes and commit them using Conventional Commits
We follow the Conventional Commits specification which provides a standardized format for commit messages:
<type>([optional scope]): <description> [optional body] [optional footer(s)]Common types include:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Changes that don't affect the code's meaning (formatting, etc.)refactor: Code changes that neither fix a bug nor add a featuretest: Adding or correcting testschore: Changes to the build process or auxiliary tools
-
Keep your branch updated with the upstream main branch
git pull upstream main
This project uses Prettier for code formatting. The configuration is defined in .prettierrc.json.
Before submitting a pull request, make sure your code is properly formatted:
# Format all files
npm run format
# Check formatting without modifying files
npx prettier --check .The project uses Vitest for testing. Make sure to add tests for any new features or bug fixes.
# Run tests in watch mode during development
npm run test
# Run tests once (e.g., before submitting a PR)
npm run test -- --runTo generate a test coverage report:
npm run test -- --coverageThe project uses TypeScript for type safety and transpilation.
npm run buildThis command cleans the dist directory and rebuilds the project according to the TypeScript configuration.
To run the TypeScript compiler without emitting files (useful for checking types):
npm run tsc-
Push your changes to your fork
git push origin your-branch-name
-
Open a pull request against the main repository's
mainbranch -
Ensure your PR includes:
- A clear description of the changes
- Any relevant issue numbers (use "#123" to link to issue 123)
- Updated or new tests covering your changes
- Documentation updates if needed
-
Before opening a PR, make sure:
- Tests pass:
npm run test -- --run - The build succeeds:
npm run build - Code is properly formatted:
npm run format
- Tests pass:
Please be respectful and considerate of others when contributing to this project. We strive to maintain a welcoming and inclusive environment for everyone.
If you have any questions or need help, feel free to open an issue or reach out to @nclsndr.
Thank you for contributing to the Design Tokens Format Module!