bimba-cli 0.1.6 → 0.1.8
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/plugin.js +1 -1
- package/utils.js +17 -17
package/package.json
CHANGED
package/plugin.js
CHANGED
|
@@ -86,7 +86,7 @@ export const imbaPlugin = {
|
|
|
86
86
|
|
|
87
87
|
// clear previous cached version
|
|
88
88
|
const glob = new Glob(Bun.hash(path) + '_' + "*.js");
|
|
89
|
-
for await (const file of glob.scan(cache)) unlink(cache + file);
|
|
89
|
+
for await (const file of glob.scan(cache)) if (fs.existsSync(cache + file)) unlink(cache + file);
|
|
90
90
|
|
|
91
91
|
// if no cached version read and compile it with the imba compiler
|
|
92
92
|
const file = await Bun.file(path).text();
|
package/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function colorize(text
|
|
1
|
+
function colorize(text, fg, bg) {
|
|
2
2
|
let result = ''
|
|
3
3
|
if(fg) result += "\x1b[38;5;" + fg.toString() + "m"
|
|
4
4
|
if(bg) result += "\x1b[48;5;" + bg.toString() + "m"
|
|
@@ -10,21 +10,21 @@ function colorize(text:string, fg?:number, bg?:number) {
|
|
|
10
10
|
// theme for messages printed in terminal
|
|
11
11
|
// https://i.stack.imgur.com/KTSQa.png
|
|
12
12
|
export const theme = {
|
|
13
|
-
code: (text
|
|
14
|
-
margin: (text
|
|
15
|
-
error: (text
|
|
16
|
-
ecode: (text
|
|
17
|
-
action: (text
|
|
18
|
-
folder: (text
|
|
19
|
-
filename: (text
|
|
20
|
-
success: (text
|
|
21
|
-
failure: (text
|
|
13
|
+
code: (text) => colorize(text, 252, 238),
|
|
14
|
+
margin: (text) => colorize(text, 229, 145),
|
|
15
|
+
error: (text) => colorize(text, 196 , 52),
|
|
16
|
+
ecode: (text) => colorize(text, 196, 238),
|
|
17
|
+
action: (text) => colorize(text, 237),
|
|
18
|
+
folder: (text) => colorize(text, 240),
|
|
19
|
+
filename: (text) => colorize(text, 15),
|
|
20
|
+
success: (text) => colorize(text, 40),
|
|
21
|
+
failure: (text) => colorize(text, 15, 124),
|
|
22
22
|
|
|
23
|
-
flags: (text
|
|
24
|
-
count: (text
|
|
25
|
-
start: (text
|
|
26
|
-
filedir: (text
|
|
27
|
-
time: (text
|
|
28
|
-
link: (text
|
|
29
|
-
online: (text
|
|
23
|
+
flags: (text) => colorize(text, 5),
|
|
24
|
+
count: (text) => colorize(text, 15),
|
|
25
|
+
start: (text) => colorize(text, 252, 233),
|
|
26
|
+
filedir: (text) => colorize(text, 15),
|
|
27
|
+
time: (text) => colorize(text, 41),
|
|
28
|
+
link: (text) => colorize(text, 15),
|
|
29
|
+
online: (text) => colorize(text, 40, 22)
|
|
30
30
|
}
|