lib.presentation-runtime-next
Next.js lane for contract-driven marketing SEO/LLMO: metadata, JSON-LD, sitemap, robots, and llms.txt/agents.json route handlers
@lssm-tech/lib.presentation-runtime-nextbun add @lssm-tech/lib.presentation-runtime-nextManifest declarations describe the current workspace; they do not verify registry publication or runtime execution.
Package guide
Next.js lane for contract-driven marketing SEO / LLMO. It maps the framework-neutral metadata produced by @lssm-tech/lib.presentation-runtime-core/marketing into Next.js primitives and serves AI-discovery artifacts.
This is the only presentation-runtime package allowed to import next. presentation-runtime-core and presentation-runtime-react stay Next-free.
Adapters
| Export | Purpose |
|---|---|
toNextMetadata(meta, opts?) | NormalizedMetadata → Next Metadata (hreflang via negotiateLocale). |
JsonLd, StructuredData, serializeJsonLd | JSON-LD <script> rendering from resolved schema.org shapes. |
JsonLdDocument, serializeJsonLdDocument, escapeJsonForScript | Host-authored JSON-LD documents (single node or @graph node list with @id links); all JSON-LD emission escapes <, >, &, U+2028 and U+2029 so the payload cannot break out of the <script>. |
buildSitemap(blueprint, opts?) | AppBlueprintSpec.routes → MetadataRoute.Sitemap. |
buildRobots(aiDiscovery, opts?) | AiDiscoveryConfig.crawlerPolicy → MetadataRoute.Robots. |
createLlmoRouteHandlers(emitter, opts?) | /llms.txt, /llms-full.md, /agents.json route handlers with CDN cache headers. |
Usage
Page metadata + JSON-LD
// app/pricing/page.tsx
import type { Metadata } from 'next';
import { transformAppConfigSeo } from '@lssm-tech/lib.presentation-runtime-core/marketing';
import { toNextMetadata, StructuredData } from '@lssm-tech/lib.presentation-runtime-next';
import { resolvedAppConfig } from '@/app-config';
const normalized = transformAppConfigSeo(resolvedAppConfig, { routePath: '/pricing' });
export const metadata: Metadata = toNextMetadata(normalized);
export default function PricingPage() {
return (
<>
<StructuredData metadata={normalized} />
{/* … */}
</>
);
}sitemap + robots
// app/sitemap.ts
import { buildSitemap } from '@lssm-tech/lib.presentation-runtime-next';
import { blueprint } from '@/app-config';
export default function sitemap() {
return buildSitemap(blueprint, { supportedLocales: ['en', 'fr'], defaultLocale: 'en' });
}
// app/robots.ts
import { buildRobots } from '@lssm-tech/lib.presentation-runtime-next';
import { blueprint } from '@/app-config';
export default function robots() {
return buildRobots(blueprint.aiDiscovery, {
baseUrl: 'https://contractspec.dev',
sitemapUrl: 'https://contractspec.dev/sitemap.xml',
});
}LLMO route handlers (ISR + CDN cache)
// app/llms.txt/route.ts
import { createLlmoRouteHandlers } from '@lssm-tech/lib.presentation-runtime-next';
import { llmoEmitter } from '@/app-config'; // @lssm-tech/lib.content-gen LlmoEmitter
// Next.js segment config must be statically analyzable; keep this literal in the route file.
export const revalidate = 3600;
export const GET = createLlmoRouteHandlers(llmoEmitter).llmsTxt;The LlmoEmitter contract is declared structurally in ./llmo-routes so the concrete @lssm-tech/lib.content-gen emitter is injected by the app.
Relationships
Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.
7 declarations
@lssm-tech/lib.contracts-runtime-client-reactworkspace:^
Read the package manual ↗@lssm-tech/lib.contracts-runtime-coreworkspace:^
Read the package manual ↗@lssm-tech/lib.contracts-spec-coreworkspace:^
Read the package manual ↗@lssm-tech/lib.surface-runtimeworkspace:^
Read the package manual ↗@lssm-tech/lib.translation-runtimeworkspace:^
Read the package manual ↗server-only^0.0.1
Declared capabilities
Next.js lane for contract-driven marketing SEO/LLMO: metadata, JSON-LD, sitemap, robots, and llms.txt/agents.json route handlers
Scripts
publish:pkgbun publish --tolerate-republish --ignore-scripts --verbosepublish:pkg:canarybun publish:pkg --tag canarybuildcontractspec-bun-build buildbuild:bundlecontractspec-bun-build transpilebuild:typescontractspec-bun-build typescleanrimraf dist .turbodevcontractspec-bun-build devlintbun run lint:fixlint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .lint:checknode ../../../../scripts/biome.cjs check .testbun test --pass-with-no-testsprebuildcontractspec-bun-build prebuildtypechecktsgo --noEmit -p tsconfig.json