fix: restore Symcon instance discovery
This commit is contained in:
1 parent
2a81b4a502
commit
4a875aa8ea
10 files changed
+146
-10
No files matched your search
+4
-1
@@ -3,6 +3,7 @@
|
||||
import { build, context } from "esbuild";
|
||||
import { createHash } from "node:crypto";
|
||||
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync } from "node:fs";
|
||||
import { validateSymconPackage } from "../symcon/tests/validate-package.mjs";
|
||||
|
||||
const out = "../custom_components/nextfloor/frontend";
|
||||
// IP-Symcon ships the same browser UI through the module's protected WebHook. Its designer and
|
||||
@@ -45,6 +46,7 @@ const editorConfig = (viewerHash) => ({
|
||||
// never taken from the browser cache (the integration version only changes after a restart).
|
||||
// the frontend knows its own version, to notice a backend that still runs an older one
|
||||
const version = JSON.parse(readFileSync("../custom_components/nextfloor/manifest.json", "utf8")).version;
|
||||
const symconVersion = JSON.parse(readFileSync("../symcon/library.json", "utf8")).version;
|
||||
const mainConfig = (viewerHash, editorHash, cardEditorHash) => ({
|
||||
...common,
|
||||
entryPoints: ["src/main.ts"],
|
||||
@@ -74,7 +76,7 @@ const symconHostConfig = (viewerHash, editorHash, cardEditorHash) => ({
|
||||
__NF_VIEWER_HASH__: JSON.stringify(viewerHash),
|
||||
__NF_EDITOR_HASH__: JSON.stringify(editorHash),
|
||||
__NF_CARD_EDITOR_HASH__: JSON.stringify(cardEditorHash),
|
||||
__NF_VERSION__: JSON.stringify(version),
|
||||
__NF_VERSION__: JSON.stringify(symconVersion),
|
||||
__NF_LANGS__: langs,
|
||||
},
|
||||
});
|
||||
@@ -132,6 +134,7 @@ if (watch) {
|
||||
await build(symconEditor);
|
||||
await build(symconCardEditorConfig);
|
||||
await build(symconHostConfig(hashOf(symconViewerConfig.outfile), hashOf(symconEditor.outfile), hashOf(symconCardEditorConfig.outfile)));
|
||||
validateSymconPackage();
|
||||
await build(builderConfig);
|
||||
let over = false;
|
||||
for (const [file, limit] of Object.entries(BUDGET)) {
|
||||
|
||||
Reference in new issue
Block a user