A Bun workspace for Svelte packages.
@sveltebase/utils: a Svelte utility package with helpers for cookies, async flows, keyed async state helpers, and directsvelte-sonnertoast notifications@sveltebase/state: a Svelte rune-based state package@sveltebase/i18n: locale state, translation, and formatting helpers@sveltebase/instant: generic InstantDB query helpers for Svelte- Bun for installation, workspace scripts, and release management
packages/utils/README.mdpackages/state/README.mdpackages/i18n/README.mdpackages/instant/README.md
bun installbun run build
bun run check
bun run lintUpdate package versions:
bun run release:version patch
bun run release:version minor
bun run release:version majorOr set an exact version:
bun run release:version 1.4.0Publish the packages in dependency order:
bun run release:publishYou can forward npm publish flags:
bun run release:publish -- --dry-runAdd the packages you need:
bun add @sveltebase/instant
bun add @sveltebase/i18n
bun add @sveltebase/state
bun add @sveltebase/utilsThe @sveltebase/instant package exposes createInstantHelpers(db) so an app can bind the helpers to its own InstantDB client and re-export them:
import { init } from "@instantdb/svelte";
import { createInstantHelpers } from "@sveltebase/instant";
import schema from "./instant.schema";
export const db = init({
appId: process.env.PUBLIC_INSTANT_APP_ID!,
schema,
});
export const { queryOnce, useQuery, prefetchQuery } = createInstantHelpers(db);That keeps the package generic while giving each app a simple local API surface.
Copy .npmrc.example to .npmrc and replace the scope or registry if you use something other than GitHub Packages.
- All package names use the
@sveltebase/*scope. @sveltebase/utilsdepends directly onsvelte-sonnerand uses itstoastAPI for notifications.release:versionupdates workspace package versions and internal dependency ranges together.- Bun
1.1.26does not exposebun publish, so the publish script usesnpm publishunder the hood.