create-epicflare 1.2.0 → 1.3.0
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.ts +27 -100
- package/package.json +1 -1
- package/test-split.ts +0 -20
package/index.ts
CHANGED
|
@@ -4,111 +4,38 @@ import { spawnSync } from 'node:child_process'
|
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
import { createInterface } from 'node:readline'
|
|
6
6
|
|
|
7
|
-
const logoLines =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
' |_| ',
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
// Split points for each line (where silver ends and orange begins)
|
|
32
|
-
// Split after the left part ends, so right part starts cleanly
|
|
33
|
-
const splitPoints = [19, 20, 20, 20, 20, 12]
|
|
34
|
-
|
|
35
|
-
function colorizeGradient(lines: string[]): string {
|
|
36
|
-
const reset = '\x1b[0m'
|
|
37
|
-
// Silver RGB: (200, 200, 200)
|
|
38
|
-
// Orange RGB: (255, 165, 0)
|
|
39
|
-
const silver = { r: 200, g: 200, b: 200 }
|
|
40
|
-
const orange = { r: 255, g: 165, b: 0 }
|
|
41
|
-
|
|
42
|
-
return lines
|
|
43
|
-
.map((line, index) => {
|
|
44
|
-
if (!line.trim()) return line
|
|
45
|
-
|
|
46
|
-
// Calculate gradient position (0 = silver at top, 1 = orange at bottom)
|
|
47
|
-
const t = index / (lines.length - 1)
|
|
48
|
-
|
|
49
|
-
// Interpolate RGB values
|
|
50
|
-
const r = Math.round(silver.r + (orange.r - silver.r) * t)
|
|
51
|
-
const g = Math.round(silver.g + (orange.g - silver.g) * t)
|
|
52
|
-
const b = Math.round(silver.b + (orange.b - silver.b) * t)
|
|
53
|
-
|
|
54
|
-
// ANSI 24-bit color code
|
|
55
|
-
const colorCode = `\x1b[38;2;${r};${g};${b}m`
|
|
56
|
-
return `${colorCode}${line}${reset}`
|
|
57
|
-
})
|
|
58
|
-
.join('\n')
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function colorizeText(lines: string[], splitPoints: number[]): string {
|
|
7
|
+
const logoLines = ` ⠀⠀⠀⠀⠀⠀⢱⣆⠀⠀⠀⠀⠀⠀
|
|
8
|
+
⠀⠀⠀⠀⠀⠀⠈⣿⣷⡀⠀⠀⠀⠀
|
|
9
|
+
⠀⠀⠀⠀⠀⠀⢸⣿⣿⣷⣧⠀⠀⠀
|
|
10
|
+
⠀⠀⠀⠀⡀⢠⣿⡟⣿⣿⣿⡇⠀⠀
|
|
11
|
+
⠀⠀⠀⠀⣳⣼⣿⡏⢸⣿⣿⣿⢀⠀
|
|
12
|
+
⠀⠀⠀⣰⣿⣿⡿⠁⢸⣿⣿⡟⣼⡆
|
|
13
|
+
⢰⢀⣾⣿⣿⠟⠀⠀⣾⢿⣿⣿⣿⣿
|
|
14
|
+
⢸⣿⣿⣿⡏⠀⠀⠀⠃⠸⣿⣿⣿⡿
|
|
15
|
+
⢳⣿⣿⣿⠀⠀⠀⠀⠀⠀⢹⣿⡿⡁
|
|
16
|
+
⠀⠹⣿⣿⡄⠀⠀⠀⠀⠀⢠⣿⡞⠁
|
|
17
|
+
⠀⠀⠈⠛⢿⣄⠀⠀⠀⣠⠞⠋⠀⠀
|
|
18
|
+
⠀⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀`
|
|
19
|
+
|
|
20
|
+
const textLines = ` _ __ _
|
|
21
|
+
___ _ __ (_) ___ / _| | __ _ _ __ ___
|
|
22
|
+
/ _ \\ '_ \\| |/ __| |_| |/ _\` | '__/ _ \\
|
|
23
|
+
| __/ |_) | | (__| _| | (_| | | | __/
|
|
24
|
+
\\___| .__/|_|\\___|_| |_|\\__,_|_| \\___|
|
|
25
|
+
|_| `
|
|
26
|
+
|
|
27
|
+
function colorizeOrange(text: string): string {
|
|
62
28
|
const reset = '\x1b[0m'
|
|
63
|
-
|
|
64
|
-
const silverLight = { r: 220, g: 220, b: 220 }
|
|
65
|
-
const silverDark = { r: 160, g: 160, b: 160 }
|
|
66
|
-
// Orange gradient: lighter (255, 200, 100) to darker (200, 120, 0)
|
|
67
|
-
const orangeLight = { r: 255, g: 200, b: 100 }
|
|
68
|
-
const orangeDark = { r: 200, g: 120, b: 0 }
|
|
69
|
-
|
|
70
|
-
return lines
|
|
71
|
-
.map((line, index) => {
|
|
72
|
-
if (!line.trim()) return line
|
|
29
|
+
const orange = '\x1b[38;2;255;165;0m' // Orange RGB: (255, 165, 0)
|
|
73
30
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// Calculate gradient position for this line (0 = light at top, 1 = dark at bottom)
|
|
79
|
-
const t = index / (lines.length - 1)
|
|
80
|
-
|
|
81
|
-
// Silver gradient for left part
|
|
82
|
-
const silverR = Math.round(
|
|
83
|
-
silverLight.r + (silverDark.r - silverLight.r) * t,
|
|
84
|
-
)
|
|
85
|
-
const silverG = Math.round(
|
|
86
|
-
silverLight.g + (silverDark.g - silverLight.g) * t,
|
|
87
|
-
)
|
|
88
|
-
const silverB = Math.round(
|
|
89
|
-
silverLight.b + (silverDark.b - silverLight.b) * t,
|
|
90
|
-
)
|
|
91
|
-
const silverCode = `\x1b[38;2;${silverR};${silverG};${silverB}m`
|
|
92
|
-
|
|
93
|
-
// Orange gradient for right part
|
|
94
|
-
const orangeR = Math.round(
|
|
95
|
-
orangeLight.r + (orangeDark.r - orangeLight.r) * t,
|
|
96
|
-
)
|
|
97
|
-
const orangeG = Math.round(
|
|
98
|
-
orangeLight.g + (orangeDark.g - orangeLight.g) * t,
|
|
99
|
-
)
|
|
100
|
-
const orangeB = Math.round(
|
|
101
|
-
orangeLight.b + (orangeDark.b - orangeLight.b) * t,
|
|
102
|
-
)
|
|
103
|
-
const orangeCode = `\x1b[38;2;${orangeR};${orangeG};${orangeB}m`
|
|
104
|
-
|
|
105
|
-
return `${silverCode}${leftPart}${orangeCode}${rightPart}${reset}`
|
|
106
|
-
})
|
|
31
|
+
return text
|
|
32
|
+
.split('\n')
|
|
33
|
+
.map((line) => `${orange}${line}${reset}`)
|
|
107
34
|
.join('\n')
|
|
108
35
|
}
|
|
109
36
|
|
|
110
|
-
const logoArt =
|
|
111
|
-
const textArt =
|
|
37
|
+
const logoArt = colorizeOrange(logoLines)
|
|
38
|
+
const textArt = textLines
|
|
112
39
|
console.log(logoArt)
|
|
113
40
|
console.log(textArt)
|
|
114
41
|
console.log('\n\n')
|
package/package.json
CHANGED
package/test-split.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const textLines = [
|
|
2
|
-
' _ __ _ ',
|
|
3
|
-
' ___ _ __ (_) ___ / _| | __ _ _ __ ___ ',
|
|
4
|
-
" / _ \\ '_ \\| |/ __| |_| |/ _` | '__/ _ \\",
|
|
5
|
-
' | __/ |_) | | (__| _| | (_| | | | __/',
|
|
6
|
-
' \\___| .__/|_|\\___|_| |_|\\__,_|_| \\___|',
|
|
7
|
-
' |_| ',
|
|
8
|
-
]
|
|
9
|
-
|
|
10
|
-
const splitPoints = [20, 20, 20, 20, 20, 12]
|
|
11
|
-
|
|
12
|
-
textLines.forEach((line, i) => {
|
|
13
|
-
const split = splitPoints[i]
|
|
14
|
-
const left = line.slice(0, split)
|
|
15
|
-
const right = line.slice(split)
|
|
16
|
-
console.log(`Line ${i + 1}:`)
|
|
17
|
-
console.log(` Left (${left.length}): "${left}"`)
|
|
18
|
-
console.log(` Right (${right.length}): "${right}"`)
|
|
19
|
-
console.log('')
|
|
20
|
-
})
|