@typed-assistant/builder 0.0.45 → 0.0.47
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 +3 -3
- package/src/killProcess.tsx +0 -2
- package/src/pullChanges.tsx +7 -3
- package/src/setupGitPoller.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typed-assistant/builder",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47",
|
|
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",
|
|
29
28
|
"@typed-assistant/logger": "0.0.13",
|
|
30
|
-
"@typed-assistant/typescript-config": "0.0.8"
|
|
29
|
+
"@typed-assistant/typescript-config": "0.0.8",
|
|
30
|
+
"@typed-assistant/utils": "0.0.14"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"home-assistant-js-websocket": "^8.2.0"
|
package/src/killProcess.tsx
CHANGED
|
@@ -14,12 +14,10 @@ export const addSoftKillListener = (listener: () => void | Promise<void>) => {
|
|
|
14
14
|
|
|
15
15
|
export async function callKillListeners() {
|
|
16
16
|
await Promise.all(killListeners.map((listener) => listener()))
|
|
17
|
-
logger.info("👋 Called all kill listeners!")
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
export async function callSoftKillListeners() {
|
|
21
20
|
await Promise.all(softKillListeners.map((listener) => listener()))
|
|
22
|
-
logger.info("👋 Called all soft kill listeners!")
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
export async function killSubprocess(subprocess: Subprocess) {
|
package/src/pullChanges.tsx
CHANGED
|
@@ -7,14 +7,18 @@ export const pullChanges = async () => {
|
|
|
7
7
|
const gitPullText = await $`git pull`.text()
|
|
8
8
|
const packageJSONUpdated = /package.json/.test(gitPullText)
|
|
9
9
|
const nothingNew = /Already up to date./.test(gitPullText)
|
|
10
|
+
if (!gitPullText) {
|
|
11
|
+
logger.error("⬇️🚨 Failed to pull changes.")
|
|
12
|
+
return { error: "Failed to pull changes." }
|
|
13
|
+
}
|
|
10
14
|
if (nothingNew) {
|
|
11
|
-
logger.info("
|
|
15
|
+
logger.info("⬇️👌 No new changes.")
|
|
12
16
|
return {}
|
|
13
17
|
} else {
|
|
14
|
-
logger.info("
|
|
18
|
+
logger.info("⬇️🆕 Changes pulled.")
|
|
15
19
|
}
|
|
16
20
|
if (packageJSONUpdated) {
|
|
17
|
-
logger.info("
|
|
21
|
+
logger.info("⬇️📦 package.json updated.")
|
|
18
22
|
await bunInstall()
|
|
19
23
|
}
|
|
20
24
|
return {}
|
package/src/setupGitPoller.tsx
CHANGED
|
@@ -10,7 +10,7 @@ export const setupGitPoller = async ({
|
|
|
10
10
|
gitPullPollDuration?: number
|
|
11
11
|
} = {}) => {
|
|
12
12
|
const duration = gitPullPollDuration ?? 30
|
|
13
|
-
const { error } = await
|
|
13
|
+
const { error } = await pullChanges()
|
|
14
14
|
if (error) return
|
|
15
15
|
logger.info(` ⏳ Pulling changes again in ${duration} seconds...`)
|
|
16
16
|
|