@spacesync/lib
v0.2.1
Published
Platform-neutral SpaceSync domain helpers and shared types (no React).
Downloads
373
Readme
@spacesync/lib
Platform-neutral SpaceSync domain helpers and shared types (no React / DOM).
Used by:
@spacesync/client(re-exports pure helpers for back-compat)- operator-web, admin-web, member-web, member-mobile via direct
@spacesync/lib/<module>imports
Boundary
| Package | Owns |
|---------|------|
| @spacesync/lib | Pure TS helpers + types (pricing, dateDisplay, booking OH, invoices, …) |
| @spacesync/client | Web UI, shell, theme, forms, API client |
spacesync-api keeps its own mirrors for now.
Develop
pnpm install
pnpm typecheck
pnpm buildLocal sync into sibling apps
Keep repos as siblings:
Documents/
spacesync-lib/
spacesync-client/
spacesync-operator/
spacesync-admin/
spacesync-member/
spacesync-member-mobile/Apps should depend on "@spacesync/lib": "file:../spacesync-lib" (or a published version). Then:
pnpm sync:apps # build + copy dist into all four apps' node_modules
pnpm sync:member
pnpm sync:operator
pnpm sync:admin
pnpm sync:member-mobileOr watch:
pnpm dev # tsup --watch, syncs on successInstall (published)
pnpm add @spacesync/libPublish
pnpm typecheck
pnpm build
# bump version in package.json first if this version is already on npm
npm login # @spacesync org access on registry.npmjs.org
pnpm publish --access publicRequires a valid npm token with publish rights on @spacesync. If auth fails (E401) or the org is unavailable, keep using the built package + link: / file:../spacesync-lib + pnpm sync:apps workflow above.
Import style
Import helpers and types by subpath (there is no package-root barrel):
import { formatMoneyAmount } from "@spacesync/lib/moneyFormat";
import { computeBookingTotal } from "@spacesync/lib/pricing";
import type { BookingRecord } from "@spacesync/lib/types/booking";