subzerodev-data-json
v0.2.0
Published
Source-agnostic JSON loader for TypeScript. Read-only.
Readme
SubZeroDev.Data.Json
A source-agnostic JSON loader for TypeScript, published as subzerodev-data-json.
One call site reads a named JSON payload. Where it comes from — a bundled import, a file on disk, an HTTP endpoint — and when it resolves — at build time or at runtime — are declared in configuration, not at the call site.
Browser and server are co-equal consumers. The package is read-only.
subzerodev-data-json
. core load · sources · result · reasons · cache · canonical · digest
/node Node file source (mtime-cached) · source-map reader · yaml→json CLI · GET-only express mount
/react React JsonProvider · useJson · JsonBoundary
/zod zod zodValidator
/build build prefetch · json.lock · public/server gateStatus
The core and four environments are implemented. J1 and J10–J12 (core), J2 (/node),
J3 (/build), J5 (/zod), J4 (/react), and J13 (the /node source-map reader) are
merged. /react was blocked on
design/20-contract.md §12 U1; the loader arrives through a
JsonProvider context (design/90-decisions.md D53).
design/30-slices.md carries the running order and what remains.
The specs
Read in order.
| File | Owns |
|---|---|
| design/00-brief.md | What this is, why it exists, consumers, binding constraints, non-goals, MVP, definition of done |
| design/10-design.md | Architecture with rationale — the layered core, sources, at:, caching, errors, validation, config split, digest |
| design/20-contract.md | Exact types, configuration and lockfile shapes, subpath exports, and the thirty-six invariants |
| design/30-slices.md | Ordered work units J1–J9 with acceptance criteria |
| design/90-decisions.md | Every decision with rationale and reversal cost; deferred items; open register |
In one paragraph
The pattern already exists five times across Docs-Template, Portfolio/api, and Data —
four HTTP paths with no two alike, three unrelated cache policies, one validator applied
only to the local data that needs it least, and two verbatim copies of the same
provider-selection function. JSON is about to be read in more places, not fewer. This
package is one implementation of the pipeline every one of those was reaching for, with the
environment behind ports so the same core runs in a browser, in Express, and eventually
inside a deterministic game engine that bans Date.now.
