feat: establish TypeScript-aware frontend tooling

This commit is contained in:
donghyeon-ka
2026-07-26 13:41:23 +09:00
parent 1a1747c737
commit 0fed35586a
41 changed files with 1086 additions and 125 deletions
@@ -0,0 +1,7 @@
import { createApplication } from "../../../../src/application/create-application.js";
export const applicationFactory = createApplication;
export function AllowedPresentationFixture() {
return <p>allowed</p>;
}
@@ -0,0 +1,5 @@
import "../../../../src/adapters/http/client.js";
export function InvalidPresentationFixture() {
return <p>invalid</p>;
}
+33
View File
@@ -0,0 +1,33 @@
{
"schemaVersion": 1,
"sourceDirectories": [],
"registries": [
{
"registryId": "FIXTURE-SOURCE",
"path": "tests/fixtures/registry/forbidden/invalid-registry.js",
"exportName": "INVALID_REGISTRY",
"owner": "fixture",
"requiredFields": ["id", "target"],
"uniqueFields": ["id"],
"references": [
{
"field": "target",
"registryId": "FIXTURE-TARGET",
"targetField": "id"
}
]
},
{
"registryId": "FIXTURE-TARGET",
"path": "tests/fixtures/registry/forbidden/invalid-registry.js",
"exportName": "TARGET_REGISTRY",
"owner": "fixture",
"requiredFields": ["id"],
"uniqueFields": ["id"]
}
],
"compatibilityImpact": {
"allowed": ["none", "additive", "behavior-change", "breaking"],
"current": "breaking"
}
}
+13
View File
@@ -0,0 +1,13 @@
type InvalidRow = Readonly<{
id: string;
target?: string;
}>;
export const INVALID_REGISTRY: Record<string, InvalidRow> = {
FIRST: { id: "duplicate", target: "missing" },
SECOND: { id: "duplicate" },
};
export const TARGET_REGISTRY = {
KNOWN: { id: "known" },
} as const;
+3
View File
@@ -0,0 +1,3 @@
export function SafeTextFixture({ value }: Readonly<{ value: string }>) {
return <p>{value}</p>;
}
+3
View File
@@ -0,0 +1,3 @@
export function UnsafeHtmlFixture({ value }: Readonly<{ value: string }>) {
return <div dangerouslySetInnerHTML={{ __html: value }} />;
}
@@ -0,0 +1,7 @@
interface ClockPort {
now(): number;
}
export const invalidClock: ClockPort = {
now: () => "not-a-number",
};
+7
View File
@@ -0,0 +1,7 @@
type Result<T, E> =
| Readonly<{ ok: true; value: T }>
| Readonly<{ ok: false; error: E }>;
export function invalidUnwrap(result: Result<number, string>): number {
return result.value;
}