refactor: split renderer ipc and unraid domains

This commit is contained in:
NuklearRabbit
2026-07-29 18:11:07 +02:00
parent 5d3731a853
commit 7b05c953b6
36 changed files with 9316 additions and 8330 deletions
+24 -61
View File
@@ -2,6 +2,14 @@ import test from "node:test";
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
const rendererFiles = ["app.js", "views.js", "dialogs.js", "operations.js", "actions/shell.js", "actions/inventory.js", "actions/deployment-profile.js", "actions/deployment-operation.js", "actions/setup-and-settings.js", "actions/recovery.js", "actions/command.js", "events.js"];
async function rendererSource() {
return (await Promise.all(rendererFiles.map((file) => readFile(new URL(`../src/renderer/${file}`, import.meta.url), "utf8")))).join("\n");
}
async function ipcSource() {
return (await Promise.all(["ipc.cjs", "ipc/repository-handlers.cjs", "ipc/deployment-handlers.cjs", "ipc/operations-handlers.cjs"].map((file) => readFile(new URL(`../src/main/${file}`, import.meta.url), "utf8")))).join("\n");
}
test("changed file list has an independently scrollable bounded layout", async () => {
const css = await readFile(
new URL("../src/renderer/styles.css", import.meta.url),
@@ -22,10 +30,7 @@ test("changed file list has an independently scrollable bounded layout", async (
});
test("commit workflow explains every disabled prerequisite", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
assert.match(renderer, /Commit message <span class="required-mark">required/);
assert.match(renderer, /Enter a commit message to enable commit and push/);
assert.match(renderer, /ForgeFlow stages the selected files automatically/);
@@ -34,10 +39,7 @@ test("commit workflow explains every disabled prerequisite", async () => {
});
test("ITWorx branding is integrated into titlebar and setup", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
assert.match(renderer, /itworx-mark\.png/);
assert.match(renderer, /itworx-wordmark-(?:light|dark)\.png/);
});
@@ -59,23 +61,14 @@ test("all modal content stays inside the viewport with a persistent action foote
});
test("settings provides one-click normalization for legacy Gitea origins", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
assert.match(renderer, /data-action="normalize-origins"/);
assert.match(renderer, /Normalize all origins/);
});
test("Git mutations are serialized per repository and expose repair actions", async () => {
const ipc = await readFile(
new URL("../src/main/ipc.cjs", import.meta.url),
"utf8",
);
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const ipc = await ipcSource();
const renderer = await rendererSource();
assert.match(ipc, /repositoryMutations = new Map/);
assert.match(ipc, /withRepositoryMutation/);
assert.match(ipc, /GIT_LOCKS_RECENT/);
@@ -87,10 +80,7 @@ test("Git mutations are serialized per repository and expose repair actions", as
});
test("SSH secrets are captured before the loading render clears password inputs", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
const passwordCapture = renderer.search(
/const password = document\.querySelector\(["']#server-password["']\)/,
);
@@ -101,10 +91,7 @@ test("SSH secrets are captured before the loading render clears password inputs"
});
test("SSH deployments are polled in the background and Portfolio casing is preserved", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
assert.match(renderer, /function startOperationPolling\(\)/);
assert.match(renderer, /startOperationPolling\(\);/);
assert.match(renderer, /Visible container name/);
@@ -112,10 +99,7 @@ test("SSH deployments are polled in the background and Portfolio casing is prese
});
test("deployment profiles expose built-in/uploaded DockerMan icons and automatic metadata repair", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
assert.match(renderer, /Built-in high-contrast ITWorx mark/);
assert.match(renderer, /profile-icon-mode/);
assert.match(renderer, /Repair DockerMan integration/);
@@ -123,24 +107,15 @@ test("deployment profiles expose built-in/uploaded DockerMan icons and automatic
});
test("repository troubleshooting offers personalized synchronization repair actions", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const ipc = await readFile(
new URL("../src/main/ipc.cjs", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
const ipc = await ipcSource();
assert.match(renderer, /repair-repository-sync/);
assert.match(renderer, /safety branch/);
assert.match(ipc, /repository:repair-sync/);
});
test("advanced Git, desktop, backup, policy and audit workflows are exposed in the renderer", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
const preload = await readFile(
new URL("../preload.cjs", import.meta.url),
"utf8",
@@ -171,10 +146,7 @@ test("advanced Git, desktop, backup, policy and audit workflows are exposed in t
});
test("one-click troubleshooting excludes destructive or publishing Git actions", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
const ipc = await readFile(
new URL("../src/main/ipc.cjs", import.meta.url),
"utf8",
@@ -210,10 +182,7 @@ test("premium repository workspace reserves separate rows for actions and releas
});
test("interactive project illustrations are semantic, responsive and motion-safe", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
const styles = await readFile(
new URL("../src/renderer/styles.css", import.meta.url),
"utf8",
@@ -228,10 +197,7 @@ test("interactive project illustrations are semantic, responsive and motion-safe
});
test("the diff canvas uses a contextual and motion-safe code illustration", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
const styles = await readFile(
new URL("../src/renderer/styles.css", import.meta.url),
"utf8",
@@ -245,10 +211,7 @@ test("the diff canvas uses a contextual and motion-safe code illustration", asyn
});
test("Git Validator exposes scored best-practice checks and bounded repairs", async () => {
const renderer = await readFile(
new URL("../src/renderer/app.js", import.meta.url),
"utf8",
);
const renderer = await rendererSource();
const styles = await readFile(
new URL("../src/renderer/styles.css", import.meta.url),
"utf8",
@@ -267,7 +230,7 @@ test("Git Validator exposes scored best-practice checks and bounded repairs", as
});
test("renderer guards accessible names, labels and uncertain inventory evidence", async () => {
const renderer = await readFile(new URL("../src/renderer/app.js", import.meta.url), "utf8");
const renderer = await rendererSource();
const styles = await readFile(new URL("../src/renderer/styles.css", import.meta.url), "utf8");
assert.match(renderer, /button\.icon-button:not\(\[aria-label\]\)/);
assert.match(renderer, /\.field > label:not\(\[for\]\)/);