refactor: 프론트 템플릿 리펙토링

This commit is contained in:
donghyeon-ka
2026-09-18 15:16:58 +09:00
parent c10a709f2c
commit 5cc41467ae
80 changed files with 7227 additions and 4672 deletions
+30 -20
View File
@@ -1,28 +1,38 @@
import { PLATFORM_ROUTE_CODECS } from "../presentation/routes/platform-route-codecs.ts";
import { PLATFORM_ROUTE_RUNTIME } from "../presentation/routes/route-runtime.tsx";
import {
REFERENCE_FEATURE_ROUTE_CODECS,
REFERENCE_FEATURE_ROUTE_RUNTIME,
} from "./reference-feature/presentation/reference-feature-runtime.tsx";
import { REFERENCE_FEATURE_ID } from "./reference-feature/contracts/reference-feature-contract.ts";
import { REFERENCE_FEATURE_RUNTIME_CONTRIBUTION } from "./reference-feature/presentation/reference-feature-runtime.tsx";
import { INSTALLED_PRODUCT_FEATURE_IDS } from "./installed-product-manifest.ts";
const COMPILED_FEATURE_RUNTIME_CONTRIBUTIONS = Object.freeze([
REFERENCE_FEATURE_RUNTIME_CONTRIBUTION,
] as const);
const INSTALLED_FEATURE_RUNTIME_CONTRIBUTIONS =
COMPILED_FEATURE_RUNTIME_CONTRIBUTIONS.filter((contribution) =>
INSTALLED_PRODUCT_FEATURE_IDS.includes(contribution.featureId),
);
/**
* §3.5. A feature the manifest did not select contributes no codec and no route
* component, so the router has nothing to mount for it. The module is still
* linked — a static import cannot be undone by a value — which is why physical
* removal is FE-GATE-020's job and this is deselection, not deletion.
* Central runtime catalogs only aggregate feature-owned contributions.
* Adding route codecs/components to a feature no longer requires duplicating
* reference-specific selection logic in this composition file.
*/
const referenceSelected = INSTALLED_PRODUCT_FEATURE_IDS.includes(
REFERENCE_FEATURE_ID,
export const ROUTE_CODECS = Object.freeze(
Object.assign(
{},
PLATFORM_ROUTE_CODECS,
...INSTALLED_FEATURE_RUNTIME_CONTRIBUTIONS.map(
(contribution) => contribution.routeCodecs,
),
),
);
export const ROUTE_CODECS = Object.freeze({
...PLATFORM_ROUTE_CODECS,
...(referenceSelected ? REFERENCE_FEATURE_ROUTE_CODECS : {}),
});
export const ROUTE_RUNTIME = Object.freeze({
...PLATFORM_ROUTE_RUNTIME,
...(referenceSelected ? REFERENCE_FEATURE_ROUTE_RUNTIME : {}),
});
export const ROUTE_RUNTIME = Object.freeze(
Object.assign(
{},
PLATFORM_ROUTE_RUNTIME,
...INSTALLED_FEATURE_RUNTIME_CONTRIBUTIONS.map(
(contribution) => contribution.routeRuntime,
),
),
);