bimba-cli 0.3.2 → 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/package.json +21 -21
- package/plugin.js +3 -3
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();
|