@typed-assistant/builder 0.0.24 → 0.0.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typed-assistant/builder",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "exports": {
5
5
  "./appProcess": "./src/appProcess.tsx",
6
6
  "./bunInstall": "./src/bunInstall.tsx",
@@ -24,10 +24,10 @@
24
24
  "home-assistant-js-websocket": "^8.2.0",
25
25
  "ts-toolbelt": "^9.6.0",
26
26
  "typescript": "^5.3.3",
27
- "@typed-assistant/eslint-config": "0.0.5",
28
- "@typed-assistant/logger": "0.0.9",
29
- "@typed-assistant/typescript-config": "0.0.5",
30
- "@typed-assistant/utils": "0.0.8"
27
+ "@typed-assistant/eslint-config": "0.0.6",
28
+ "@typed-assistant/logger": "0.0.10",
29
+ "@typed-assistant/typescript-config": "0.0.6",
30
+ "@typed-assistant/utils": "0.0.9"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "home-assistant-js-websocket": "^8.2.0"
@@ -33,6 +33,13 @@ 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
+ },
36
43
  })
37
44
  }
38
45
 
@@ -65,8 +72,9 @@ const checkProcesses = async (
65
72
  if (multipleProcessesErrorCount > 5) {
66
73
  const message = `🚨 Multiple processes detected. Restarting TypedAssistant addon...`
67
74
  log(message)
75
+ log(ps)
68
76
  onProcessError?.(message)
69
- restartAddon()
77
+ // restartAddon()
70
78
  }
71
79
  } else {
72
80
  multipleProcessesErrorCount = 0
@@ -77,8 +85,9 @@ const checkProcesses = async (
77
85
  if (noProcessesErrorCount > 5) {
78
86
  const message = `🚨 No processes detected. Restarting TypedAssistant addon...`
79
87
  log(message)
88
+ log(ps)
80
89
  onProcessError?.(message)
81
- restartAddon()
90
+ // restartAddon()
82
91
  }
83
92
  } else {
84
93
  noProcessesErrorCount = 0
@@ -105,6 +114,7 @@ export async function setup({
105
114
  let subprocesses = await buildAndStartAppProcess(entryFile, {
106
115
  mdiPaths: mdiPaths,
107
116
  })
117
+
108
118
  startWebappServer({
109
119
  basePath,
110
120
  getSubprocesses: () => subprocesses,
@@ -178,12 +188,12 @@ function setupWatcher({
178
188
  }: {
179
189
  directoryToWatch: string
180
190
  onSubprocessChange: (newSubprosses: {
181
- app: Subprocess<"ignore", "pipe", "pipe">
191
+ app: Subprocess<"ignore", "pipe", "inherit">
182
192
  }) => void
183
193
  entryFile: string
184
194
  mdiPaths: string[] | undefined
185
195
  getSubprocesses: () => {
186
- app: Subprocess<"ignore", "pipe", "pipe">
196
+ app: Subprocess<"ignore", "pipe", "inherit">
187
197
  }
188
198
  }) {
189
199
  log("👀 Watching directory:", directoryToWatch)
@@ -49,7 +49,7 @@ export const startWebappServer = async ({
49
49
  }: {
50
50
  basePath: string
51
51
  getSubprocesses: () => {
52
- app: Subprocess<"ignore", "pipe", "pipe">
52
+ app: Subprocess<"ignore", "pipe", "inherit">
53
53
  }
54
54
  }) => {
55
55
  const buildResult = await Bun.build({