Contributing to LiteForm
September 25, 2025 · View on GitHub
Thank you for your interest in contributing to LiteForm! This document provides guidelines and information for contributors.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Contributing Guidelines
- Component Development
- Testing
- Documentation
- Submitting Changes
Code of Conduct
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Our Standards
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
Getting Started
Prerequisites
- Node.js (v18 or higher)
- npm (ships with Node) or yarn
- Angular CLI (v17 or higher)
- Git
Installation
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/lite-form.git cd lite-form - Install dependencies:
npm install - Start the development server:
npm start
Development Setup
Project Structure
lite-form/
├── projects/
│ ├── lite-form/ # Main library
│ │ ├── src/
│ │ │ ├── lib/ # Component implementations
│ │ │ └── public-api.ts # Public exports
│ │ └── package.json
│ └── ui-sandbox/ # Testing application
│ └── src/
│ └── app/ # Demo components
├── docs/ # Documentation
├── scripts/ # Build and utility scripts
└── package.json # Root configuration
Build Commands
npm start- Start development server with ui-sandboxnpm run build- Build the librarynpm run test- Run unit testsnpm run test:watch- Run tests in watch modenpm run lint- Run linting for all configured projectsnpx ng lint lite-form- Lint the library onlynpx ng lint ui-sandbox- Lint the demo applicationnpm run build:lib- Build library only
Contributing Guidelines
Issue Reporting
Before creating an issue, please:
- Search existing issues to avoid duplicates
- Use the appropriate issue template
- Provide clear reproduction steps
- Include environment information (Angular version, browser, etc.)
Feature Requests
When requesting features:
- Explain the use case and problem being solved
- Provide examples of desired API/usage
- Consider backwards compatibility
- Discuss implementation approach if possible
Pull Requests
- Create a feature branch from
main - Make your changes following our coding standards
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass
- Submit a pull request with clear description
Component Development
Creating New Components
When adding new components, follow these guidelines:
1. Component Structure
@Component({
selector: 'lite-{component-name}',
standalone: true,
imports: [CommonModule, ReactiveFormsModule],
templateUrl: './{component-name}.html',
styleUrls: ['./{component-name}.scss', '../lite-styles.scss']
})
export class Lite{ComponentName}Component {
@Input() control!: FieldDto | SelectFieldDto | DateRangeFieldDto;
@Input() inEdit: boolean = true;
// Component implementation
}
2. DTO Integration
Ensure your component works with appropriate DTOs:
// For simple inputs
FieldDto
// For selections
SelectFieldDto
// For multiple selections
MultiSelectFieldDto
// For date ranges
DateRangeFieldDto
3. Accessibility Requirements
All components must include:
- Proper ARIA labels and descriptions
- Keyboard navigation support
- Screen reader compatibility
- Focus management
- High contrast support
4. Styling Guidelines
Follow our SCSS structure:
.lite-{component} {
&.in-edit {
// Edit mode styles
.label {
// Label styles
}
input, select, textarea {
// Input styles
}
&.error {
// Error state styles
}
}
&.display {
// Display mode styles
}
}
Styling Standards
- Use the space-saving SCSS format outlined in
docs/STYLEGUIDE.md - Follow existing color scheme and spacing
- Ensure responsive design across component breakpoints
- Test across different browsers
- Use CSS custom properties for theming when appropriate
SCSS Style Guide
- Keep declarations compact, grouping related properties when practical
- Prefer shorthand syntax for margin, padding, border, and background
- Limit nesting depth and keep selectors concise
- Reference
docs/STYLEGUIDE.mdbefore submitting style updates
Performance Considerations
- Use computed signals for expensive calculations
- Implement OnPush change detection when appropriate
- Minimize DOM manipulations
- Use trackBy functions for ngFor loops
- Consider lazy loading for heavy components
Testing
Unit Tests
All components require comprehensive unit tests:
describe('Lite{Component}Component', () => {
let component: Lite{Component}Component;
let fixture: ComponentFixture<Lite{Component}Component>;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [Lite{Component}Component]
});
fixture = TestBed.createComponent(Lite{Component}Component);
component = fixture.componentInstance;
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should handle form control updates', () => {
// Test FormControl integration
});
it('should validate accessibility', () => {
// Test ARIA attributes, keyboard navigation
});
});
Test Coverage Requirements
- Minimum 90% code coverage
- Test all user interactions
- Test error conditions
- Test accessibility features
- Test integration with FormControl
Integration Tests
- Test components within the ui-sandbox application to ensure real-world functionality.
- Validate SCSS changes against the sandbox to confirm style guide compliance.
Component Highlights
LitePaneldelivers modal-style panels with configurable templates and action buttons.- Demo usage lives in
projects/ui-sandbox/src/app/app.htmland includes confirmation and information workflows. - Reuse the shared DTOs (
LitePanelAction, etc.) exported viaprojects/lite-form/src/public-api.ts.
Documentation
Code Documentation
- Use JSDoc for public APIs
- Include examples in component documentation
- Document complex algorithms and business logic
- Keep comments up-to-date with code changes
API Documentation
Update the following files when adding features:
docs/API.md- Component APIs and interfacesdocs/EXAMPLES.md- Usage examplesdocs/README.md- Overview and quick startdocs/MIGRATION.md- Breaking changes and migration paths
Example Format
/**
* A date picker component supporting single dates and date ranges
*
* @example
* ```typescript
* // Single date
* dateField = new FieldDto('Event Date', new FormControl(''));
* ```
*
* @example
* ```html
* <lite-date [control]="dateField" format="dd/MM/yyyy"></lite-date>
* ```
*/
@Component({...})
export class LiteDateComponent {
/**
* The field configuration and FormControl
*/
@Input() control!: FieldDto | DateRangeFieldDto;
/**
* Date format for display (dd/MM/yyyy, MM/dd/yyyy, yyyy-MM-dd)
* @default 'dd/MM/yyyy'
*/
@Input() format: string = 'dd/MM/yyyy';
}
Submitting Changes
Commit Messages
Use conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(date): add range selection supportfix(select): resolve keyboard navigation issuedocs(api): update component documentation
Pull Request Process
- Update documentation for any public API changes
- Add tests for new functionality
- Ensure all existing tests pass
- Update CHANGELOG.md with your changes
- Request review from maintainers
- Address review feedback promptly
Release Process
- Update version numbers in package.json files
- Update CHANGELOG.md with release notes
- Create release tag
- Publish to npm registry
- Update GitHub releases
Getting Help
- Check existing documentation in the
docs/folder - Review existing components for patterns and examples
- Ask questions in GitHub Discussions
- Join our community chat (if available)
- Contact maintainers for guidance on complex contributions
Recognition
Contributors will be recognized in:
- CHANGELOG.md for significant contributions
- README.md contributors section
- GitHub contributors graph
- Release notes for major contributions
Thank you for contributing to LiteForm!