Contributing
Contributing
Thank you for your interest in contributing to Nuxt Upload Kit! This guide will help you get started with development.
Prerequisites
Before you begin, ensure you have:
Development Setup
Fork and Clone
Fork the repository on GitHub, then clone your fork:
git clone https://github.com/YOUR_USERNAME/nuxt-upload-kit.git
cd nuxt-upload-kit
Install Dependencies
pnpm install
Prepare Environment
pnpm dev:prepare
Start Development Server
pnpm dev
This starts a playground application where you can test your changes in real-time.
Project Structure
nuxt-upload-kit/
├── src/
│ ├── module.ts # Nuxt module entry point
│ └── runtime/
│ ├── types/index.ts # Exported types
│ └── composables/
│ ├── useUploadKit/ # Main composable
│ │ ├── index.ts # Core upload manager
│ │ ├── types.ts # Type definitions
│ │ ├── validators/ # Validation plugins
│ │ └── plugins/ # Processing plugins
│ │ └── storage/ # Storage adapters
│ └── useFFMpeg.ts # FFmpeg composable
├── playground/ # Development playground
├── docs/ # Documentation site
└── test/ # Test files
Available Commands
| Command | Description |
|---|---|
pnpm dev | Start dev server with playground |
pnpm dev:prepare | Prepare development environment |
pnpm test | Run tests once |
pnpm test:watch | Run tests in watch mode |
pnpm test:types | Type-check with vue-tsc |
pnpm lint | Run ESLint |
pnpm lint:fix | Fix ESLint issues |
pnpm format | Format with Prettier |
pnpm docs:dev | Run documentation site locally |
pnpm prepack | Build the module |
Code Style
This project uses ESLint and Prettier with the following conventions:
- No semicolons
- Double quotes
- Trailing commas
- 130 character line width
- TypeScript throughout
pnpm lint:fix && pnpm format before committing to ensure your code matches the project style.Making Changes
Create a Branch
Create a descriptive branch for your changes:
git checkout -b feature/my-new-feature
# or
git checkout -b fix/issue-description
Writing Tests
Tests are located in the test/ directory and use Vitest. Please include tests for any new features or bug fixes.
pnpm test # Run once
pnpm test:watch # Watch mode
Type Checking
Ensure your changes pass type checking:
pnpm test:types
Creating Plugins
One of the best ways to contribute is by creating new plugins. See the Custom Plugins and Custom Storage Adapters guides for detailed instructions.
Validator Plugin Example
export const ValidatorExample = defineProcessingPlugin<{ option: string }>((options) => ({
id: "validator-example",
hooks: {
validate: async (file, context) => {
// Return file to pass, throw to reject
return file
},
},
}))
Storage Plugin Example
export const PluginStorageExample = (options: Options): StoragePlugin => ({
id: "storage-example",
hooks: {
upload: async (file, context) => {
// Upload logic, call context.onProgress(0-100)
return { url: "...", ...metadata }
},
getRemoteFile: async (fileId, context) => {
return { size, mimeType, remoteUrl }
},
remove: async (file, context) => {
// Delete from storage
},
},
})
Documentation
Documentation lives in the docs/ directory and uses Docus.
To run the documentation site locally:
pnpm docs:dev
When adding new features, please update the relevant documentation.
Submitting a Pull Request
Verify Your Changes
Before submitting, ensure:
pnpm test # All tests pass
pnpm lint:fix # No linting errors
pnpm format # Code is formatted
pnpm test:types # Types are correct
Push and Create PR
Push your branch and create a pull request on GitHub:
git push origin feature/my-new-feature
Describe Your Changes
Provide a clear description including:
- What changes you made
- Why you made them
- Any related issues
Commit Message Guidelines
Use clear, descriptive commit messages:
| Prefix | Use Case |
|---|---|
feat: | New features |
fix: | Bug fixes |
docs: | Documentation changes |
refactor: | Code refactoring |
test: | Adding or updating tests |
chore: | Maintenance tasks |
Examples:
feat: add new storage adapter for S3fix: resolve thumbnail generation for large imagesdocs: update configuration guide
Reporting Issues
When reporting issues, please include:
- Your Node.js and pnpm versions
- Your Nuxt version
- Steps to reproduce the issue
- Expected vs actual behavior
- Any error messages or logs
Questions?
If you have questions about contributing, feel free to open an issue or start a discussion on GitHub.
License
By contributing to Nuxt Upload Kit, you agree that your contributions will be licensed under the MIT License.

