create-murasaki 0.0.0 → 0.0.1

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.
Files changed (2) hide show
  1. package/index.mjs +116 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,11 +1,122 @@
1
1
  #!/usr/bin/env node
2
2
  // create-murasaki — Scaffolder for Murasaki apps.
3
- // 🌱 Pre-alpha: not implemented yet.
4
3
 
5
- console.log(`
6
- 🟣 Murasaki desktop framework for Next.js developers
4
+ // ── ANSI truecolor (Oomurasaki palette) ────────────────────────────────
5
+ const BRIGHT = '\x1b[38;2;168;85;247m'
6
+ const DEEP = '\x1b[38;2;91;33;182m'
7
+ const CREAM = '\x1b[38;2;250;245;232m'
8
+ const DARK = '\x1b[38;2;59;7;100m'
9
+ const DIM = '\x1b[38;2;136;136;153m'
10
+ const BOLD = '\x1b[1m'
11
+ const RESET = '\x1b[0m'
12
+
13
+ // Background versions for half-block compositing
14
+ const BG_BRIGHT = '\x1b[48;2;168;85;247m'
15
+ const BG_DEEP = '\x1b[48;2;91;33;182m'
16
+ const BG_CREAM = '\x1b[48;2;250;245;232m'
17
+ const BG_DARK = '\x1b[48;2;59;7;100m'
18
+
19
+ const noColor = process.env.NO_COLOR || !process.stdout.isTTY
20
+ const c = (code) => (noColor ? '' : code)
21
+
22
+ // ── H4 butterfly grid (19 col × 12 row) — ichi's revised Figma version ─
23
+ const GRID = [
24
+ '.....b.......b.....',
25
+ '......b.....b......',
26
+ '...bbbb.....bbbb...',
27
+ '..bbbbbb...bbbbbb..',
28
+ '.bbbbcbbb.bbbcbbbb.',
29
+ '.bbbbbbbb.bbbbbbbb.',
30
+ '..bbbbbbb.bbbbbbb..',
31
+ '...bbbbb...bbbbb...',
32
+ '...................',
33
+ '.....ddd...ddd.....',
34
+ '....ddddd.ddddd....',
35
+ '.....dddd.dddd.....',
36
+ ]
37
+
38
+ const FG_OF = { b: BRIGHT, d: DEEP, c: CREAM, k: DARK }
39
+ const BG_OF = { b: BG_BRIGHT, d: BG_DEEP, c: BG_CREAM, k: BG_DARK }
40
+ const GRID_WIDTH = GRID[0].length
41
+
42
+ // Compress 2 grid rows into 1 terminal row using half-block ▀
43
+ // (top half = fg color, bottom half = bg color)
44
+ function renderButterflyLines() {
45
+ const out = []
46
+ for (let r = 0; r < GRID.length; r += 2) {
47
+ const top = GRID[r] || '.'.repeat(GRID_WIDTH)
48
+ const bot = GRID[r + 1] || '.'.repeat(GRID_WIDTH)
49
+ let line = ''
50
+ for (let col = 0; col < GRID_WIDTH; col++) {
51
+ const tCh = top[col]
52
+ const bCh = bot[col]
53
+ const tFg = FG_OF[tCh]
54
+ const bFg = FG_OF[bCh]
55
+
56
+ if (!tFg && !bFg) {
57
+ line += ' '
58
+ } else if (tFg && !bFg) {
59
+ line += c(tFg) + '▀' + c(RESET)
60
+ } else if (!tFg && bFg) {
61
+ line += c(bFg) + '▄' + c(RESET)
62
+ } else {
63
+ // Both halves filled
64
+ if (tCh === bCh) {
65
+ line += c(tFg) + '█' + c(RESET)
66
+ } else {
67
+ line += c(tFg) + c(BG_OF[bCh]) + '▀' + c(RESET)
68
+ }
69
+ }
70
+ }
71
+ out.push(line)
72
+ }
73
+ return out
74
+ }
75
+
76
+ // ── figlet "Standard" wordmark ─────────────────────────────────────────
77
+ const WORDMARK_LINES = [
78
+ ' _ _ ',
79
+ ' _ __ ___ _ _ _ __ __ _ ___ __ _ | | _(_)',
80
+ "| '_ ` _ \\| | | | '__/ _` / __|/ _` || |/ /| |",
81
+ '| | | | | | |_| | | | (_| \\__ \\ (_| || < | |',
82
+ '|_| |_| |_|\\__,_|_| \\__,_|___/\\__,_||_|\\_\\|_|',
83
+ ]
84
+
85
+ function colorize(line, color, opts = {}) {
86
+ const prefix = (opts.bold ? c(BOLD) : '') + c(color)
87
+ return prefix + line + c(RESET)
88
+ }
89
+
90
+ // ── Render banner: butterfly LEFT, wordmark RIGHT, vertically centered ─
91
+ function renderBanner() {
92
+ const bf = renderButterflyLines() // now 6 lines
93
+ const wm = WORDMARK_LINES.map((l) => colorize(l, BRIGHT, { bold: true }))
94
+ const gap = ' '
95
+
96
+ const total = Math.max(bf.length, wm.length)
97
+ const wmOffset = Math.max(0, Math.floor((bf.length - wm.length) / 2))
98
+ const blankBf = ' '.repeat(GRID_WIDTH)
99
+
100
+ const lines = []
101
+ for (let i = 0; i < total; i++) {
102
+ const bfLine = bf[i] !== undefined ? bf[i] : blankBf
103
+ const wmIdx = i - wmOffset
104
+ const wmLine = (wmIdx >= 0 && wmIdx < wm.length) ? wm[wmIdx] : ''
105
+ lines.push(' ' + bfLine + gap + wmLine)
106
+ }
107
+ return lines.join('\n')
108
+ }
109
+
110
+ // ── Output ─────────────────────────────────────────────────────────────
111
+ process.stdout.write('\n' + renderBanner() + '\n')
112
+ process.stdout.write(`
113
+ ${c(DIM)}desktop apps for Next.js developers${c(RESET)}
114
+
115
+ ${c(DEEP)}docs${c(RESET)} ${c(DIM)}https://github.com/murasakijs/murasaki${c(RESET)}
116
+
117
+ ${c(DIM)}🌱 Pre-alpha — scaffolder not implemented yet.${c(RESET)}
118
+ ${c(DIM)}Follow progress on GitHub or watch this space.${c(RESET)}
7
119
 
8
- create-murasaki is not implemented yet.
9
- Follow progress at https://github.com/murasakijs/murasaki
10
120
  `)
121
+
11
122
  process.exit(0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-murasaki",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "Scaffolder for Murasaki apps. Run with `npm create murasaki@latest`.",
5
5
  "keywords": [
6
6
  "murasaki",