@typed-assistant/builder 0.0.43 → 0.0.45

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.43",
3
+ "version": "0.0.45",
4
4
  "exports": {
5
5
  "./appProcess": "./src/appProcess.tsx",
6
6
  "./bunInstall": "./src/bunInstall.tsx",
@@ -25,9 +25,9 @@
25
25
  "ts-toolbelt": "^9.6.0",
26
26
  "typescript": "^5.3.3",
27
27
  "@typed-assistant/eslint-config": "0.0.8",
28
+ "@typed-assistant/utils": "0.0.14",
28
29
  "@typed-assistant/logger": "0.0.13",
29
- "@typed-assistant/typescript-config": "0.0.8",
30
- "@typed-assistant/utils": "0.0.14"
30
+ "@typed-assistant/typescript-config": "0.0.8"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "home-assistant-js-websocket": "^8.2.0"
@@ -31,6 +31,7 @@ export async function setup({
31
31
  const slug = addonInfo?.data.slug ?? ""
32
32
  const directoryToWatch = join(process.cwd(), "./src")
33
33
  const addonUrl = `${slug}/ingress`
34
+ const webhookUrl = `${process.env.HASS_EXTERNAL_URL}${basePath}/webhook`
34
35
 
35
36
  let subprocesses = await buildAndStartAppProcess(entryFile, {
36
37
  mdiPaths: mdiPaths,
@@ -51,7 +52,7 @@ export async function setup({
51
52
  })
52
53
 
53
54
  checkProcesses(entryFile, { addonUrl, onProcessError })
54
- await setupGitSync()
55
+ await setupGitSync(webhookUrl)
55
56
 
56
57
  return subprocesses
57
58
  }
@@ -145,7 +146,7 @@ const getAddonInfo = async () => {
145
146
  return data
146
147
  }
147
148
 
148
- const setupGitSync = async () => {
149
+ const setupGitSync = async (webhookUrl: string) => {
149
150
  if (
150
151
  !process.env.GITHUB_TOKEN ||
151
152
  !process.env.GITHUB_USERNAME ||
@@ -157,7 +158,7 @@ const setupGitSync = async () => {
157
158
  return { error: {} }
158
159
  }
159
160
  if (process.env.HASS_EXTERNAL_URL) {
160
- await setupWebhook()
161
+ await setupWebhook(webhookUrl)
161
162
  return
162
163
  }
163
164
  logger.warn("⚠️ No HASS_EXTERNAL_URL found. Setting up git poller...")
@@ -162,7 +162,7 @@ export const startWebappServer = async ({
162
162
  .ws("/ws", {
163
163
  response: t.String(),
164
164
  async open(ws) {
165
- ws.send("Connected successfully. Awaiting messages...")
165
+ ws.send(lastMessage || "Connected successfully. Awaiting messages...")
166
166
  subscribers.set(ws.id, (message) => {
167
167
  ws.send(message)
168
168
  })