feat: 기능 추가 과정중
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
import { createRuntimeAdapters } from "../../../../src/bootstrap/runtime-adapters.js";
|
||||
import { createRuntimeAdapters } from "../../../../src/bootstrap/runtime-adapters.ts";
|
||||
|
||||
export const bootstrapFactory = createRuntimeAdapters;
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import { createApplication } from "../../../../src/application/create-application.js";
|
||||
import { createApplication } from "../../../../src/application/create-application.ts";
|
||||
|
||||
export const applicationFactory = createApplication;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createApplication } from "../../../../src/application/create-application.js";
|
||||
import { createApplication } from "../../../../src/application/create-application.ts";
|
||||
|
||||
export const applicationFactory = createApplication;
|
||||
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import type { Value } from "../domain/value.ts";
|
||||
|
||||
export function readValue(): Value {
|
||||
return { id: "fixture-value" };
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export type Value = {
|
||||
readonly id: string;
|
||||
};
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { readValue } from "../application/read-value.ts";
|
||||
|
||||
export function ValueView() {
|
||||
return <p>{readValue().id}</p>;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import { second } from "./second.ts";
|
||||
|
||||
export const first = `first:${second}`;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { first } from "./first.ts";
|
||||
|
||||
export const second = `second:${first}`;
|
||||
@@ -0,0 +1 @@
|
||||
export const runtimeName = "forbidden-runtime";
|
||||
@@ -0,0 +1,3 @@
|
||||
import { runtimeName } from "../adapters/runtime.ts";
|
||||
|
||||
export const selectedRuntime = runtimeName;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
const modulePath = "../domain/value.ts";
|
||||
|
||||
export async function loadValue() {
|
||||
return import(modulePath);
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import "/definitely-missing-architecture-fixture.ts";
|
||||
import "architecture-fixture-package-that-does-not-exist";
|
||||
import "file:///definitely-missing-architecture-fixture.ts";
|
||||
import type { Value } from "../domain/missing-value.ts";
|
||||
|
||||
export function readValue(value: Value) {
|
||||
return value;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
const modulePath = "../domain/value.ts";
|
||||
|
||||
export function requireValue() {
|
||||
return require(modulePath);
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
import { createHttpClient } from "../../../../src/adapters/http/client.js";
|
||||
import { createHttpClient } from "../../../../src/adapters/http/client.ts";
|
||||
|
||||
export const leakedHttpFactory = createHttpClient;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import "../../../../src/adapters/http/client.js";
|
||||
|
||||
export const invalidEdge = true;
|
||||
@@ -0,0 +1,3 @@
|
||||
import "../../../../src/adapters/http/client.ts";
|
||||
|
||||
export const invalidEdge = true;
|
||||
@@ -1,4 +1,4 @@
|
||||
import "../../../../src/adapters/http/client.js";
|
||||
import "../../../../src/adapters/http/client.ts";
|
||||
|
||||
export function InvalidPresentationFixture() {
|
||||
return <p>invalid</p>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ApplicationOutputPorts } from "../../../../src/application/ports/out/application-output-ports.js";
|
||||
import type { ApplicationOutputPorts } from "../../../../src/application/ports/out/application-output-ports.ts";
|
||||
|
||||
export function OutputPortLeak(_props: ApplicationOutputPorts) {
|
||||
return <p>forbidden</p>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ApplicationApi } from "../../../../src/application/ports/in/application-api.js";
|
||||
import type { ApplicationApi } from "../../../../src/application/ports/in/application-api.ts";
|
||||
|
||||
export function ForbiddenTemplate(_props: { application: ApplicationApi }) {
|
||||
return <main>Template must not select an application use case.</main>;
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
export function createOwnedBrowserStorageCapabilities() {
|
||||
return {
|
||||
local: localStorage,
|
||||
session: sessionStorage,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export function createOwnedCrossContextCapabilities() {
|
||||
return {
|
||||
channel: new BroadcastChannel("owned-cross-context-fixture"),
|
||||
storage: localStorage,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { BrowserStoragePolicy } from "../../../../src/application/ports/browser-file-storage/shared.ts";
|
||||
|
||||
export const POLICY: BrowserStoragePolicy = {
|
||||
owner: "fixture-owner",
|
||||
namespace: "fixture",
|
||||
classification: "INTERNAL",
|
||||
authority: "RECONSTRUCTABLE",
|
||||
accountScope: "OPAQUE_PARTITION",
|
||||
retention: { kind: "TTL", maxAgeMs: 1_000 },
|
||||
softBudgetBytes: 1_000,
|
||||
hardBudgetBytes: 2_000,
|
||||
evictionPriority: "RECONSTRUCTABLE",
|
||||
logoutAction: "EXPORT_THEN_PURGE",
|
||||
accountDeletionAction: "PURGE_PARTITION",
|
||||
pressureAction: "RETAIN",
|
||||
unavailableFallback: "ONLINE_ONLY",
|
||||
};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export function bypassThroughAlias() {
|
||||
const browser = globalThis;
|
||||
return browser.indexedDB.open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class BrowserRootHolder {
|
||||
readonly root = globalThis;
|
||||
}
|
||||
|
||||
new BrowserRootHolder().root.indexedDB.open("forbidden");
|
||||
@@ -0,0 +1,4 @@
|
||||
export function bypassThroughComputedAlias() {
|
||||
const browser = globalThis;
|
||||
return browser["caches"].open("forbidden");
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class BrowserRootBox {
|
||||
constructor(readonly root: typeof globalThis) {}
|
||||
}
|
||||
|
||||
new BrowserRootBox(globalThis).root.indexedDB.open("forbidden");
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function bypassThroughDefault(browser = globalThis) {
|
||||
return browser.indexedDB.open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function constructBlobOutsideOwnedAdapter() {
|
||||
return new Blob(["forbidden"]);
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function openBroadcastChannelDirectly() {
|
||||
return new BroadcastChannel("forbidden");
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function openCacheDirectly() {
|
||||
return caches.open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function openDatabaseDirectly() {
|
||||
return indexedDB.open("forbidden");
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function writeLocalStorageDirectly() {
|
||||
localStorage.setItem("forbidden", "value");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function openOpfsDirectly() {
|
||||
return navigator.storage.getDirectory();
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function writeSessionStorageDirectly() {
|
||||
sessionStorage.setItem("forbidden", "value");
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
export function bypassThroughDynamicCapabilityKey() {
|
||||
const browser = globalThis;
|
||||
const capability = "indexedDB";
|
||||
return browser[capability].open("forbidden");
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export function bypassThroughObjectContainer() {
|
||||
const holder = { browser: globalThis };
|
||||
return holder.browser.indexedDB.open("forbidden");
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function bypassThroughGlobalThis() {
|
||||
return globalThis.indexedDB.open("forbidden");
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
function identity<Value>(value: Value): Value {
|
||||
return value;
|
||||
}
|
||||
|
||||
export function bypassThroughIdentityWrapper() {
|
||||
return identity(globalThis).indexedDB.open("forbidden");
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
const holder: { root?: typeof globalThis } = {};
|
||||
|
||||
holder.root = globalThis;
|
||||
holder.root.indexedDB.open("forbidden");
|
||||
@@ -0,0 +1,3 @@
|
||||
export function allocateObjectUrlDirectly(value: never) {
|
||||
return URL.createObjectURL(value);
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
export function bypassThroughPropertyDescriptor() {
|
||||
const descriptor = Object.getOwnPropertyDescriptor(
|
||||
globalThis,
|
||||
"indexedDB",
|
||||
);
|
||||
return (descriptor?.value as IDBFactory).open("forbidden");
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function bypassThroughReflection() {
|
||||
return Reflect.get(globalThis, "indexedDB");
|
||||
}
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import { Button } from "../../../../src/presentation/design-system/primitives/core.js";
|
||||
import { Button } from "../../../../src/presentation/design-system/primitives/core.tsx";
|
||||
|
||||
export const DeepImport = Button;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { OPTIONAL_RECIPE_RUNTIME_SENTINEL } from "../../../../../../recipes/frontend-capabilities/index.js";
|
||||
import { OPTIONAL_RECIPE_RUNTIME_SENTINEL } from "../../../../../../recipes/frontend-capabilities/index.ts";
|
||||
|
||||
export const recipeInProduction = OPTIONAL_RECIPE_RUNTIME_SENTINEL;
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { createIndexedDbRepository } from "../../../adapters/storage/indexeddb/indexeddb-repository.ts";
|
||||
|
||||
export const composedWithoutProjectSelection = createIndexedDbRepository;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export function createOwnedWebSocket(endpoint: string): WebSocket {
|
||||
return new WebSocket(endpoint, "realtime.v1");
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
export async function readOwnedPushSubscription(
|
||||
registration: ServiceWorkerRegistration,
|
||||
): Promise<PushSubscription | null> {
|
||||
return registration.pushManager.getSubscription();
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { createWebSocketConnection } from "../../../adapters/realtime/websocket/websocket-connection.ts";
|
||||
|
||||
export const incorrectlyComposed = createWebSocketConnection;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export function createRouteOwnedSocket(endpoint: string): WebSocket {
|
||||
setInterval(() => undefined, 1_000);
|
||||
return new WebSocket(endpoint);
|
||||
}
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
"registries": [
|
||||
{
|
||||
"registryId": "FIXTURE-SOURCE",
|
||||
"path": "tests/fixtures/registry/forbidden/invalid-registry.js",
|
||||
"path": "tests/fixtures/registry/forbidden/invalid-registry.ts",
|
||||
"exportName": "INVALID_REGISTRY",
|
||||
"owner": "fixture",
|
||||
"requiredFields": ["id", "target"],
|
||||
@@ -19,7 +19,7 @@
|
||||
},
|
||||
{
|
||||
"registryId": "FIXTURE-TARGET",
|
||||
"path": "tests/fixtures/registry/forbidden/invalid-registry.js",
|
||||
"path": "tests/fixtures/registry/forbidden/invalid-registry.ts",
|
||||
"exportName": "TARGET_REGISTRY",
|
||||
"owner": "fixture",
|
||||
"requiredFields": ["id"],
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
"registries": [
|
||||
{
|
||||
"registryId": "ROUTES",
|
||||
"path": "tests/fixtures/registry/routes/invalid-routes.js",
|
||||
"path": "tests/fixtures/registry/routes/invalid-routes.ts",
|
||||
"exportName": "INVALID_ROUTES",
|
||||
"owner": "fixture",
|
||||
"requiredFields": [
|
||||
@@ -34,7 +34,7 @@
|
||||
},
|
||||
{
|
||||
"registryId": "RUNTIME",
|
||||
"path": "tests/fixtures/registry/routes/invalid-routes.js",
|
||||
"path": "tests/fixtures/registry/routes/invalid-routes.ts",
|
||||
"exportName": "INVALID_RUNTIME",
|
||||
"owner": "fixture",
|
||||
"requiredFields": ["routeId", "moduleId", "paramsCodec", "searchCodec"],
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export function Fixture({ value }: { value: string }) {
|
||||
return <span>{value}</span>;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export function Fixture({ value }) {
|
||||
return <span>{value}</span>;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export function attachScript(source) {
|
||||
export function attachScript(source: string) {
|
||||
const script = document.createElement("script");
|
||||
script.src = source;
|
||||
document.head.append(script);
|
||||
-1
@@ -1 +0,0 @@
|
||||
export const execute = (source) => eval(source);
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const execute = (source: string) => eval(source);
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
export function RawHtml({ value }) {
|
||||
export function RawHtml({ value }: { value: string }) {
|
||||
return <div dangerouslySetInnerHTML={{ __html: value }} />;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
globalThis.password = "synthetic-built-secret";
|
||||
@@ -0,0 +1,2 @@
|
||||
(globalThis as typeof globalThis & { password: string }).password =
|
||||
"synthetic-built-secret";
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { ApplicationApi } from "../../../src/application/create-application.js";
|
||||
import type { ApplicationApi } from "../../../src/application/create-application.ts";
|
||||
|
||||
export const incompleteApplication: ApplicationApi = {
|
||||
session: {} as ApplicationApi["session"],
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { ApplicationOutputPorts } from "../../../src/application/create-application.js";
|
||||
import type { ApplicationOutputPorts } from "../../../src/application/create-application.ts";
|
||||
|
||||
export const invalidOutputPorts: ApplicationOutputPorts = {
|
||||
session: {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { AsyncOverlay } from "../../../src/application/view-models/async-state.js";
|
||||
import type { AsyncOverlay } from "../../../src/application/view-models/async-state.ts";
|
||||
|
||||
export const invalidPendingConflict: AsyncOverlay = {
|
||||
refreshing: false,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import type { DiagnosticsPort } from "../../../src/application/ports/diagnostics-port.js";
|
||||
import type { TelemetryPort } from "../../../src/application/ports/telemetry-port.js";
|
||||
import type { DiagnosticsPort } from "../../../src/application/ports/diagnostics-port.ts";
|
||||
import type { TelemetryPort } from "../../../src/application/ports/telemetry-port.ts";
|
||||
|
||||
declare const diagnostics: DiagnosticsPort;
|
||||
declare const telemetry: TelemetryPort;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { AppFailure } from "../../../src/contracts/errors.ts";
|
||||
|
||||
export const invalidFailure: AppFailure = {
|
||||
kind: "UNREGISTERED_FAILURE",
|
||||
code: "UNREGISTERED_FAILURE",
|
||||
retryable: false,
|
||||
operationId: "TYPE_FIXTURE",
|
||||
attemptCount: 1,
|
||||
userMessageKey: "error.unknown_failure",
|
||||
action: "contact-support",
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { ApplicationApi } from "../../../src/application/ports/in/application-api.ts";
|
||||
import type { ReferenceFeatureInput } from "../../../src/features/reference-feature/application/reference-feature-api.ts";
|
||||
|
||||
declare const application: ApplicationApi;
|
||||
declare const referenceFeature: ReferenceFeatureInput;
|
||||
|
||||
application.features.get("not-installed");
|
||||
referenceFeature.listResources;
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import { IconButton, MenuIcon } from "../../../src/presentation/design-system/index.js";
|
||||
import { IconButton, MenuIcon } from "../../../src/presentation/design-system/index.ts";
|
||||
|
||||
export const InvalidIconButton = <IconButton><MenuIcon /></IconButton>;
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import { formatMessage } from "../../../src/presentation/i18n/index.js";
|
||||
import { formatMessage } from "../../../src/presentation/i18n/index.ts";
|
||||
|
||||
formatMessage("ko-KR", "unknown.translation.key");
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { formatMessage } from "../../../src/presentation/i18n/index.js";
|
||||
import { formatMessage } from "../../../src/presentation/i18n/index.ts";
|
||||
|
||||
formatMessage("en-US", "route.documentTitle");
|
||||
formatMessage("en-US", "route.documentTitle", { title: "Missing app name" });
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import type { PageActionDefinition } from "../../../src/presentation/templates/index.js";
|
||||
import type { PageActionDefinition } from "../../../src/presentation/templates/index.ts";
|
||||
|
||||
export const activeButtonWithoutCallback = {
|
||||
kind: "button",
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// This deliberately failing fixture proves that checkJs rejects a wrong shape.
|
||||
|
||||
/** @param {{ operationId: string }} request */
|
||||
function execute(request) {
|
||||
return request.operationId;
|
||||
}
|
||||
|
||||
execute({ operationId: 42 });
|
||||
@@ -0,0 +1,7 @@
|
||||
// This deliberately failing fixture proves that TypeScript rejects a wrong shape.
|
||||
|
||||
function execute(request: { operationId: string }) {
|
||||
return request.operationId;
|
||||
}
|
||||
|
||||
execute({ operationId: 42 });
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { RawReferenceHttpExecutor } from "../../../src/features/reference-feature/adapters/reference-http-gateway.ts";
|
||||
|
||||
declare const http: RawReferenceHttpExecutor;
|
||||
|
||||
http.execute({
|
||||
operationId: "GET_REFERENCE_RESOURCE",
|
||||
routeId: "REFERENCE_RESOURCE_LIST",
|
||||
pathParams: { resourceId: "resource-1" },
|
||||
});
|
||||
+1
-3
@@ -1,6 +1,4 @@
|
||||
type Result<T, E> =
|
||||
| Readonly<{ ok: true; value: T }>
|
||||
| Readonly<{ ok: false; error: E }>;
|
||||
import type { Result } from "../../../src/application/result.ts";
|
||||
|
||||
export function invalidUnwrap(result: Result<number, string>): number {
|
||||
return result.value;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { ROUTE_RUNTIME_CONTRACT } from "../../../src/features/installed-feature-contracts.js";
|
||||
import { ROUTE_RUNTIME_CONTRACT } from "../../../src/features/installed-feature-contracts.ts";
|
||||
|
||||
type RouteId = keyof typeof ROUTE_RUNTIME_CONTRACT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user