bimba-cli 0.3.1 → 0.3.3
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.js +3 -3
- package/package.json +21 -21
- package/plugin.js +3 -3
package/index.js
CHANGED
|
@@ -99,7 +99,7 @@ async function bundle() {
|
|
|
99
99
|
|
|
100
100
|
const start = Date.now();
|
|
101
101
|
|
|
102
|
-
console.log("──────────────────────────────────────────────────────────────────────");
|
|
102
|
+
console.log(theme.folder("──────────────────────────────────────────────────────────────────────"));
|
|
103
103
|
console.log(theme.start(`Start building the Imba entrypoint: ${theme.filedir(entrypoint)}`));
|
|
104
104
|
|
|
105
105
|
let result = undefined
|
|
@@ -125,10 +125,10 @@ async function bundle() {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
catch(error) {
|
|
128
|
-
console.log(
|
|
128
|
+
console.log(theme.folder("──────────────────────────────────────────────────────────────────────"));
|
|
129
129
|
console.log('')
|
|
130
130
|
console.log(error)
|
|
131
|
-
console.log(
|
|
131
|
+
console.log(theme.folder("──────────────────────────────────────────────────────────────────────"));
|
|
132
132
|
console.log(theme.failure(" Failure ") + theme.filename(' Bun found an error in the compiled JS file'))
|
|
133
133
|
}
|
|
134
134
|
finally {
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "bimba-cli",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"repository": {
|
|
5
|
-
"type": "git",
|
|
6
|
-
"url": "git+https://github.com/HeapVoid/bimba.git"
|
|
7
|
-
},
|
|
8
|
-
"module": "index.js",
|
|
9
|
-
"bin": {
|
|
10
|
-
"bimba": "index.js"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"upload": "npm publish"
|
|
14
|
-
},
|
|
15
|
-
"description": "The CLI tool to run Imba projects under Bun",
|
|
16
|
-
"keywords": ["imba", "bun", "plugin"],
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"type": "module",
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"imba": "latest"
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "bimba-cli",
|
|
3
|
+
"version": "0.3.3",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/HeapVoid/bimba.git"
|
|
7
|
+
},
|
|
8
|
+
"module": "index.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"bimba": "index.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"upload": "npm publish"
|
|
14
|
+
},
|
|
15
|
+
"description": "The CLI tool to run Imba projects under Bun",
|
|
16
|
+
"keywords": ["imba", "bun", "plugin"],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"imba": "latest"
|
|
21
|
+
}
|
|
22
22
|
}
|
package/plugin.js
CHANGED
|
@@ -6,7 +6,7 @@ import fs from 'fs'
|
|
|
6
6
|
import { Glob } from "bun";
|
|
7
7
|
import { unlink } from "node:fs/promises";
|
|
8
8
|
|
|
9
|
-
export const cache = process.cwd()
|
|
9
|
+
export const cache = dir.join(process.cwd(), '.cache')
|
|
10
10
|
if (!fs.existsSync(cache)){ fs.mkdirSync(cache);}
|
|
11
11
|
|
|
12
12
|
// this should be reset from outside to get results of entrypoint building
|
|
@@ -29,7 +29,7 @@ export const imbaPlugin = {
|
|
|
29
29
|
let contents = '';
|
|
30
30
|
|
|
31
31
|
// return the cached version if exists
|
|
32
|
-
const cached = cache
|
|
32
|
+
const cached = dir.join(cache, Bun.hash(path) + '_' + fs.statSync(path).mtimeMs + '.js');
|
|
33
33
|
if (fs.existsSync(cached)) {
|
|
34
34
|
stats.bundled++;
|
|
35
35
|
stats.cached++;
|
|
@@ -43,7 +43,7 @@ export const imbaPlugin = {
|
|
|
43
43
|
|
|
44
44
|
// clear previous cached version
|
|
45
45
|
const glob = new Glob(Bun.hash(path) + '_' + "*.js");
|
|
46
|
-
for await (const file of glob.scan(cache)) if (fs.existsSync(cache
|
|
46
|
+
for await (const file of glob.scan(cache)) if (fs.existsSync(dir.join(cache, file))) unlink(dir.join(cache, file));
|
|
47
47
|
|
|
48
48
|
// if no cached version read and compile it with the imba compiler
|
|
49
49
|
const file = await Bun.file(path).text();
|