refactor: 프론트엔드 리펙토링
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import type { InstalledHttpOperationExecutor } from "../../../src/adapters/http/index.ts";
|
||||
import { composeFeatureAdapterInputs } from "../../../src/features/feature-adapter-contribution.ts";
|
||||
|
||||
declare module "../../../src/application/ports/in/application-api.ts" {
|
||||
interface ApplicationFeatureInputs {
|
||||
"direct-compose-probe": Readonly<{
|
||||
ping(): "pong";
|
||||
}>;
|
||||
}
|
||||
}
|
||||
|
||||
const malformedRawContribution = Object.freeze({
|
||||
featureId: "direct-compose-probe" as const,
|
||||
needs: ["http"] as const,
|
||||
createInput() {
|
||||
return Object.freeze({
|
||||
featureId: "direct-compose-probe" as const,
|
||||
input: Object.freeze({
|
||||
ping() {
|
||||
return "pong" as const;
|
||||
},
|
||||
}),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
composeFeatureAdapterInputs(
|
||||
Object.freeze([malformedRawContribution] as const),
|
||||
Object.freeze(["direct-compose-probe"]),
|
||||
Object.freeze({
|
||||
http: null as unknown as InstalledHttpOperationExecutor,
|
||||
}),
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defineFeatureAdapterContribution } from "../../../src/features/feature-adapter-contribution.ts";
|
||||
import { createReferenceFeatureInstalledInput } from "../../../src/features/reference-feature/adapters/create-reference-feature-input.ts";
|
||||
|
||||
defineFeatureAdapterContribution({
|
||||
featureId: "reference-feature",
|
||||
needs: ["http"] as const,
|
||||
createInput(context) {
|
||||
context.indexedDb;
|
||||
return createReferenceFeatureInstalledInput({
|
||||
http: context.http,
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { defineFeatureAdapterContribution } from "../../../src/features/feature-adapter-contribution.ts";
|
||||
import type {} from "../../../src/features/reference-feature/application/reference-feature-api.ts";
|
||||
|
||||
defineFeatureAdapterContribution({
|
||||
featureId: "reference-feature",
|
||||
needs: ["http"] as const,
|
||||
createInput() {
|
||||
return {
|
||||
featureId: "reference-feature" as const,
|
||||
input: {
|
||||
definitelyNotReferenceFeatureInput: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import {
|
||||
createFeatureHttpBinding,
|
||||
defineFeatureHttpOperation,
|
||||
type InstalledHttpOperationExecutor,
|
||||
} from "../../../src/adapters/http/index.ts";
|
||||
import { GET_REFERENCE_RESOURCE_CONTRACT } from "../../../src/features/reference-feature/contracts/reference-feature-contract-contribution.ts";
|
||||
import { mapReferenceResourcePayload } from "../../../src/features/reference-feature/contracts/reference-mapper.ts";
|
||||
|
||||
declare const executor: InstalledHttpOperationExecutor;
|
||||
|
||||
const operations = Object.freeze({
|
||||
TOTALLY_WRONG_OPERATION_ID: defineFeatureHttpOperation({
|
||||
contract: GET_REFERENCE_RESOURCE_CONTRACT,
|
||||
routeId: "REFERENCE_RESOURCE_DETAIL",
|
||||
mapSuccess: mapReferenceResourcePayload,
|
||||
}),
|
||||
});
|
||||
|
||||
createFeatureHttpBinding(executor, operations);
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { ReferenceHttpBinding } from "../../../src/features/reference-feature/adapters/reference-http-gateway.ts";
|
||||
|
||||
declare const http: ReferenceHttpBinding;
|
||||
|
||||
http.execute("GET_REFERENCE_RESOURCE", {
|
||||
name: "wrong-command-for-get",
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { defineFeatureHttpOperationForRoutes } from "../../../src/adapters/http/index.ts";
|
||||
import {
|
||||
type ReferenceFeatureRouteId,
|
||||
} from "../../../src/features/reference-feature/adapters/reference-http-gateway.ts";
|
||||
import { GET_REFERENCE_RESOURCE_CONTRACT } from "../../../src/features/reference-feature/contracts/reference-feature-contract-contribution.ts";
|
||||
import { mapReferenceResourcePayload } from "../../../src/features/reference-feature/contracts/reference-mapper.ts";
|
||||
|
||||
const defineReferenceOperation =
|
||||
defineFeatureHttpOperationForRoutes<ReferenceFeatureRouteId>();
|
||||
|
||||
defineReferenceOperation({
|
||||
contract: GET_REFERENCE_RESOURCE_CONTRACT,
|
||||
routeId: "TOTALLY_WRONG_ROUTE",
|
||||
mapSuccess: mapReferenceResourcePayload,
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defineFeatureHttpOperation } from "../../../src/adapters/http/index.ts";
|
||||
import { GET_REFERENCE_RESOURCE_CONTRACT } from "../../../src/features/reference-feature/contracts/reference-feature-contract-contribution.ts";
|
||||
|
||||
defineFeatureHttpOperation({
|
||||
contract: GET_REFERENCE_RESOURCE_CONTRACT,
|
||||
routeId: "REFERENCE_RESOURCE_DETAIL",
|
||||
mapSuccess(value: Readonly<{ unrelatedWireField: number }>) {
|
||||
return {
|
||||
ok: true as const,
|
||||
value,
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-application-input.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-application-output.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-async-overlay.ts"
|
||||
]
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
"types": [
|
||||
"node",
|
||||
"vite/client"
|
||||
],
|
||||
"isolatedModules": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-diagnostics-port.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-direct-feature-composition.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-failure-kind.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-feature-capability-selection.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-feature-contribution-input.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-feature-input.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-http-operation-id.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-http-operation-input.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-http-route-id.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-http-wire-mapper.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-icon-button.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-image-cdn-resolve-signal.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-message-key.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-message-params.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-page-action.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-port-call.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-port-implementation.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-reference-operation.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-result-narrowing.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"./invalid-route-runtime.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user