Thank you for your interest in contributing to oui-kit! This guide will help you understand our development workflow, coding standards, and best practices.
This project has the following main products:
- A Vue3 component library (
oui-kit), source code is located in thelibfolder. - A Stylus CSS framework (
oui-kit), source code is located in thestylusfolder. - A demo application to showcase the components and framework, source code is located in the
srcfolder.
- Clone the repository
- Install dependencies:
pnpm install - Start development server:
pnpm start
- Test files: Always end with
.spec.tsand are located in the same folder as the file being tested - Component files: Use kebab-case for Vue components (e.g.,
oui-component.vue) - Utility files: Use camelCase for utility functions and modules
Code formatting and style rules are automatically enforced through:
.editorconfig- Handles basic formatting (indentation, line endings, etc.)- ESLint - Enforces code quality and style rules
Make sure your editor supports these tools and has the appropriate extensions installed:
- EditorConfig extension for your editor
- ESLint extension for your editor
- Configure your editor to format on save
- Indentation: 2 spaces (enforced by .editorconfig)
- Component files: Use kebab-case for Vue components (e.g.,
oui-component.vue)
- Always use Vue 3 with Composition API (not Options API)
- Import components automatically when used
- Use
<script setup>syntax for cleaner code
Use the zeed module for all logging needs:
// ✅ Correct logging setup
import { Logger, LoggerInterface } from 'zeed'
// Filename without suffix (e.g., for OuiComponent.ts use "oui-component")
const log: LoggerInterface = Logger('oui-component')- Use appropriate log levels:
debug,info,warn,error - Include relevant context in log messages
- Use structured logging with objects for additional data
- Logger name should match the filename without extension
A custom sanbox like environment is available for testing components. All files matching the pattern *.demo.vue will be automatically loaded and displayed in the demo environment.
Simple examples:
<script lang="ts" setup>
import { reactive } from 'vue'
import { OuiCheckbox, OuiDemo } from '../lib'
const state = reactive({
value: false,
disabled: false
})
</script>
<template>
<div>
<OuiCheckbox v-model="state.value" :disabled="disabled" />
Just a switch
</div>
<OuiDemo :state="state">
<OuiCheckbox v-model="state.disabled" title="Disabled" />
</OuiDemo>
</template>All commit messages should:
- Be lowercase
- Start with one of these prefixes:
feat:- New featuresfix:- Bug fixeschore:- Maintenance tasks
# ✅ Correct commit messages
git commit -m "feat: add user authentication component"
git commit -m "fix: resolve memory leak in data service"
git commit -m "chore: updated dependencies"
# ❌ Incorrect commit messages
git commit -m "Add user auth" # Missing prefix, not lowercase
git commit -m "Fixed bug" # Not descriptive enough- If only
package.jsonhas been updated:chore: updated dependencies
- Code follows all style guidelines
- Tests are written and passing
- Logging is implemented where appropriate
- Documentation is updated if needed
- Commit messages follow the convention
- No console.log statements (use proper logging)
- Code style and formatting
- Test coverage and quality
- Performance considerations
- Security implications
- Documentation completeness
- Accessibility compliance (for UI components)
- Check existing issues and documentation
- Ask questions in discussions
- Follow the coding standards outlined in this guide
- When in doubt, look at existing code for patterns and examples
Thank you for contributing to make oui-kit better! 🚀