Skip to content

Feat/create bsv app scaffolder#262

Open
kjartan221 wants to merge 16 commits into
bsv-blockchain:mainfrom
kjartan221:feat/create-bsv-app
Open

Feat/create bsv app scaffolder#262
kjartan221 wants to merge 16 commits into
bsv-blockchain:mainfrom
kjartan221:feat/create-bsv-app

Conversation

@kjartan221

Copy link
Copy Markdown
Collaborator

What

Adds a new package, packages/helpers/create-bsv-app — a CLI that scaffolds
BSV-enabled apps or adds BSV capabilities to an existing project, without the
developer writing key- or transaction-handling code themselves.

The tool delegates base-project creation to official generators (Vite for
React, a lean Express skeleton for the server) and layers in capabilities:
small, role-aware utility files built on the BSV abstraction libs, plus a
generated AGENTS.md contract describing how to use them. A new project runs
end-to-end on npm run dev immediately, with a working wallet connect flow
(desktop-first, mobile/relay QR fallback) wired automatically.

Why

Lowers the barrier to starting a BSV app: one command produces a runnable
project with a real wallet flow, instead of hand-wiring auth, contexts, routes,
and server verification. Also gives AI agents a deterministic path via
--file <config.json>.

How it works

Every run resolves a single ProjectConfig and feeds it through one pipeline.
Four "doors" produce that config, differing only in how it's gathered:

  • Interactive CLI — prompts through the schema
  • Flags--frontend, --capabilities, … with --yes to skip prompts
  • --file <config.json> — full config as JSON (best for automation/agents)
  • --ui — local single-use HTML page (127.0.0.1) that scaffolds on Generate

Two modes: new (scaffold a fresh project) and add (add capabilities to an
existing one, inferred from a bsv-scaffold.json manifest). Every run writes
that manifest so later add runs re-use the stack.

Capabilities included: wallet-connect (base — connect any BRC-100 wallet),
wallet-login (passwordless signed-proof login), signed-requests (per-call
request authentication).

Scope / impact

  • New package only — adds packages/helpers/create-bsv-app/**; touches no
    existing files. Rebased onto latest main (no overlap with other work).
  • Package is self-contained: single runtime dep (@clack/prompts), TS + Jest.

Testing

  • pnpm test220 tests, 30 suites, all passing
  • Covers config resolution/validation, the four doors, both modes, capability
    registry consistency, scaffolding, file placement, and AGENTS.md rendering.

Notes for reviewers

  • Adding a new capability = one file in src/capabilities/ + a registry entry +
    tests (documented in the package README under "Adding a capability").
  • Monorepo output (client/ + server/) produces independent packages, each
    with its own package.json/lockfile — intentional, so each app deploys alone.
  • This is V1 including minimal capabilities, more will be added in future versions

@socket-security

socket-security Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​clack/​prompts@​0.7.01001009997100

View full report

chore(create-bsv-app): align @types/node with workspace, add lockfile entries

Bump @types/node from ^25.9.1 to ^26.0.0 to match the rest of the
monorepo (21 sibling packages use ^26.0.0). This lets the workspace
lockfile reuse the existing @types/node@26 jest/ts-node graph instead
of pulling in a second major version.

Regenerate pnpm-lock.yaml so `pnpm install --frozen-lockfile` (used in
CI) resolves the new create-bsv-app package: adds the importer entry
plus @clack/prompts, @clack/core and sisteransi.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant