create-mantiq 0.2.0 → 0.2.2
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/package.json +1 -1
- package/src/index.ts +10 -13
- package/src/terminal.ts +14 -17
- package/src/ui/shadcn.ts +11 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -78,7 +78,7 @@ if (!isCI && !kit) {
|
|
|
78
78
|
|
|
79
79
|
// Framework selection
|
|
80
80
|
const framework = await term.select('Which framework would you like to use?', [
|
|
81
|
-
{ value: 'react', label: 'React'
|
|
81
|
+
{ value: 'react', label: 'React' },
|
|
82
82
|
{ value: 'vue', label: 'Vue' },
|
|
83
83
|
{ value: 'svelte', label: 'Svelte' },
|
|
84
84
|
{ value: 'none', label: 'None', hint: 'API only' },
|
|
@@ -168,15 +168,12 @@ if (!noGit) {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
// ── Done ─────────────────────────────────────────────────────────────────────
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
]
|
|
181
|
-
|
|
182
|
-
term.box(summaryLines)
|
|
171
|
+
console.log(`\n ${emerald('✓')} ${bold(projectName)} created\n`)
|
|
172
|
+
console.log(` ${dim('Framework')} ${kit ? bold(kit.charAt(0).toUpperCase() + kit.slice(1)) : dim('None (API only)')}`)
|
|
173
|
+
if (kit === 'react') console.log(` ${dim('UI Kit')} ${ui === 'shadcn' ? bold('shadcn/ui') : dim('Plain Tailwind')}`)
|
|
174
|
+
console.log(`\n ${dim('Next steps:')}\n`)
|
|
175
|
+
console.log(` cd ${projectName}`)
|
|
176
|
+
console.log(` bun mantiq migrate`)
|
|
177
|
+
console.log(` bun run dev\n`)
|
|
178
|
+
|
|
179
|
+
process.exit(0)
|
package/src/terminal.ts
CHANGED
|
@@ -25,34 +25,31 @@ export interface SelectOption {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export class Terminal {
|
|
28
|
-
/** Show branded header
|
|
28
|
+
/** Show branded ASCII header */
|
|
29
29
|
header(): void {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
write(
|
|
33
|
-
write(` ${GRAY}
|
|
34
|
-
write(
|
|
35
|
-
write(`
|
|
36
|
-
write(
|
|
37
|
-
write(` ${GRAY}│${R}${' '.repeat(w)}${GRAY}│${R}\n`)
|
|
38
|
-
write(` ${GRAY}└${'─'.repeat(w)}┘${R}\n`)
|
|
39
|
-
write('\n')
|
|
30
|
+
write('\n\n')
|
|
31
|
+
write(` ${EMERALD}▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇${R}\n`)
|
|
32
|
+
write(`\n`)
|
|
33
|
+
write(` ${EMERALD}●${R} ${BOLD}mantiq${R} ${GRAY}│${R} ${DIM}The Bun framework for artisans${R}\n`)
|
|
34
|
+
write(`\n`)
|
|
35
|
+
write(` ${GRAY}───────────────────────────────────────────────${R}\n`)
|
|
36
|
+
write('\n\n')
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
/** Arrow-key select prompt */
|
|
43
40
|
async select(label: string, options: SelectOption[]): Promise<string> {
|
|
44
41
|
let selected = 0
|
|
45
42
|
const render = () => {
|
|
46
|
-
let out = `
|
|
43
|
+
let out = ` ${EMERALD}◆${R} ${BOLD}${label}${R}\n`
|
|
47
44
|
for (let i = 0; i < options.length; i++) {
|
|
48
45
|
const opt = options[i]!
|
|
49
46
|
const active = i === selected
|
|
50
47
|
const bullet = active ? `${EMERALD}●${R}` : `${GRAY}○${R}`
|
|
51
|
-
const text = active ? `${WHITE}${opt.label}${R}` : `${GRAY}${opt.label}${R}`
|
|
52
|
-
const hint = opt.hint ? `
|
|
53
|
-
out += `
|
|
48
|
+
const text = active ? `${WHITE}${BOLD}${opt.label}${R}` : `${GRAY}${opt.label}${R}`
|
|
49
|
+
const hint = opt.hint ? ` ${DIM}${opt.hint}${R}` : ''
|
|
50
|
+
out += ` ${bullet} ${text}${hint}\n`
|
|
54
51
|
}
|
|
55
|
-
out +=
|
|
52
|
+
out += `\n`
|
|
56
53
|
return out
|
|
57
54
|
}
|
|
58
55
|
|
|
@@ -79,7 +76,7 @@ export class Terminal {
|
|
|
79
76
|
write(UP(lines) + CLEAR_LINE)
|
|
80
77
|
for (let i = 0; i < lines; i++) write(`${CLEAR_LINE}\n`)
|
|
81
78
|
write(UP(lines))
|
|
82
|
-
write(`
|
|
79
|
+
write(` ${EMERALD}◇${R} ${label} ${EMERALD}${options[selected]!.label}${R}\n\n`)
|
|
83
80
|
resolve(options[selected]!.value)
|
|
84
81
|
return
|
|
85
82
|
} else if (key === '\x03') { // Ctrl+C
|
package/src/ui/shadcn.ts
CHANGED
|
@@ -37,6 +37,17 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
37
37
|
'src/style.css': `@import "tailwindcss";
|
|
38
38
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
39
39
|
|
|
40
|
+
/*
|
|
41
|
+
* shadcn/ui theme — default: emerald
|
|
42
|
+
*
|
|
43
|
+
* To swap themes, visit https://ui.shadcn.com/themes
|
|
44
|
+
* Pick a theme, copy the CSS variables, and replace
|
|
45
|
+
* the :root and .dark blocks below.
|
|
46
|
+
*
|
|
47
|
+
* Or install a community theme:
|
|
48
|
+
* bunx --bun shadcn@latest add @ss-themes/caffeine
|
|
49
|
+
*/
|
|
50
|
+
|
|
40
51
|
@theme inline {
|
|
41
52
|
--color-background: var(--background);
|
|
42
53
|
--color-foreground: var(--foreground);
|