Files
clean-architecture-frontend…/src/features/installed-feature-adapters.ts
T

32 lines
1.1 KiB
TypeScript

import {
composeFeatureAdapterInputs,
type ContributionsCapabilityContext,
type InstalledFeatureInputs,
} from "./feature-adapter-contribution.ts";
import { REFERENCE_FEATURE_ADAPTER_CONTRIBUTION } from "./reference-feature/adapters/create-reference-feature-input.ts";
import { INSTALLED_PRODUCT_FEATURE_IDS } from "./installed-product-manifest.ts";
const COMPILED_FEATURE_ADAPTER_CONTRIBUTIONS = Object.freeze([
REFERENCE_FEATURE_ADAPTER_CONTRIBUTION,
] as const);
type InstalledFeatureCapabilityContext =
ContributionsCapabilityContext<
typeof COMPILED_FEATURE_ADAPTER_CONTRIBUTIONS
>;
/**
* Central adapter composition only selects and aggregates feature-owned
* contributions. The feature owns how its application input is bound to the
* reusable platform capabilities declared by its `needs` list.
*/
export function createInstalledFeatureInputs(
context: InstalledFeatureCapabilityContext,
): InstalledFeatureInputs {
return composeFeatureAdapterInputs(
COMPILED_FEATURE_ADAPTER_CONTRIBUTIONS,
INSTALLED_PRODUCT_FEATURE_IDS,
context,
);
}