Packages narrative
packages / tagtree / core
tagtree / core
Functions
| Name | Description |
|---|---|
runAdapterContract | Registers a Vitest |
compose | Chains multiple |
computeFanout | Expands a single entity reference into its full set of invalidation tags, from the most-specific leaf tag down to the namespace root, following the hierarchy declared in the schema. |
createCacheInstance | Wires a |
defineCache | Validates and freezes a cache schema definition, rejecting namespace or entity names that contain |
encodeSegment | Encodes a single cache-key segment so it is safe to join with |
joinSegments | Combines an ordered list of raw segments into a dotted-path cache tag, encoding each segment before joining so no raw value can break the path structure. |
memoryAdapter | Creates a synchronous, in-process |
Interfaces
| Name | Description |
|---|---|
ContractTestOptions | Configuration passed to |
AdapterCtx | Runtime context passed to every adapter operation, carrying the schema definition and a logger so adapters can emit structured diagnostics tied to the call site. |
CacheAdapter | Contract that every cache backend must implement to integrate with tagtree's tag-aware invalidation model. Adapters are responsible for storage, tag-index maintenance, and optional features like response decoration or native wrap delegation. |
CacheInstance | Fully-typed runtime handle returned by |
CacheKey | Structured cache-key object produced by a |
CacheSchema | Opaque wrapper returned by |
CacheSchemaShape | Fully-resolved schema descriptor held at runtime; carries namespace, optional tenant and qualifier configs, and the entity declarations that drive key building and fanout expansion. |
EntityDecl | Declares a single entity within a cache schema, specifying the optional params it accepts for leaf-level key building and the parent entity names whose cache entries should also be invalidated when this entity is purged. |
FanoutInput | Arguments to |
ILogger | Minimal structured-log interface that cache adapters and the instance internals use to report events without pulling in a concrete logging dependency. |
MemoryAdapterOptions | Configuration for the in-process memory adapter; controls the LRU eviction ceiling so memory use stays bounded in long-running processes. |
QualifierConfig | Declares how a qualifier value (e.g., a locale or currency code) appends a |
TenantConfig | Declares how a tenant value maps to a cache-key prefix; the |
WrapOpts | Per-call options for |
WriteOpts | Options that govern how a cache entry is stored; controls TTL expiry, stale-while-revalidate behavior, and a staleness-guard timestamp that prevents a racing webhook from being overwritten by a fetch that started before the invalidation arrived. |
Types
| Name | Description |
|---|---|
Brand | Nominal branding wrapper that makes otherwise structurally equivalent types distinguishable at the type level; used to prevent |
EntitiesMap | Constraint type for the |
InvalidateNamespace | Typed invalidation surface generated from a |
KeyFactory | Per-entity key builder map derived from a |
ParamMap | Type constraint for the |
ParamType | Union of the two supported cache-key param kinds ( |
ParamTypeShape | Unwraps a |
ParamValues | Converts a |
Variables
| Name | Description |
|---|---|
consoleLogger | Ready-made |
num | Brand token that marks a |
str | Brand token that marks a |
toReactNodes
Parses a Shopifyorigin HTML string and returns a React node tree suitable for direct rendering, normalizing HTML attributes and optionally replacing tags with c
AdapterCtx
Runtime context passed to every adapter operation, carrying the schema definition and a logger so adapters can emit structured diagnostics tied to the call site