Skip to content

Add create-veil-app CLI scaffolder#348

Open
Kingvic300 wants to merge 1 commit into
Miracle656:mainfrom
Kingvic300:create-veil-app-cli
Open

Add create-veil-app CLI scaffolder#348
Kingvic300 wants to merge 1 commit into
Miracle656:mainfrom
Kingvic300:create-veil-app-cli

Conversation

@Kingvic300

Copy link
Copy Markdown

Closes #340

Summary

  • Adds packages/create-veil-app/ — a CLI scaffolder (npx create-veil-app my-app) that prompts for a project name and template (Next.js, Vite + React, or vanilla JS), fetches the chosen examples/ template via degit, and produces a working, installed project.
  • The Veil SDK isn't published to npm yet, so the CLI also degits the sdk/ package alongside the template, rewrites the template's file:../../sdk dependency to file:./sdk, and builds it locally — rather than leaving the user with a broken install.
  • For templates with their own tsconfig.json (e.g. Next.js), adds sdk to exclude — otherwise the app's TS compiler sweeps up the SDK's raw source via **/*.ts and type-checks it against the app's (older) target, which fails on the SDK's ES2020 BigInt literals.
  • Also carries the sdk/ dist-output fix from Add Electron desktop wallet example (#341) #346 (tsc nests src/ output under dist/src/ instead of dist/, so package.json's main: "dist/index.js" never resolves) since every scaffolded app depends on it to build. If Add Electron desktop wallet example (#341) #346 merges first this will be a no-op overlap; if this merges first, Add Electron desktop wallet example (#341) #346 still applies cleanly.

Test plan

  • vite template: scaffolded, vendored SDK built, npm run build (renderer) succeeds, vite dev server boots and serves src/main.tsx
  • next template: scaffolded, vendored SDK built, next build succeeds (including the tsconfig.json exclude fix — first attempt without it failed on sdk/src/sep7.ts's BigInt literal)
  • vanilla template: scaffolded, index.html's SDK import path rewritten to ./sdk/dist/vanilla.js
  • Confirmed the CLI errors cleanly on an existing non-empty target directory and on an invalid --template value

npx create-veil-app fetches a template (Next.js, Vite, or vanilla JS) and
the sdk/ package via degit, vendors the SDK locally since it isn't
published to npm yet, rewrites the file: dependency paths, and builds and
installs everything so the new project runs immediately.

Also carries the sdk/ dist-output fix from Miracle656#346 (tsc nests src/ output
under dist/src/ instead of dist/, breaking package.json's main entry)
since the scaffolded apps depend on it to build correctly.
@Kingvic300 Kingvic300 requested a review from Miracle656 as a code owner June 25, 2026 18:21
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@Kingvic300 is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@Kingvic300 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

CLI scaffolder: npx create-veil-app

1 participant