Theme SDK: contributor setup
On this page
On a fresh checkout or git worktree, run one command from the repo root:
bun run theme:setupIt takes about 20 seconds with a warm Bun cache.
What it does
- Checks the Bun version against the one CI uses (1.3.14).
- Installs dependencies (
bun install --frozen-lockfile, falling back tobun install). - Resets the mode of
packages/cli/src/bin.ts(Bun chmods it to 755 because it is thebizzpocketbin target; the repo tracks 644). - Builds
dist/in dependency order:sir,theme,theme-runtime,theme-sdk, theneslint-plugin-theme-safety. - Smoke check:
bun testinpackages/theme, thenbizzpocket build --target both --jsoninpackages/themes/toyshop(build output that git does not ignore is removed).
Each step prints one line with its duration. On failure it prints the failing command, the last lines of output and what to try, and exits non-zero. It is safe to re-run.
Flags
-
--skip-installreuse the existingnode_modules; never touchesbun.lock. -
--keep-lockfilekeep whateverbun installwrote tobun.lock. -
--skip-smokebuild only, skip the test and the toyshop build.bun run theme:setup -- --skip-install
Known caveat: frozen lockfile
bun install --frozen-lockfile currently fails on bun.lock (duplicate
@types/bun / bun-types / typescript keys left by a merge, plus a stale
@sentry/webpack-plugin peer entry). The script then falls back to a plain
bun install, which rewrites bun.lock:
- If
bun.lockand everypackage.jsonwere clean before, the rewrite is undone and one line says so. Never commit abun.lockchange from a feature branch. - If you had modified
bun.lockor apackage.json, the new lockfile is kept (dependencies changed) and one line says so; review it before committing. --keep-lockfilealways keeps what install wrote.