@sh1n4ps/plasma-core
v0.2.0
Published
Isomorphic schema DSL, query AST, and sync protocol types for plasma — the shared foundation @sh1n4ps/plasma-client and @sh1n4ps/plasma-server build on.
Maintainers
Readme
@sh1n4ps/plasma-core
Isomorphic schema DSL, query AST + builder, and sync protocol types for
plasma. Neither the client nor the server work without
this; both re-export the interesting pieces so most callers never import
@sh1n4ps/plasma-core directly.
Install
pnpm add @sh1n4ps/plasma-coreWhat lives here
- Schema DSL —
defineSchema,table(with declarativeauthrules), the column factories (id,text,int,bigint,boolean,blob,json,ref), and phantom-typedColumnclasses. - Row inference —
InferRow,InferInsertRow,InferUpdateRowderive TS row shapes from a schema value, including left-join null propagation for projections. - Query AST + builder —
select / from / where / innerJoin / leftJoin / orderBy / groupBy / having / limit / offset / live;insert / update / delete; operatorseq / ne / gt / gte / lt / lte / inArray / isNull / isNotNull / like / and / or / not / asc / desc; aggregatescount / sum / avg / max / min. defineMutators— the shared type factory that ties a mutation record to a schema + ctx type so the same functions run on both sides.- Sync protocol types —
PushRequest,PullRequest,PullResponse,MutationEnvelope,ChangeOp,PROTOCOL_VERSION.
Runtime footprint
Pure TypeScript, no runtime dependencies. Ships ESM + CJS + both .d.ts
flavors, so it works from Node, browsers, and Cloudflare Workers.
