Thank you for your interest in contributing to Nuxt Upload Kit! This guide will help you get started.
-
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/nuxt-upload-kit.git cd nuxt-upload-kit -
Install dependencies
pnpm install
-
Prepare the development environment
pnpm dev:prepare
-
Start the development server
pnpm dev
This starts a playground application where you can test your changes.
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
| 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 |
This project uses ESLint and Prettier for code formatting:
- No semicolons
- Double quotes
- Trailing commas
- 130 character line width
- TypeScript throughout
Run pnpm lint:fix and pnpm format before committing to ensure your code matches the project style.
Create a descriptive branch for your changes:
git checkout -b feature/my-new-feature
# or
git checkout -b fix/issue-descriptionTests are located in the test/ directory and use Vitest. Run tests with:
pnpm test # Run once
pnpm test:watch # Watch modePlease include tests for any new features or bug fixes.
Ensure your changes pass type checking:
pnpm test:typesUse clear, descriptive commit messages:
feat: add new storage adapter for S3fix: resolve thumbnail generation for large imagesdocs: update configuration guiderefactor: simplify plugin registrationtest: add tests for video compression
export const ValidatorExample = defineProcessingPlugin<{ option: string }>((options) => ({
id: "validator-example",
hooks: {
validate: async (file, context) => {
// Return file to pass, throw to reject
return file
},
},
}))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
},
},
})See the Custom Plugins documentation for more details.
Documentation lives in the docs/ directory and uses Docus.
To run the documentation site locally:
pnpm docs:devWhen adding new features, please update the relevant documentation.
- Ensure all tests pass:
pnpm test - Ensure code is properly formatted:
pnpm lint:fix && pnpm format - Ensure types are correct:
pnpm test:types - Push your branch and create a pull request
- Provide a clear description of your changes
- Link any related issues
When reporting issues, please include:
- Your Node.js version
- Your pnpm version
- Your Nuxt version
- Steps to reproduce the issue
- Expected vs actual behavior
- Any error messages or logs
If you have questions about contributing, feel free to open an issue or start a discussion.
By contributing to Nuxt Upload Kit, you agree that your contributions will be licensed under the MIT License.