Skip to content

v21.12.0

Choose a tag to compare

@dyingangel666 dyingangel666 released this 02 Jun 12:05
· 14 commits to main since this release

Highlights

  • Type-safe variants: @Showcase<T> is now generic. Variant inputs are typed
    as Partial<InputsOf<T>> (signal inputs only, outputs excluded). Existing call
    sites without a generic argument keep working unchanged.
  • Header widget API: plugins can contribute pills/badges to the header bar
    (NgPrismPlugin.headerWidgets, start/end slots, lazy loading).
  • Library-wide quality scores: coverage and a11y now surface as color-coded
    header pills via manifest.meta. A11y stays a core feature with build-time
    threshold gating (NgPrismConfig.a11y.{ thresholds, reportPath }).
  • Plugin schematics: every official plugin ships an ng-add schematic
    (jsdoc, box-model, coverage, figma, perf). New @ng-prism/core/schematics/utils
    subpath exports a config-ast utility plugins use to patch prism.config.ts
    idempotently.
  • Keep-alive panels: opt-in PanelDefinition.keepAlive keeps expensive panels
    (e.g. the Figma iframe) mounted across tab switches.

ng-prism (core)

  • feat: generic @Showcase<T> for type-safe variant inputs
  • feat: header widget extension point + BUILTIN_HEADER_WIDGETS
  • feat: PrismManifest.meta / RuntimeManifest.meta carry library-wide plugin
    data from build to runtime
  • feat: a11y build-time pipeline reads a11y-report.json and hard-fails the
    build on threshold violations
  • feat: keep-alive panels survive tab switches
  • feat: prefer styleguide pages over components in the default route
  • feat: config-ast utility + schematics/utils subpath export
  • feat: ng-add installs highlight.js + ngx-highlightjs
  • fix: variant-ribbon prev/next controls stay visible, active tab auto-scrolls
    into view

Plugins

  • plugin-coverage: configurable thresholds per metric; coverage total surfaces
    as header badge via onManifestReady
  • plugin-jsdoc: ng-add schematic; descriptions and @example blocks now render
    as Markdown with syntax-highlighted code (bumps plugin to 21.13.0-beta.0)
  • plugin-figma: ng-add schematic (with optional-peers hint); embed iframe no
    longer reloads on panel switch (keep-alive)
  • plugin-box-model, plugin-perf: ng-add schematics

Refactors & build

  • refactor(ng-prism): remove built-in ng-prism-audit-a11y CLI — consumers
    produce a11y-report.json themselves (same pattern as coverage-summary.json);
    playwright and axe-core peerDeps dropped
  • chore(publish): beta release flow (--tag beta, prerelease GH releases),
    promote beta → stable, plugin peer-dep sync on bump
  • build(ng-prism): exclude __mocks__ from lib build
  • fix(ci): ng-prism:test now depends on plugin-jsdoc:build
  • docs: ng-add guide for plugins, ADR for plugin schematics architecture,
    @Showcase<T> + InputsOf<T> reference