Skip to main content

@riftseer/types

@riftseer/types is a zero-dependency package that owns the canonical Riftbound card types, the [[Card Name]] token parser, and the icon token map. It is the single source of truth for the card data shape across the entire monorepo.

Because it has no runtime dependencies it can be imported in any environment — Bun, Node, Cloudflare Workers, and browser builds alike.


Why a separate package?​

@riftseer/core carries heavy server-side dependencies (Supabase client, etc.). Any package that only needs types or the parser — the Discord bot, the ingest worker, external tooling — can import @riftseer/types directly without pulling in those transitive dependencies.

@riftseer/core re-exports everything from @riftseer/types, so existing code that imports from @riftseer/core continues to work unchanged.


What's in this package​

ModuleFilePurpose
Card typessrc/card.tsCard, all sub-interfaces, CardRequest, ResolvedCard, CardSearchOptions
Deck modelsrc/deck.ts, src/deck-validate.ts, src/deck-text.tsZone vocabulary, zoneForCard(), validateDeck(), text import/export
Parsersrc/parser.tsparseCardRequests() and normalizeCardName()
Render kernelsrc/render/tokenizeCardTextLine(), normalizeCardTextLayout(), domains, type line, site URLs

Exports​

// Default export — everything in one import
import type { Card, CardRequest, ResolvedCard } from "@riftseer/types";
import { parseCardRequests, normalizeCardName } from "@riftseer/types";

// Sub-path exports (tree-shakeable)
import { tokenizeCardTextLine, cardTypeLine } from "@riftseer/types/render";
import { parseCardRequests, normalizeCardName } from "@riftseer/types/parser";

Usage from @riftseer/core​

If you are already importing from @riftseer/core you do not need to change anything. Core re-exports the full surface of @riftseer/types:

// These continue to work — core re-exports from @riftseer/types
import type { Card, CardRequest } from "@riftseer/core";
import { parseCardRequests } from "@riftseer/core";

Import from @riftseer/types directly when you want to avoid the server-side dependencies that @riftseer/core carries.