create-cascade 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +51 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -20,17 +20,17 @@ const FRAMEWORKS = [
|
|
|
20
20
|
|
|
21
21
|
const STARTERS = {
|
|
22
22
|
core: [
|
|
23
|
-
{ id: "minimal", label: "Minimal", description: "
|
|
23
|
+
{ id: "minimal", label: "Minimal", description: "Welcome panel with quick next steps" },
|
|
24
24
|
{ id: "counter", label: "Counter", description: "Live counter updated every second" },
|
|
25
25
|
{ id: "layout", label: "Layout", description: "Simple boxed layout starter" },
|
|
26
26
|
],
|
|
27
27
|
react: [
|
|
28
|
-
{ id: "minimal", label: "Minimal", description: "
|
|
28
|
+
{ id: "minimal", label: "Minimal", description: "Welcome panel with quick next steps" },
|
|
29
29
|
{ id: "counter", label: "Counter", description: "React state with interval updates" },
|
|
30
30
|
{ id: "login", label: "Login", description: "Small interactive login form" },
|
|
31
31
|
],
|
|
32
32
|
solid: [
|
|
33
|
-
{ id: "minimal", label: "Minimal", description: "
|
|
33
|
+
{ id: "minimal", label: "Minimal", description: "Welcome panel with quick next steps" },
|
|
34
34
|
{ id: "counter", label: "Counter", description: "Solid signal with interval updates" },
|
|
35
35
|
{ id: "input", label: "Input", description: "Basic input and submit interaction" },
|
|
36
36
|
],
|
|
@@ -312,6 +312,8 @@ function getPackageJson(projectName, framework) {
|
|
|
312
312
|
type: "module",
|
|
313
313
|
scripts: {
|
|
314
314
|
dev: `bun run ${entry}`,
|
|
315
|
+
start: `bun run ${entry}`,
|
|
316
|
+
typecheck: "bunx tsc --noEmit",
|
|
315
317
|
},
|
|
316
318
|
dependencies,
|
|
317
319
|
}
|
|
@@ -323,7 +325,10 @@ function getTsConfig(framework) {
|
|
|
323
325
|
module: "ESNext",
|
|
324
326
|
moduleResolution: "Bundler",
|
|
325
327
|
strict: true,
|
|
328
|
+
noEmit: true,
|
|
329
|
+
verbatimModuleSyntax: true,
|
|
326
330
|
skipLibCheck: true,
|
|
331
|
+
types: ["bun-types"],
|
|
327
332
|
}
|
|
328
333
|
|
|
329
334
|
if (framework === "react") {
|
|
@@ -358,17 +363,41 @@ function getTsConfig(framework) {
|
|
|
358
363
|
function getSource(framework, starter) {
|
|
359
364
|
const sources = {
|
|
360
365
|
core: {
|
|
361
|
-
minimal: `import { TextRenderable, createCliRenderer } from "@cascadetui/core"
|
|
366
|
+
minimal: `import { BoxRenderable, TextRenderable, createCliRenderer } from "@cascadetui/core"
|
|
362
367
|
|
|
363
368
|
const renderer = await createCliRenderer({ exitOnCtrlC: true })
|
|
364
369
|
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
370
|
+
const panel = new BoxRenderable(renderer, {
|
|
371
|
+
border: true,
|
|
372
|
+
borderStyle: "single",
|
|
373
|
+
padding: 1,
|
|
374
|
+
margin: 1,
|
|
375
|
+
width: 56,
|
|
376
|
+
height: 8,
|
|
377
|
+
flexDirection: "column",
|
|
378
|
+
})
|
|
379
|
+
|
|
380
|
+
const title = new TextRenderable(renderer, {
|
|
381
|
+
content: "Hello from Cascade Core",
|
|
368
382
|
fg: "#00ff99",
|
|
369
383
|
})
|
|
370
384
|
|
|
371
|
-
renderer
|
|
385
|
+
const subtitle = new TextRenderable(renderer, {
|
|
386
|
+
content: "Run bun run dev after edits to refresh your app",
|
|
387
|
+
marginTop: 1,
|
|
388
|
+
fg: "#cccccc",
|
|
389
|
+
})
|
|
390
|
+
|
|
391
|
+
const hint = new TextRenderable(renderer, {
|
|
392
|
+
content: "Press Ctrl+C to exit",
|
|
393
|
+
marginTop: 1,
|
|
394
|
+
fg: "#999999",
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
panel.add(title)
|
|
398
|
+
panel.add(subtitle)
|
|
399
|
+
panel.add(hint)
|
|
400
|
+
renderer.root.add(panel)
|
|
372
401
|
`,
|
|
373
402
|
counter: `import { TextRenderable, createCliRenderer } from "@cascadetui/core"
|
|
374
403
|
|
|
@@ -423,7 +452,13 @@ renderer.root.add(container)
|
|
|
423
452
|
import { createRoot } from "@cascadetui/react"
|
|
424
453
|
|
|
425
454
|
function App() {
|
|
426
|
-
return
|
|
455
|
+
return (
|
|
456
|
+
<box style={{ border: true, borderStyle: "single", padding: 1, margin: 1, width: 56, height: 8, flexDirection: "column" }}>
|
|
457
|
+
<text content="Hello from Cascade React" fg="#00ff99" />
|
|
458
|
+
<text content="Edit src/index.tsx and run bun run dev" marginTop={1} fg="#cccccc" />
|
|
459
|
+
<text content="Press Ctrl+C to exit" marginTop={1} fg="#999999" />
|
|
460
|
+
</box>
|
|
461
|
+
)
|
|
427
462
|
}
|
|
428
463
|
|
|
429
464
|
const renderer = await createCliRenderer({ exitOnCtrlC: true })
|
|
@@ -496,7 +531,13 @@ createRoot(renderer).render(<App />)
|
|
|
496
531
|
solid: {
|
|
497
532
|
minimal: `import { render } from "@cascadetui/solid"
|
|
498
533
|
|
|
499
|
-
const App = () =>
|
|
534
|
+
const App = () => (
|
|
535
|
+
<box style={{ border: true, borderStyle: "single", padding: 1, margin: 1, width: 56, height: 8, flexDirection: "column" }}>
|
|
536
|
+
<text content="Hello from Cascade Solid" fg="#00ff99" />
|
|
537
|
+
<text content="Edit src/index.tsx and run bun run dev" marginTop={1} fg="#cccccc" />
|
|
538
|
+
<text content="Press Ctrl+C to exit" marginTop={1} fg="#999999" />
|
|
539
|
+
</box>
|
|
540
|
+
)
|
|
500
541
|
|
|
501
542
|
render(App, { exitOnCtrlC: true })
|
|
502
543
|
`,
|