@propeller-commerce/propeller-v2-core-ui
v0.2.4
Published
Framework-agnostic core for Propeller Commerce UI packages — pure TS types, normalizers, SDK service factory, and the Result<T> contract. Consumed by propeller-v2-vue-ui and propeller-v2-react-ui.
Keywords
Readme
propeller-v2-core-ui
Framework-agnostic core for the Propeller Commerce UI packages.
Pure TypeScript — no Vue, no React, no browser APIs. Safe to import from any runtime (Node SSR, build scripts, tests). Consumed by:
What lives here
| Surface | Purpose |
|---|---|
| types/ | Domain shapes (auth, cart, company, favorites, orders, pagination, product) plus the Result<T, E> contract |
| utils/ | Pure helpers: formatting, attribute extraction, user identity (Contact vs Customer), countries, language resolution, JSON-LD builders, video URL normalization, visibility helpers, truncation, inventory status, label fallback |
| services/ | createServices(client) — the single SDK seam, memoized per GraphQLClient. Plus toPlain for normalizing class-instance serialization. |
The Result<T, E> discriminated union is the package-wide contract for
mutations. Reads throw; writes return Result.
Install
npm install github:propeller-commerce/propeller-v2-core-ui#masterPeer dep: propeller-sdk-v2.
Build
npm install
npm run build # tsup → dist/{index.js,index.cjs,index.d.ts}
npm run typecheck # tsc --noEmit
npm test # vitest (Node env — SSR-safe by construction)License
MIT
