@ottili/foundation-core
v1.0.13
Published
Framework-agnostic Foundation logic: manifest validation, contribution merge, feature-state resolution, cache keys, stable ids. No React (SoT §8.2, §8.9).
Downloads
1,397
Readme
@ottili/foundation-core
Framework-agnostic Foundation logic: manifest validation, contribution merge, feature-state resolution, cache keys, stable ids. No React (SoT §8.2, §8.9).
Install
npm install @ottili/foundation-coreThis package is part of the Ottili Foundation Framework. See docs/OTTILI_FOUNDATION_FRAMEWORK_SOURCE_OF_TRUTH.md for the canonical spec.
Public API
validateProductManifestandresolveNavigationfor product and navigation manifests.createTranslatorand related i18n helpers for message formatting and catalog validation.- Stable id helpers:
generateCorrelationId,generateRequestId, andgenerateIdempotencyKey. - Telemetry, circuit breakers, cache keys, and feature-state resolution.
Usage
import {
createTranslator,
generateCorrelationId,
generateRequestId,
} from "@ottili/foundation-core";
const correlation = generateCorrelationId();
const request = generateRequestId();
const catalog = { "greeting": "Hallo {name}" };
const enCatalog = { "greeting": "Hello {name}" };
const t = createTranslator({
locale: "de",
catalog,
fallbackCatalog: enCatalog,
});