Conventions
Review-enforced rules in vetro. These are checked by automated review, enforced by lint where automatable, and verified by humans on every PR.
Public API surface
package.json exports map:
vetro-ui→src/entries/index.ts— default export is a Vue plugin installer.vetro-ui/ui— components only.vetro-ui/utilsvetro-ui/typesvetro-ui/style.cssvetro-ui/web-components/*— individual compiled web components.
When adding a new public export, update the matching src/entries/*.ts file. Internal helpers must not leak into entry files.
TypeScript
Strict config with noUncheckedIndexedAccess, verbatimModuleSyntax, etc. Rules:
- No
any. Useunknownat boundaries and narrow. import typefor type-only imports.- Component props and emits via
defineProps<{...}>()anddefineEmits<{ event: [payload] }>(). - Named exports by default. Default exports allowed for Vue SFCs, Storybook stories, and config files.
@/resolves tosrc/.
Cross-feature imports
Cross-feature imports must go through features/<feature>/index.ts. Do not reach into another feature's internal paths.
Post-change verification (mandatory)
sh
vp run task:pre-commit # vp staged — lint + format + cspell (husky pre-commit)
vp run task:pre-push # vp check && task:css:check && task:test (husky pre-push)Run vp run task:pre-push before declaring work complete.
- Tests —
vp run task:testorvp test. - Lint —
vp lint .. - Format —
vp fmt . --check. - Spelling —
pnpm spellcheck. - Type-check —
pnpm typecheck. - CSS bundle check —
vp run task:css:checkafter touching SFCs or UnoCSS strings. Fix with:uno:prefix or@unocss-skip-start/@unocss-skip-end— never loosen the validator. - Web-component build — if the component has
.webc.ts, runvp run task:build:webc. - Changeset — for user-visible changes, run
pnpm changeset. See Changesets.
Hard boundaries
- NEVER install
vitest,oxlint, oroxfmtdirectly — usevite-plus. - NEVER import from
viteorvitestdirectly — usevite-plus/vite-plus/test. - NEVER use
npmoryarn. Usepnpm(orvp add/vp remove). - NEVER commit secrets or
.envfiles. - NEVER bypass git hooks with
--no-verify. - NEVER edit
package.jsonversion orCHANGELOG.mdby hand. - NEVER write hardcoded
<Teleport to="body">in webc-shipped components. - ALWAYS co-locate
.test.tsand.stories.tsnext to a new component. - ALWAYS route cross-feature imports through
features/<feature>/index.ts. - ALWAYS add a changeset for user-visible changes.