Distinguish services from scripts with type system and runtime tracking

This commit is contained in:
Mohamed Boudra
2026-04-09 23:45:00 +07:00
parent c7399084a4
commit b1b85833bb
27 changed files with 1265 additions and 493 deletions
@@ -38,11 +38,13 @@ describe("normalizeWorkspaceDescriptor", () => {
const scripts = [
{
scriptName: "web",
type: "service" as const,
hostname: "main.web.localhost",
port: 3000,
url: "http://main.web.localhost:6767",
lifecycle: "running" as const,
health: "healthy" as const,
exitCode: null,
},
];
const workspace = normalizeWorkspaceDescriptor({
@@ -64,11 +66,13 @@ describe("normalizeWorkspaceDescriptor", () => {
expect(workspace.scripts).toEqual([
{
scriptName: "web",
type: "service",
hostname: "main.web.localhost",
port: 3000,
url: "http://main.web.localhost:6767",
lifecycle: "running",
health: "healthy",
exitCode: null,
},
]);
expect(workspace.scripts).not.toBe(scripts);
@@ -111,11 +115,13 @@ describe("mergeWorkspaces", () => {
scripts: [
{
scriptName: "web",
type: "service",
hostname: "main.web.localhost",
port: 3000,
url: "http://main.web.localhost:6767",
lifecycle: "running",
health: "healthy",
exitCode: null,
},
],
}),
@@ -124,11 +130,13 @@ describe("mergeWorkspaces", () => {
expect(store.getSession("test-server")?.workspaces.get("/repo/main")?.scripts).toEqual([
{
scriptName: "web",
type: "service",
hostname: "main.web.localhost",
port: 3000,
url: "http://main.web.localhost:6767",
lifecycle: "running",
health: "healthy",
exitCode: null,
},
]);
});