feat: remove nextjs production runtime (#1389)

This commit is contained in:
Carlos Florêncio
2026-06-18 18:36:48 +01:00
committed by GitHub
parent 2781556ead
commit aee1846cd5
368 changed files with 10228 additions and 3306 deletions
+12 -5
View File
@@ -17,7 +17,9 @@ function createFakeBundle(dir: string) {
fs.writeFileSync(path.join(dir, "bin", "kandev"), "fake");
fs.writeFileSync(path.join(dir, "bin", "agentctl"), "fake");
fs.mkdirSync(path.join(dir, "web"), { recursive: true });
fs.writeFileSync(path.join(dir, "web", "server.js"), "fake");
fs.writeFileSync(path.join(dir, "web", "index.html"), '<div id="root"></div>');
fs.mkdirSync(path.join(dir, "web", "assets"), { recursive: true });
fs.writeFileSync(path.join(dir, "web", "assets", "index.js"), "fake");
}
describe("validateBundle", () => {
@@ -40,7 +42,7 @@ describe("validateBundle", () => {
fs.mkdirSync(path.join(tmpDir, "bin"), { recursive: true });
fs.writeFileSync(path.join(tmpDir, "bin", "agentctl"), "fake");
fs.mkdirSync(path.join(tmpDir, "web"), { recursive: true });
fs.writeFileSync(path.join(tmpDir, "web", "server.js"), "fake");
fs.writeFileSync(path.join(tmpDir, "web", "index.html"), "");
expect(() => validateBundle(tmpDir)).toThrow(/Backend binary not found/);
});
@@ -48,15 +50,20 @@ describe("validateBundle", () => {
fs.mkdirSync(path.join(tmpDir, "bin"), { recursive: true });
fs.writeFileSync(path.join(tmpDir, "bin", "kandev"), "fake");
fs.mkdirSync(path.join(tmpDir, "web"), { recursive: true });
fs.writeFileSync(path.join(tmpDir, "web", "server.js"), "fake");
fs.writeFileSync(path.join(tmpDir, "web", "index.html"), "");
expect(() => validateBundle(tmpDir)).toThrow(/agentctl binary not found/);
});
it("throws when web server.js is missing", () => {
it("does not require external web assets", () => {
fs.mkdirSync(path.join(tmpDir, "bin"), { recursive: true });
fs.writeFileSync(path.join(tmpDir, "bin", "kandev"), "fake");
fs.writeFileSync(path.join(tmpDir, "bin", "agentctl"), "fake");
expect(() => validateBundle(tmpDir)).toThrow(/Web server.*not found/);
expect(() => validateBundle(tmpDir)).not.toThrow();
});
it("does not require a Node web server in the runtime bundle", () => {
createFakeBundle(tmpDir);
expect(() => validateBundle(tmpDir)).not.toThrow();
});
});