Shared pipeline-stats output across adapters
@refrakt-md/sveltekit prints a Phase 1/2/3/4 + warnings summary at the end of its content load (packages/sveltekit/src/plugin.ts:186–200):
@refrakt-md/sveltekit prints a Phase 1/2/3/4 + warnings summary at the end of its content load (packages/sveltekit/src/plugin.ts:186–200):
Tracking started May 21 — check back for trends.
@refrakt-md/content exports formatPipelineSummary(stats: PipelineStats, warnings: PipelineWarning[]): string returning the multi-line summary block currently inlined in the SvelteKit pluginformatPipelineSummary is pure — takes the data, returns the string. Adapters decide where to write it (process.stderr, console.log, an Eleventy log helper, etc.)packages/sveltekit/src/plugin.ts replaces its inline formatter with formatPipelineSummary (zero output diff)packages/astro/src/integration.ts calls formatPipelineSummary in the Vite plugin's buildStart after the content load and writes to process.stderrpackages/nuxt/src/module.ts same — calls the formatter after the Vite plugin's content loadpackages/eleventy/src/data.ts createDataFile writes the formatted summary to process.stderr after loadContent completes@refrakt-md/next exposes a helper printPipelineSummary(site: Site): void that adapter consumers call from their app/layout.tsx or a setup script; templates wire it in@refrakt-md/html build helper from WORK-242 prints the summary by default; option to disable for embedded useThe current SvelteKit implementation at packages/sveltekit/src/plugin.ts:186–200 is 15 lines of straight string building. Move it whole into packages/content/src/pipeline.ts (or a new packages/content/src/format.ts) and re-export from @refrakt-md/content.
// packages/content/src/format.ts export function formatPipelineSummary( stats: PipelineStats, warnings: PipelineWarning[], ): string { // Lines 186–200 lifted verbatim from sveltekit/src/plugin.ts }
Each adapter then becomes a one-liner:
// Astro / Nuxt / Eleventy / HTML import { formatPipelineSummary } from '@refrakt-md/content'; process.stderr.write(formatPipelineSummary(site.pipelineStats, site.pipelineWarnings));
For Next.js the helper takes a Site directly:
// packages/next/src/index.ts export function printPipelineSummary(site: Site): void { process.stderr.write(formatPipelineSummary(site.pipelineStats, site.pipelineWarnings)); }
Suppressing during tests: the formatter is pure (returns a string), so writing to stderr only happens at the adapter call site. Tests that don't want the noise simply don't call the writer.
Independent — can land any time after formatPipelineSummary is exported. Pairs naturally with the per-adapter site-tokens wiring items but doesn't block on them.
packages/sveltekit/src/plugin.ts:186–200 — current implementation to extractpackages/content/src/pipeline.ts — destination for the shared formatterCompleted: 2026-05-21
Branch: `claude/update-adapters-5CJgQ`
The summary is now emitted by every adapter on every full build. The site's existing 5-warning output now prints twice during `npm run build` (once for the dev server pre-build, once for the actual build) — pre-existing behaviour matching the SvelteKit plugin's lifecycle.
Per-adapter end-to-end output verification deferred to SPEC-059.
Full workspace build + all 2652 tests pass.