@typed-assistant/builder 0.0.26 → 0.0.28
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 +1 -1
- package/src/appProcess.tsx +4 -9
- package/src/setupWebserver.tsx +9 -2
package/package.json
CHANGED
package/src/appProcess.tsx
CHANGED
|
@@ -33,13 +33,6 @@ async function startApp(appSourceFile: string) {
|
|
|
33
33
|
return Bun.spawn(["bun", path], {
|
|
34
34
|
stderr: "pipe",
|
|
35
35
|
env: { ...process.env, FORCE_COLOR: "1" },
|
|
36
|
-
onExit(proc, exitCode, signalCode, error) {
|
|
37
|
-
log("😅😅😅 ~ error:", error)
|
|
38
|
-
log("😅😅😅 ~ signalCode:", signalCode)
|
|
39
|
-
log("😅😅😅 ~ exitCode:", exitCode)
|
|
40
|
-
log("😅😅😅 ~ proc:", proc)
|
|
41
|
-
// exit handler
|
|
42
|
-
},
|
|
43
36
|
})
|
|
44
37
|
}
|
|
45
38
|
|
|
@@ -75,6 +68,7 @@ const checkProcesses = async (
|
|
|
75
68
|
log(ps)
|
|
76
69
|
onProcessError?.(message)
|
|
77
70
|
// restartAddon()
|
|
71
|
+
return
|
|
78
72
|
}
|
|
79
73
|
} else {
|
|
80
74
|
multipleProcessesErrorCount = 0
|
|
@@ -88,6 +82,7 @@ const checkProcesses = async (
|
|
|
88
82
|
log(ps)
|
|
89
83
|
onProcessError?.(message)
|
|
90
84
|
// restartAddon()
|
|
85
|
+
return
|
|
91
86
|
}
|
|
92
87
|
} else {
|
|
93
88
|
noProcessesErrorCount = 0
|
|
@@ -188,12 +183,12 @@ function setupWatcher({
|
|
|
188
183
|
}: {
|
|
189
184
|
directoryToWatch: string
|
|
190
185
|
onSubprocessChange: (newSubprosses: {
|
|
191
|
-
app: Subprocess<"ignore", "pipe", "
|
|
186
|
+
app: Subprocess<"ignore", "pipe", "pipe">
|
|
192
187
|
}) => void
|
|
193
188
|
entryFile: string
|
|
194
189
|
mdiPaths: string[] | undefined
|
|
195
190
|
getSubprocesses: () => {
|
|
196
|
-
app: Subprocess<"ignore", "pipe", "
|
|
191
|
+
app: Subprocess<"ignore", "pipe", "pipe">
|
|
197
192
|
}
|
|
198
193
|
}) {
|
|
199
194
|
log("👀 Watching directory:", directoryToWatch)
|
package/src/setupWebserver.tsx
CHANGED
|
@@ -49,7 +49,7 @@ export const startWebappServer = async ({
|
|
|
49
49
|
}: {
|
|
50
50
|
basePath: string
|
|
51
51
|
getSubprocesses: () => {
|
|
52
|
-
app: Subprocess<"ignore", "pipe", "
|
|
52
|
+
app: Subprocess<"ignore", "pipe", "pipe">
|
|
53
53
|
}
|
|
54
54
|
}) => {
|
|
55
55
|
const buildResult = await Bun.build({
|
|
@@ -168,6 +168,7 @@ export const startWebappServer = async ({
|
|
|
168
168
|
// eslint-disable-next-line no-constant-condition
|
|
169
169
|
while (true) {
|
|
170
170
|
const stdoutReader = getReader(getSubprocesses().app.stdout)
|
|
171
|
+
const stderrReader = getReader(getSubprocesses().app.stderr)
|
|
171
172
|
const { value } = await stdoutReader.read()
|
|
172
173
|
|
|
173
174
|
const newLocal = decoder.decode(value)
|
|
@@ -176,10 +177,16 @@ export const startWebappServer = async ({
|
|
|
176
177
|
lastMessage = convertedMessage
|
|
177
178
|
}
|
|
178
179
|
if (convertedMessage === "") {
|
|
180
|
+
const { value } = await stderrReader.read()
|
|
181
|
+
const newLocal = decoder.decode(value)
|
|
182
|
+
const convertedMessage = convert.toHtml(newLocal)
|
|
183
|
+
|
|
179
184
|
subscribers.forEach((send) =>
|
|
180
185
|
send(
|
|
181
186
|
"Process is returning an empty string. This was the last non-empty message:\n\n" +
|
|
182
|
-
lastMessage
|
|
187
|
+
lastMessage +
|
|
188
|
+
"\n\nstderr:\n\n" +
|
|
189
|
+
convertedMessage,
|
|
183
190
|
),
|
|
184
191
|
)
|
|
185
192
|
await new Promise((resolve) => setTimeout(resolve, 1000))
|