Thank you for your interest in contributing to EnvKit! This document provides guidelines and instructions for contributing to this project.
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and considerate of others.
- Node.js (v18 or later)
- Yarn (v1.22 or later)
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/envkit.git
cd envkit- Install dependencies:
yarn install- Start the development environment:
# Run the demo app
yarn workspace @envkit/nextjs-demo devEnvKit is organized as a monorepo with the following packages:
packages/envkit-core- Framework-agnostic core functionalitypackages/nextjs- Next.js integrationpackages/nextjs-demo- Demo Next.js application showcasing EnvKit
One of the most critical aspects of EnvKit is the proper separation of client and server code, especially for the Next.js package:
- Use the
server-onlypackage to mark files that should never be imported on the client - Make dynamic imports for Node.js built-in modules within function bodies
- Create separate client and server entry points
- Configure package.json exports field to properly map imports
- Avoid direct dependencies between client and server code
This approach ensures Next.js client components don't bundle server-side code that uses Node.js built-in modules.
EnvKit uses Tailwind CSS for styling components:
- Styles are defined in
src/styles/tailwind.css - The build process compiles these styles to
dist/styles.css - Components use either direct Tailwind utility classes or custom EnvKit component classes
- Create a new branch from
main:
git checkout -b feature/your-feature-name- Implement your changes
- Write tests for your changes
- Ensure all tests pass:
yarn test- Build the packages to verify your changes work in a production environment:
yarn buildWe follow conventional commits for our commit messages:
feat:- A new featurefix:- A bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code changes that neither fix bugs nor add featurestest:- Adding or modifying testschore:- Changes to the build process or auxiliary tools
Example:
feat(nextjs): add support for custom validation functions
- Update the README.md or other documentation with details of your changes, if appropriate
- Make sure your code passes all tests and linting rules
- Submit your pull request against the
mainbranch - Request a review from a maintainer
- Address any feedback from the code review
We use Jest for testing. Run the test suite with:
yarn testWhen adding new features, please add appropriate tests:
- Unit tests for utility functions
- Integration tests for API functionality
- Component tests for UI components
Documentation is a crucial part of EnvKit. When adding new features, please update:
- Code comments using JSDoc format
- README.md files in the relevant packages
- The main README.md if your change affects the public API
EnvKit is written in TypeScript. Please:
- Maintain type safety throughout the codebase
- Use explicit types rather than
any - Export public types for library consumers
For components:
- Use Tailwind CSS for styling
- Maintain responsive designs that work on various screen sizes
- Ensure accessibility (appropriate contrast, semantic HTML, etc.)
See PUBLISHING.md for details on the release process.
If you have questions about contributing, open an issue or reach out to the maintainers:
- GitHub Issues: envkit/issues
Thank you for contributing to EnvKit!