@ottili/product-contracts
v1.0.13
Published
Stable cross-product composition contracts: product manifests, accent helpers and validation (SoT §9, §35).
Downloads
789
Readme
@ottili/product-contracts
Stable cross-product composition contracts (SoT \u00a79, \u00a735).
Scope
This package re-exports the canonical product manifest contract from
@ottili/foundation-contracts and adds build-time helpers for composing a valid product
manifest. It does not duplicate the canonical type definitions.
Exports
ProductManifestBuilder— fluent builder forOttiliProductManifest.productAccent(productId)— canonical semantic accent token for a product.isProductAccentToken(value, productId?)— validates a token.validateProductManifest— re-exported from@ottili/foundation-core.- All product manifest contract types from
@ottili/foundation-contracts.
Usage
import { ProductManifestBuilder } from "@ottili/product-contracts";
const manifest = new ProductManifestBuilder("hq", "products.hq.name", "products.hq.description")
.withDefaultRoute("overview")
.withRoute({ id: "overview", productId: "hq", path: "/overview", titleKey: "routes.overview.title", implemented: true })
.withNavigation({
id: "overview",
productId: "hq",
routeId: "overview",
labelKey: "navigation.overview",
icon: { name: "home" },
defaultOrder: 10,
placement: "primary",
customizable: true,
})
.build();