We are delighted that you are considering contributing to our project. Your contributions are invaluable in helping us improve and grow. Thank you for taking the time to contribute!
- Fork the repository by clicking the fork button at the top of the page.
- Clone your fork:
git clone https://github.com/<your-username>/motion-vue.git
cd motion-vuepnpm installBuilding the motion package is essential before development. This compiles the latest code and generates the necessary build artifacts.
pnpm buildNote: Plugin builds happen automatically after the motion build via the
afterBuildhook.
To start the playground for interactive testing:
pnpm playThis starts the Nuxt playground on port 3001.
For the Vite playground (used by E2E tests):
pnpm play:viteThis starts on port 5173.
For watch mode on the motion package (auto-rebuilds on changes):
pnpm devTip: If the playground doesn't reflect your changes, make sure you ran
pnpm buildfirst.
motion-vue/
├── packages/
│ ├── motion/ # Core motion library (published as `motion-v`)
│ └── plugins/ # Nuxt module and unplugin-vue-components resolver
├── playground/
│ ├── nuxt/ # Nuxt playground (pnpm play, port 3001)
│ └── vite/ # Vite playground for E2E tests (port 5173)
└── tests/ # E2E tests (Playwright)
| Command | Description |
|---|---|
pnpm dev |
Watch mode for the motion package |
pnpm build |
Build the motion package and plugins |
pnpm play |
Start the Nuxt playground |
pnpm play:vite |
Start the Vite playground (port 5173) |
| Command | Description |
|---|---|
pnpm test |
Run unit tests (Vitest) |
pnpm test:e2e |
Run E2E tests (Playwright) |
You can also run a single test file:
pnpm --filter motion-v test <test-file-name>This project uses Conventional Commits. Commit messages are validated by commitlint via a git hook.
Examples:
feat: add spring animation support
fix: resolve layout animation flicker
docs: update AnimatePresence usage guide
chore: bump dependencies
- pre-commit: Runs ESLint auto-fix on staged
*.{js,ts,vue}files vialint-staged - commit-msg: Validates commit message format via
commitlint
Git hooks are set up automatically via simple-git-hooks when you run pnpm install. If hooks aren't working, run:
pnpm prepare- Unit tests: Add test files in
__tests__directories co-located with the source code. Tests use Vitest with Vue Test Utils in a JSDOM environment. - E2E tests: Add test files in the root
/testsdirectory using Playwright. E2E tests run against the Vite playground (port 5173) on Chromium and WebKit.