@typed-assistant/builder 0.0.76 → 0.0.77
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/CHANGELOG.md +6 -0
- package/package.json +3 -3
- package/src/setupWebserver.tsx +22 -22
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typed-assistant/builder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./appProcess": "./src/appProcess.tsx",
|
|
6
6
|
"./bunInstall": "./src/bunInstall.tsx",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"eslint-plugin-html": "^7.1.0",
|
|
29
29
|
"ts-toolbelt": "^9.6.0",
|
|
30
30
|
"typescript": "^5.4.0",
|
|
31
|
-
"@typed-assistant/eslint-config": "0.0.10",
|
|
32
31
|
"@typed-assistant/logger": "0.0.21",
|
|
33
32
|
"@typed-assistant/utils": "0.0.18",
|
|
34
|
-
"@typed-assistant/typescript-config": "0.0.10"
|
|
33
|
+
"@typed-assistant/typescript-config": "0.0.10",
|
|
34
|
+
"@typed-assistant/eslint-config": "0.0.10"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public",
|
package/src/setupWebserver.tsx
CHANGED
|
@@ -361,30 +361,30 @@ const getLogsFromFile = async ({
|
|
|
361
361
|
try {
|
|
362
362
|
const limit = Number(limitProp)
|
|
363
363
|
const offset = Number(offsetProp)
|
|
364
|
-
const
|
|
365
|
-
.
|
|
366
|
-
|
|
367
|
-
(
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const keywords = filter.toLowerCase().split(" ")
|
|
376
|
-
const logText = JSON.stringify(log).toLowerCase()
|
|
377
|
-
return keywords.every((keyword) => logText.includes(keyword))
|
|
378
|
-
})
|
|
379
|
-
|
|
380
|
-
const logFile = limit
|
|
381
|
-
? lines.slice(
|
|
382
|
-
lines.length - 1 - limit * (offset + 1),
|
|
383
|
-
lines.length - 1 - limit * offset,
|
|
364
|
+
const logs = (
|
|
365
|
+
await Bun.file("./log.txt")
|
|
366
|
+
.text()
|
|
367
|
+
.then((text) => text.split("\n"))
|
|
368
|
+
.then((lines) =>
|
|
369
|
+
limit
|
|
370
|
+
? lines.slice(
|
|
371
|
+
lines.length - 1 - limit * (offset + 1),
|
|
372
|
+
lines.length - 1 - limit * offset,
|
|
373
|
+
)
|
|
374
|
+
: lines,
|
|
384
375
|
)
|
|
385
|
-
|
|
376
|
+
).reduce((result, line) => {
|
|
377
|
+
if (filter && !line.toLowerCase().includes(filter.toLowerCase()))
|
|
378
|
+
return result
|
|
379
|
+
|
|
380
|
+
const log = line
|
|
381
|
+
? JSON.parse(line)
|
|
382
|
+
: { msg: "Empty line", level: levels.fatal }
|
|
383
|
+
if (log.level < levels[level]) return result
|
|
384
|
+
return result.concat(log)
|
|
385
|
+
}, [] as LogSchema[])
|
|
386
386
|
|
|
387
|
-
return { logs
|
|
387
|
+
return { logs }
|
|
388
388
|
} catch (e) {
|
|
389
389
|
return {
|
|
390
390
|
logs: [
|