This is the single source of truth for testing Blend Token Studio end-to-end:
- local monorepo development
- external project validation
- npm canary and stable publish checks
Quick command (root):
pnpm test:token-studio:release-gateNPM-like consumer smoke only:
pnpm test:token-studio:npm-smokeEnsure this flow works for any React/Next/Vite project without per-component binding:
npx blend-studio init- wrap app with generated
BlendProvider npx blend-studio brand ...ornpx blend-studio pull <branchId>- run app and confirm Blend components render with resolved tokens
Run from repo root:
pnpm install
pnpm --filter @juspay/blend-design-system build
pnpm --filter @juspay/blend-design-system build
pnpm --filter blend-studio build
pnpm --filter @juspay/blend-design-system typecheck
pnpm --filter blend-studio typecheckPass criteria:
- all commands succeed
packages/blend/distexists with token engine filespackages/cli/dist/index.jsexists
cd apps/blend-studio
pnpm devVerify:
- create branch at
/studio - edit colors/radius/components
- preview updates live
- publish version
From repo root:
pnpm --filter blend-studio build
pnpm --filter @juspay/blend-design-system buildThen test commands in a sample app folder:
npx blend-studio --help
npx blend-studio init --defaults
npx blend-studio brand --preset blend
npx blend-studio validate
npx blend-studio diffPass criteria:
blend.config.jsoncreatedsrc/blend/provider.tsxcreatedsrc/blend/brand.jsoncreatedsrc/blend/tokens.tsgenerated with light + dark tokens
Create fresh projects and run same flow:
- Vite React (TS)
- Next.js app router (TS)
For each:
npx blend-studio init --defaults
npx blend-studio brand --primary "#E31837" --radius sharpThen:
- import generated
BlendProvider - render
ButtonV2,TextInputV2,AlertV2 - run dev server
- verify light/dark behavior
Pass criteria:
- no manual token wiring
- no component-level binding
- app compiles and renders with branded styles
Publish canary versions first:
- publish
@juspay/blend-design-systemwith canary tag (includes token engine) - publish
blend-studiowith canary tag - test in a fresh external project using only npm packages
Checklist:
npx blend-studio@next initworksbrandgeneration workspull/list/loginbehavior is correct against target API
If any failure occurs, fix and republish canary; do not publish stable.
Publish stable only if all below pass:
- monorepo build + typecheck pass
- studio manual workflow pass
- external Vite test pass
- external Next.js test pass
- canary validation pass
Add CI jobs:
build-packages: build blend + token-engine + clitypecheck-packages: token-engine + clismoke-cli: runinit+brandin temp fixture projectstudio-e2e: minimal editor create/edit/preview test
tokens.ts is generated; users should not edit it manually.
brand.json is the user-editable source of truth and must be committed.
provider.tsx is generated once and can be edited safely by consumers.
- d.ts build failure in token-engine: check for inferred exported return types in blend token utilities; add explicit return types.
- CLI write errors: ensure commands create output directory before writing files.
- missing auth for pull/list/push: run
blend-studio loginor provide token env vars. - npm-smoke pnpm store errors: by default the smoke runs an npm consumer only. To also run the pnpm consumer, set
TOKEN_STUDIO_SMOKE_PNPM=1.
blend-studiocan remain on0.1.xwhile@juspay/blend-design-systemis on0.0.x; they are separate packages with separate semver lifecycles.- Internal monorepo links should use semver ranges (e.g.
^0.1.0) so npm installs work. Use changesets so these ranges update automatically during release. @juspay/blend-design-systemincludes the token engine as part of its core functionality.- Use changesets to bump and publish; avoid manual cross-editing package versions.