feat: establish TypeScript-aware frontend tooling
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -0,0 +1,3 @@
|
||||
export function SafeTextFixture({ value }: Readonly<{ value: string }>) {
|
||||
return <p>{value}</p>;
|
||||
}
|
||||
@@ -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",
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user