File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424### Fixed
2525- Unknown template names now fail with a clear error naming the available templates, instead
26- of rendering a blank card .
26+ of a raw ` ENOENT ` stack trace for the template's missing ` style.css ` .
2727
2828## 0.6.0
2929
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ quoteforge preview <file> [options]
147147quoteforge new [options]
148148
149149 --type <type> card or deck
150- --template <name> Template name (manifesto, quote, list, minimal )
150+ --template <name> Template name (28 available — omit for a picker )
151151 --theme <name> Theme name
152152 --slides <n> Number of blank slides (deck only, default: 5)
153153 --size <name> Size name
@@ -350,7 +350,7 @@ work.
350350- ` src/ ` — CLI + renderer (Bun + Nunjucks + Puppeteer)
351351- ` studio/ ` — bundled WYSIWYG editor (Vite + React + Zustand, launched by ` quoteforge studio ` )
352352- ` site/ ` — standalone landing + MDX docs SPA (separate nginx Dockerfile for deployment)
353- - ` templates/ ` — four built-in card layouts sharing a responsive base CSS
353+ - ` templates/ ` — 28 built-in card layouts sharing a responsive base CSS
354354- ` themes/ ` — 12 JSON theme files conforming to ` _schema.json `
355355
356356## Stack
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ import * as clack from "@clack/prompts";
44import { writeFileSync , existsSync } from "node:fs" ;
55import { resolve } from "node:path" ;
66import { listAllThemes } from "../../assetBundle.js" ;
7+ import { listTemplates , assertTemplateExists } from "../../renderer/templates.js" ;
78
89function getAvailableThemes ( ) : string [ ] {
910 return listAllThemes ( ) . map ( ( t ) => t . name ) ;
1011}
1112
12- const TEMPLATES = [ "manifesto" , "quote" , "list" , "minimal" ] ;
1313
1414export const newCommand = new Command ( "new" )
1515 . description ( "Interactively create a new card or deck JSON file" )
@@ -42,9 +42,18 @@ export const newCommand = new Command("new")
4242 process . exit ( 0 ) ;
4343 }
4444
45+ if ( opts . template ) {
46+ try {
47+ assertTemplateExists ( opts . template ) ;
48+ } catch ( err : unknown ) {
49+ clack . cancel ( err instanceof Error ? err . message : String ( err ) ) ;
50+ process . exit ( 1 ) ;
51+ }
52+ }
53+
4554 const template = opts . template ?? await clack . select ( {
4655 message : "Pick a template:" ,
47- options : TEMPLATES . map ( ( t ) => ( { value : t , label : t } ) ) ,
56+ options : listTemplates ( ) . map ( ( t ) => ( { value : t , label : t } ) ) ,
4857 } ) ;
4958
5059 if ( clack . isCancel ( template ) ) {
You can’t perform that action at this time.
0 commit comments