Thank you for your interest in contributing to Expressive Tea! π
This document provides guidelines for contributing to the @expressive-tea/commons and @expressive-tea/plugin packages.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Submitting Changes
- Coding Standards
- Project Structure
This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to support@expressive-tea.io.
- Node.js >= 18.0.0
- Yarn 4.11.0 (package manager)
- Git for version control
- TypeScript >= 5.0.0 knowledge
- Browse existing issues
- Look for
good-first-issueorhelp-wantedlabels - Comment on the issue to let others know you're working on it
- Not sure about something? Ask in Discussions
- Need help? Check our Support Guide
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/expresive-tea.git
cd expresive-tea/packages# Enable Corepack (for Yarn 4)
corepack enable
# Install dependencies
yarn install# Clean and build all packages
yarn clean && yarn build# Run all tests
yarn test
# Run tests in watch mode
yarn test:watch
# Run tests with coverage
yarn test# Lint code
yarn lint
# Type check
npx tsc --noEmit -p packages/commons
npx tsc --noEmit -p packages/plugin# Create a new branch from master
git checkout -b feature/my-new-feature
# or
git checkout -b fix/my-bug-fixBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test updateschore/- Build/tooling changes
- Write code following our coding standards
- Add tests for new functionality
- Update documentation (JSDoc, README, etc.)
- Run tests to ensure everything works
- Lint your code to catch style issues
Follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting)refactor:- Code refactoringtest:- Test updateschore:- Build/tooling changes
Examples:
feat(plugin): add support for async stage methods
Added ability to use async/await in @Stage decorated methods.
This allows plugins to perform asynchronous operations during
boot stages.
Closes #123fix(commons): resolve metadata memory leak in WeakMap
Fixed issue where metadata storage was not properly garbage
collected due to strong references.
Fixes #456- Place tests in
packages/*/src/__test__/unit/directory - Name test files as
*.spec.ts - Follow existing test patterns
- Aim for >90% code coverage
Example test:
import { Metadata } from '../../classes/Metadata';
describe('Metadata', () => {
describe('set and get', () => {
it('should store and retrieve metadata', () => {
class TestClass {}
Metadata.set('test-key', 'test-value', TestClass);
const result = Metadata.get('test-key', TestClass);
expect(result).toBe('test-value');
});
});
});# Run all tests
yarn test
# Run specific package tests
cd packages/commons && yarn test
cd packages/plugin && yarn test
# Run specific test file
npx jest packages/commons/src/__test__/unit/metadata.spec.ts
# Run with coverage
yarn test --coverageEnsure your changes pass all checks:
# 1. Clean and build
yarn clean && yarn build
# 2. Run linter
yarn lint
# 3. Run all tests
yarn test
# 4. Type check
npx tsc --noEmit -p packages/commons
npx tsc --noEmit -p packages/plugin-
Push your branch to your fork
git push origin feature/my-new-feature
-
Open a Pull Request on GitHub
- Use our PR template
- Link related issues
- Provide clear description
- Add screenshots (if applicable)
-
Wait for review
- Address review comments
- Keep PR updated with master
- Be patient and respectful
- Automated checks run (tests, linting, build)
- Maintainer review (code quality, design, tests)
- Revisions if needed
- Approval and merge
- Use TypeScript 5.x features
- Enable strict mode
- Prefer interfaces over type aliases for objects
- Use explicit return types for public methods
- Avoid
anyexcept in tests or reflect-metadata contexts
- Prettier formats all code (120 char line length)
- ESLint enforces code quality rules
- Use 2 spaces for indentation
- Use single quotes for strings
- Include semicolons
- No trailing commas
- Add JSDoc to all public APIs
- Include @param, @returns, @since tags
- Provide @example code blocks
- Use TypeScript in examples
Example:
/**
* Store metadata on a class or property
*
* @param key - Metadata key identifier
* @param value - Value to store
* @param target - Target class constructor
* @param propertyKey - Optional property name
* @since 2.0.0
*
* @example
* ```typescript
* Metadata.set('my-key', 'value', MyClass);
* ```
*/
static set(key: string, value: any, target: any, propertyKey?: string): void {
// ...
}- Use kebab-case for file names:
object-helper.ts - Test files end with
.spec.ts - Keep files focused and single-purpose
packages/
βββ .github/ # GitHub templates
βββ packages/
β βββ commons/ # @expressive-tea/commons
β β βββ src/
β β β βββ classes/
β β β βββ helpers/
β β β βββ interfaces/
β β β βββ types/
β β β βββ __test__/unit/
β β βββ dist/ # Build output (gitignored)
β β βββ package.json
β β βββ tsconfig.json
β β βββ jest.config.js
β βββ plugin/ # @expressive-tea/plugin
β βββ src/
β β βββ classes/
β β βββ decorators/
β β βββ helpers/
β β βββ libs/
β β βββ exceptions/
β β βββ __test__/unit/
β βββ dist/ # Build output (gitignored)
β βββ package.json
β βββ tsconfig.json
β βββ jest.config.js
βββ package.json # Root workspace config
βββ jest.config.js # Root test config
βββ eslint.config.js # ESLint v9 flat config
βββ tsconfig.base.json # Shared TS config
βββ README.md
- π¬ Gitter Chat
- π‘ GitHub Discussions
- π§ Email: support@expressive-tea.io
Contributors are recognized in:
- Project README
- Release notes
- GitHub contributors page
Thank you for contributing to Expressive Tea! π
Your efforts help make this project better for everyone.