feat(plugin): expose app metadata (#38179)

This commit is contained in:
Dax 2026-07-21 18:16:25 -04:00 committed by GitHub
commit 8de40be6ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
71 changed files with 477 additions and 286 deletions

View file

@ -12,3 +12,9 @@ test("rejects ports outside the valid range", () => {
expect(Option.isNone(decode({ port: -1 }))).toBe(true)
expect(Option.isNone(decode({ port: 65_536 }))).toBe(true)
})
test("accepts optional app metadata", () => {
expect(
Option.getOrThrow(decode({ app: { name: "sdk", version: "1.2.3", channel: "beta" } })).app,
).toEqual({ name: "sdk", version: "1.2.3", channel: "beta" })
})

View file

@ -10,6 +10,7 @@ it.live("allows browser preflight requests without credentials", () =>
hostname: "127.0.0.1",
port: 0,
password: "secret",
app: { version: "test-version" },
database: { path: ":memory:" },
})
const response = yield* Effect.promise(() =>
@ -38,5 +39,6 @@ it.live("allows browser preflight requests without credentials", () =>
expect(health.status).toBe(200)
expect(health.headers.get("access-control-allow-origin")).toBe("http://localhost:3000")
expect(yield* Effect.promise(() => health.json())).toMatchObject({ version: "test-version" })
}),
)