Packages
The shared workspace packages under packages/ — auth-client, storybook preset, utils, webview-bridge SDK, and the TypeScript base config.
packages/* holds the small, sharply-scoped libraries that apps and the design
system consume. None of them deploy on their own.
| Package | Path | Role |
|---|---|---|
@todayai-labs/auth-client | packages/auth-client | Domain + environment + OIDC URL resolution |
@todayai-labs/storybook | packages/storybook | Shared Storybook preview / theme / window primitives |
@todayai-labs/utils | packages/utils | Small utility functions used across apps |
@todayai-labs/webview-bridge | packages/webview-bridge | Web-side client SDK for the WebView Bridge contract |
@todayai-labs/tsconfig | packages/tsconfig | Shared TypeScript base config (extended by every project) |
@todayai-labs/auth-client
The single source of truth for which auth and API origin every environment
talks to. Apps consume resolveAuthBaseUrl() and resolveApiBaseUrl()
rather than hard-coding URLs.
Resolution rules walk three sources in order: explicit NEXT_PUBLIC_*
overrides, then per-environment computed defaults, then production fallbacks.
The exact rules live in packages/auth-client/src/urls.ts
and are covered in Architecture → Three-tier domains (PR-CB).
Unlike the other @todayai-labs/* workspace packages, this one is published to
GitHub Packages under the @todayai-labs scope so future sibling repos
(today-admin, etc.) can consume it cross-repo. Inside this monorepo it is
still linked via workspace:*; the version-resolution rewrite only happens
at pnpm publish time.
@todayai-labs/storybook
Shared Storybook preview and decorator code so the three Storybooks (web, design-system/ui, design-system/opal) render with the same theme / background / window chrome. See Toolchain → Testing → Storybook (PR-CB) for the full topology.
@todayai-labs/utils
Small, type-safe utility functions. No theme, no Radix, no React. If a function
needs react or @todayai-labs/tdx-ui as a peer it does not belong here.
@todayai-labs/webview-bridge
The web-side SDK for the WebView Bridge contract.
Native hosts (iOS, macOS, Android, Windows) implement the matching native side.
Documented in detail at apps/webview-bridge-docs — this site does not
duplicate that reference.
When you want to call the bridge from web code, import @todayai-labs/webview-bridge
and read the Web SDK section
of the dedicated docs site.
@todayai-labs/tsconfig
Just one file: base.json. Every project (apps/*, design-system/*,
packages/*) extends it. The base sets ES target, module resolution, strict
mode, and incremental build behavior — see Toolchain → tsconfig references
(PR-CB) for the full layout and why every project ships its own
tsconfig.app.json + tsconfig.node.json on top.
Adding a new package
Short version (full checklist in workspace/adding-package,
PR-CC):
- Create
packages/<name>/withpackage.json(@todayai-labs/<name>),tsconfig.json, and a minimalmoon.yml(typecheck + test tasks). - Pull versioned deps from
pnpm-workspace.yaml'scatalog:(strict mode rejects ad-hoc versions). - Add the project to the root
tsconfig.json'sreferencesif it participates intsgo --build(almost always yes). - Run
pnpm install— Moon picks up the new project from.moon/workspace.yml's glob.