ReviewOS

craft-native/craft

Validate craft-sdk init template names and fail unknown templates

#285
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Problem

The packaged craft-sdk CLI accepts any --template value. For an unknown value it performs no generation, exits 0, and prints successful next steps pointing to a directory that does not exist.

Reproduction

craft-sdk init demo --template nope
echo $?
test -e demo

Observed output includes:

Next steps:
  cd demo
  bun install

The exit status is 0 and demo is absent.

The supported packaged templates (blank, tabs, drawer, dashboard, desktop) were separately exercised and correctly rewrite their internal craft-native workspace:* placeholder to ^0.0.92, so this finding is specifically input validation and truthful outcome reporting.

Expected

  • Validate the template before printing or mutating anything.
  • Reject unknown values with a nonzero exit and list the supported names.
  • Add a packaged-CLI regression test for exit status, absence of output, and no misleading success instructions.
  • Keep this behavior aligned with the create-craft validation fix tracked in #278.

Discovered during the post-merge release audit for #254, #242, and #220.

Sign in to comment on this issue.