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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/plugin.js +1 -1
  3. package/utils.js +17 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bimba-cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "repository": "github:HeapVoid/bimba",
5
5
  "module": "index.js",
6
6
  "bin": {
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:string, fg?:number, bg?:number) {
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:string) => colorize(text, 252, 238),
14
- margin: (text:string) => colorize(text, 229, 145),
15
- error: (text:string) => colorize(text, 196 , 52),
16
- ecode: (text:string) => colorize(text, 196, 238),
17
- action: (text:string) => colorize(text, 237),
18
- folder: (text:string) => colorize(text, 240),
19
- filename: (text:string) => colorize(text, 15),
20
- success: (text:string) => colorize(text, 40),
21
- failure: (text:string) => colorize(text, 15, 124),
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:string) => colorize(text, 5),
24
- count: (text:string) => colorize(text, 15),
25
- start: (text:string) => colorize(text, 252, 233),
26
- filedir: (text:string) => colorize(text, 15),
27
- time: (text:string) => colorize(text, 41),
28
- link: (text:string) => colorize(text, 15),
29
- online: (text:string) => colorize(text, 40, 22)
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
  }