|
| 1 | +# Copilot Instructions for @vingy/vue-utilities |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +Vue utilities monorepo with independently-versioned packages: |
| 6 | +- **vuebugger**: Vue devtools plugin for debugging composables and reactive state |
| 7 | +- **vueltip**: Headless tooltip component with smart visibility detection |
| 8 | +- **shared**: Internal shared types/utilities (`@vingy/shared`) |
| 9 | + |
| 10 | +## Monorepo Stack |
| 11 | + |
| 12 | +- **pnpm workspaces** with catalog protocol for centralized versions |
| 13 | +- **tsdown** for ESM-only builds with `.d.mts` types |
| 14 | +- **Vitest** with dual projects: unit tests (Node) + browser tests (Browser/Playwright) |
| 15 | +- **oxlint** + **oxfmt**: single quotes, no semis, 60 char width |
| 16 | + |
| 17 | +## Skills Guide |
| 18 | + |
| 19 | +**When you need to...** |
| 20 | +- **Write tests**: Read [Testing Decisions](./skills/testing-decisions.md) - decision tree for test type, anti-patterns, implementations |
| 21 | +- **Manage state**: Read [State Management](./skills/state-management.md) - singleton patterns, cleanup strategies, scope awareness |
| 22 | +- **Organize files**: Read [Package Structure](./skills/package-structure.md) - exports, dependencies, file creation rules |
| 23 | +- **Build features**: Read [Common Workflows](./skills/common-workflows.md) - step-by-step guides, debugging, code style |
| 24 | +- **Use types safely**: Read [Type Patterns](./skills/type-patterns.md) - type guards, branded types, generics, ambient declarations |
| 25 | +- **Avoid common mistakes**: Read [Common Pitfalls](./skills/common-pitfalls.md) - listener cleanup, export rules, test environments |
| 26 | +- **Debug issues**: Read [Debugging Strategies](./skills/debugging-strategies.md) - Vitest UI, spies, state inspection, linting errors |
| 27 | +- **Improve instructions**: Read [Instruction Validation & Refinement](./skills/instruction-validation.md) - validate patterns, cross-check skills, self-improvement workflow |
| 28 | + |
| 29 | +## Available Scripts |
| 30 | + |
| 31 | +| Command | Purpose | |
| 32 | +|---------|---------| |
| 33 | +| `pnpm test` | Run all tests (unit + browser) | |
| 34 | +| `pnpm build` | Build all packages | |
| 35 | +| `pnpm dev` | Watch mode for all packages | |
| 36 | +| `pnpm lint` | Run oxlint | |
| 37 | +| `pnpm format` | Format with oxfmt | |
| 38 | +| `pnpm changeset` | Create changelog entry after changes | |
| 39 | + |
| 40 | +## Before Committing |
| 41 | + |
| 42 | +- [ ] Tests pass: `pnpm test` |
| 43 | +- [ ] No lint errors: `pnpm lint` |
| 44 | +- [ ] Code formatted: `pnpm format` |
| 45 | +- [ ] Changeset created: `pnpm changeset` or manually in `.changeset/*.md` (if not docs-only) |
| 46 | +- [ ] Demo updated (if user-facing feature) |
| 47 | + |
| 48 | +## Key Files to Follow |
| 49 | + |
| 50 | +**Testing:** [registry.unit.test.ts](../packages/vuebugger/src/registry.unit.test.ts), [directive.browser.test.ts](../packages/vueltip/src/directive.browser.test.ts) |
| 51 | + |
| 52 | +**State:** [registry.ts](../packages/vuebugger/src/registry.ts), [state.ts](../packages/vueltip/src/state.ts) |
| 53 | + |
| 54 | +**Package exports:** [vuebugger/index.ts](../packages/vuebugger/src/index.ts), [vueltip/index.ts](../packages/vueltip/src/index.ts) |
| 55 | + |
| 56 | +## Core Patterns |
| 57 | + |
| 58 | +- **Dev-only code**: Guard with `import.meta.env.DEV` (stripped in prod) |
| 59 | +- **Module singletons**: Maps for tracking, refs for reactive state |
| 60 | +- **Cleanup**: `onScopeDispose()` in composables, directive hooks for listeners |
| 61 | +- **Tree-shaking**: ESM-only, flat package structure, no subdirectories in src/ |
| 62 | + |
0 commit comments