Skip to content

Overview ​

@saflib/vue provides conventions, components, and workflows for Vue SPAs in SAF products — page structure, reverse-t i18n, TanStack Query integration, product events, and Vitest/Playwright-friendly testing.

Each SPA is one npm package under {product}/clients/{subdomain}/, named after a subdomain (app, auth, admin, …). Subpath-hosted SPAs on another subdomain are not supported. Apex/root clients use a name like root that will not collide with real subdomains.

Use the workflow vue/add-spa to create a new SPA or vue/add-static-site to create a static subdomain with Vitepress, then vue/add-view to add pages to your SPA and vue/add-e2e-test to add Playwright tests.

WorkflowUse
vue/add-spaNew subdomain SPA + build shim + Caddy
vue/add-viewNew page under an existing SPA
vue/add-e2e-testPlaywright spec stub
vue/add-static-siteNon-Vue static client

What this package provides ​

ExportRole
createSpaMainStandard SPA main() — client name, document title, router, i18n, optional Sentry callback
createVueAppLower-level app bootstrap (Vuetify, Vue Router, TanStack Query, vue-i18n)
useReverseT / makeReverseTComposableValue-based i18n lookups — see i18n
AsyncPage, useAsyncPageDocumentTitleCode-split pages with loader gating — see Components
commonEventLogger / makeProductEventLoggerBrowser product events → PostHog / dev buffer
./componentsShared UI (AsyncPage, SpaLink, SnackbarQueue, …)
./testingmountWithPlugins, stubGlobals, getElementByString
./vitest-configShared Vitest presets — Coverage enforcement
./workflowsScaffold SPAs, views, e2e specs, static sites

SPA package structure ​

Golden reference: base/clients/app/.