The frozen cross-repo contract surface for the yardius
extension, per the Sneat repository-naming standard:
every Sneat extension is two repos — <id> (implementation) and ext-<id>
(the public extension-definition repo other repos import).
This repo holds the shared DTOs, consts, and briefs that both surfaces of the yardius extension depend on.
Every shared DTO must resolve from the @sneat/extension-yardius-contract package — no
duplicate DTO definitions are allowed in the yardius implementation repo.
The shared cross-repo surface is exported from frontend/src/index.ts — see
frontend/src/lib/
for the individual modules and their *.spec.ts round-trip and table-driven
tests:
- the Listing DTO (
IListingDto, discriminated by typeborrow/giveaway; references the Assetus asset by ID only — no duplicated ownership fields) inlisting.ts; - listing visibility (
private/members/friends, defaultmembers) and the Assetus-visibility ceiling mapping as shared data (LISTING_VISIBILITY_CEILING,allowedListingVisibilities,isListingVisibilityAllowed) inlisting-visibility.ts/assetus-visibility.ts; - the borrow (
available → requested → approved → borrowed → returned → closed) and give-away (available → claimed → transferred → closed) lifecycle state enums with their legal-transition tables and purecanTransition*helpers inborrow-state.ts/giveaway-state.ts/state-transitions.ts; - transaction-log entry DTO and the exact event-type set (publish, request,
withdraw, approve, decline, handover, return, claim, transfer, cancel) in
transaction-log.ts; - the request/claim shape (
IListingRequestDto) inlisting-request.ts; - the listings-endpoint request/response contract (auth-implied request;
response grouped/labelled by owning Space, member + direct-friend scope
only) in
listings-endpoint.ts.
Changes here are breaking changes for every consumer. Keep the surface minimal,
additive, and versioned; implementation details stay in the yardius repo.
The contract is a small Nx project (ext-yardius-contract) in frontend/.
pnpm exec nx build ext-yardius-contract emits the Node ESM package to
frontend/dist/; tests and type-checking run from that same directory. Pushes
to main use the shared Sneat npm workflow and nx release to version,
publish, tag, and push the contract release.