@batijs/build 0.0.234 → 0.0.236
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/dist/index.js +6 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { existsSync } from "fs";
|
|
3
3
|
import { mkdir, opendir, readFile as readFile2, writeFile } from "fs/promises";
|
|
4
4
|
import path from "path";
|
|
5
|
-
import { transformAndFormat as transformAndFormat2 } from "@batijs/core";
|
|
5
|
+
import { formatCode, transformAndFormat as transformAndFormat2 } from "@batijs/core";
|
|
6
6
|
|
|
7
7
|
// src/merge-dts.ts
|
|
8
8
|
import { readFile } from "fs/promises";
|
|
@@ -78,7 +78,7 @@ async function* walk(dir) {
|
|
|
78
78
|
} else if (d.isFile()) yield entry;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
function transformFileAfterExec(filepath, fileContent) {
|
|
81
|
+
async function transformFileAfterExec(filepath, fileContent) {
|
|
82
82
|
if (fileContent === void 0 || fileContent === null) return null;
|
|
83
83
|
const parsed = path.parse(filepath);
|
|
84
84
|
const toTest = [parsed.base, parsed.ext, parsed.name].filter(Boolean);
|
|
@@ -88,6 +88,9 @@ function transformFileAfterExec(filepath, fileContent) {
|
|
|
88
88
|
case ".js":
|
|
89
89
|
case ".tsx":
|
|
90
90
|
case ".jsx":
|
|
91
|
+
return formatCode(fileContent, {
|
|
92
|
+
filepath
|
|
93
|
+
});
|
|
91
94
|
case ".env":
|
|
92
95
|
case ".env.local":
|
|
93
96
|
case ".env.development":
|
|
@@ -174,7 +177,7 @@ Please report this issue to https://github.com/vikejs/bati`
|
|
|
174
177
|
const rf = () => {
|
|
175
178
|
return readFile2(target, { encoding: "utf-8" });
|
|
176
179
|
};
|
|
177
|
-
const fileContent = transformFileAfterExec(
|
|
180
|
+
const fileContent = await transformFileAfterExec(
|
|
178
181
|
target,
|
|
179
182
|
await transformer({
|
|
180
183
|
readfile: targets.has(target) ? rf : void 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@batijs/build",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.236",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@types/node": "^18.19.14",
|
|
12
12
|
"tsup": "^8.2.2",
|
|
13
|
-
"@batijs/compile": "0.0.
|
|
13
|
+
"@batijs/compile": "0.0.236"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@batijs/core": "0.0.
|
|
16
|
+
"@batijs/core": "0.0.236"
|
|
17
17
|
},
|
|
18
18
|
"main": "./dist/index.js",
|
|
19
19
|
"module": "./dist/index.js",
|