@typed-assistant/builder 0.0.7 → 0.0.9
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 +4 -4
- package/src/appProcess.tsx +6 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typed-assistant/builder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./appProcess": "./src/appProcess.tsx",
|
|
6
6
|
"./bunInstall": "./src/bunInstall.tsx",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"eslint": "^8.56.0",
|
|
18
18
|
"home-assistant-js-websocket": "^8.2.0",
|
|
19
19
|
"typescript": "^5.3.3",
|
|
20
|
-
"@typed-assistant/eslint-config": "0.0.4",
|
|
21
|
-
"@typed-assistant/logger": "0.0.5",
|
|
22
20
|
"@typed-assistant/typescript-config": "0.0.4",
|
|
23
|
-
"@typed-assistant/utils": "0.0.
|
|
21
|
+
"@typed-assistant/utils": "0.0.7",
|
|
22
|
+
"@typed-assistant/eslint-config": "0.0.4",
|
|
23
|
+
"@typed-assistant/logger": "0.0.5"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"home-assistant-js-websocket": "^8.2.0"
|
package/src/appProcess.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { readFileSync, watch } from "fs"
|
|
|
5
5
|
import { join, relative } from "path"
|
|
6
6
|
import ignore from "ignore"
|
|
7
7
|
import { ONE_SECOND } from "@typed-assistant/utils/durations"
|
|
8
|
-
import {
|
|
8
|
+
import { getHassAPI, getSupervisorAPI } from "@typed-assistant/utils/getHassAPI"
|
|
9
9
|
import { pullChanges } from "./pullChanges"
|
|
10
10
|
import { withErrorHandling } from "@typed-assistant/utils/withErrorHandling"
|
|
11
11
|
|
|
@@ -22,7 +22,7 @@ async function buildAndStartAppProcess(
|
|
|
22
22
|
async function startApp(appSourceFile: string = "src/entry.tsx") {
|
|
23
23
|
log("🚀 Starting app...")
|
|
24
24
|
const path = join(process.cwd(), appSourceFile)
|
|
25
|
-
return Bun.spawn(["bun", path], {
|
|
25
|
+
return Bun.spawn(["bun", path], { env: { FORCE_COLOR: "1" } })
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
async function kill(process: Subprocess) {
|
|
@@ -87,7 +87,6 @@ const setupGitSync = async ({
|
|
|
87
87
|
/** Duration in seconds */
|
|
88
88
|
gitPullPollDuration?: number
|
|
89
89
|
} = {}) => {
|
|
90
|
-
log(`😅 Attempting to pull changes...`)
|
|
91
90
|
const duration = gitPullPollDuration ?? 30
|
|
92
91
|
const { error } = await pullChanges()
|
|
93
92
|
if (error) return
|
|
@@ -106,13 +105,13 @@ const shouldIgnoreFileOrFolder = (filename: string) =>
|
|
|
106
105
|
|
|
107
106
|
const restartAddon = async () => {
|
|
108
107
|
log("♻️ Restarting addon...")
|
|
109
|
-
await
|
|
110
|
-
method: "POST",
|
|
111
|
-
})
|
|
108
|
+
await getHassAPI(`http://supervisor/addons/self/restart`, { method: "POST" })
|
|
112
109
|
}
|
|
113
110
|
|
|
114
111
|
const getAddonInfo = async () => {
|
|
115
112
|
log("🔍 Getting addon info...")
|
|
116
113
|
|
|
117
|
-
return withErrorHandling(
|
|
114
|
+
return withErrorHandling(getSupervisorAPI)<{
|
|
115
|
+
data: { ingress_entry: string }
|
|
116
|
+
}>("/addons/self/info")
|
|
118
117
|
}
|