-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
Conventions for making changes in @canvasflow/feed.
← Back to Home · Related: Testing · Build & Publishing
Run the checks before opening a PR:
npm run lint && npm run coverageCoverage is threshold-gated (see Testing). A pre-commit hook also formats, lints, and runs the suite on staged files.
Formatting is enforced by Vite+ (vp fmt), configured under fmt in vite.config.ts:
-
semi: true,singleQuote: true,trailingComma: 'es5',printWidth: 80. -
npm run lint(andnpm run lint:fix) lint the source;npm run formatformats the project.
Match the surrounding code: existing naming (*Component, is*Component, Mapping.* modules), the import style, and comment density.
- Keep the library pure: no I/O beyond the explicit
fetchhelpers onRSSFeed. - Don't throw for malformed input — accumulate
errors/warningsso one bad element never aborts a conversion. See Architecture. - Reuse the Zod schemas in
mapping/Mapping.schema.tsfor validation rather than re-deriving shapes. - Keep
Mapping.tsfor the recursive detection engine; put leaf concerns (constants, pure utilities, embeds) in the siblingMapping.*modules and re-export them so the public API is unchanged. - Add type guards (
is*Component) alongside new component kinds inComponent.ts.
Add or update tests next to the code (*.test.ts) and tag them (unit, rss, html). Use the fixtures under src/support/ rather than inlining large payloads. See Testing.
Use Conventional Commits, enforced by commitlint:
type(scope): subject
-
type∈feat,fix,docs,chore,refactor,test, … ;scopeoptional. - Interactive helper:
npm run commit(commitizen).
The wiki pages live in docs/wiki/. When you change behaviour, update the relevant page in the same PR — if code and docs disagree, the code wins. The wiki is published automatically on release; see Build & Publishing.
Start here
Reference
Operations