Skip to content

Move integration-specific configuration into its owning plugins and add optional image optimization through @purestack/ts-images. Preserve existing default site output while making plugin configuration and asset lifecycle contracts explicit. - #38

Merged
koculu merged 3 commits into
mainfrom
improve-plugin-architecture
Oct 18, 2026

Conversation

@koculu

@koculu koculu commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Move integration-specific configuration into its owning plugins and add optional image optimization through @purestack/ts-images. Enable plugin selection directly from siteConfig.json, preserve existing default site output, and improve asset verification, caching, and cross-platform reliability.

Changes

  • Move theme, logo, consent, analytics, auth, Pagefind, preview, and highlighting configuration ownership out of core.
  • Define resolve → normalize → finalize phases with accurate draft and normalized types. Custom plugin lists return optional plugin settings.
  • Support JSON plugin declarations using package, package#exportName, and package subpaths. Add defaultPlugins: false for explicit selection without TypeScript.
  • Share configuration and plugin selection across build, publish, and development, including middleware and config reloads. Preserve TypeScript overrides and consistent package resolution.
  • Add a generic asset contribution with source resolution, dependency tracking, atomic writes, shared ownership, collision detection, and cleanup. Keep bookkeeping private and enforce processor input lifetimes.
  • Add opt-in Sharp image optimization with responsive AVIF/WebP variants, JPEG/PNG fallbacks, presets, dimensions, priority controls, persistent caching, and bounded concurrency.
  • Preserve originals, existing responsive markup, remote images, SVGs, and animations.
  • Expire unused image-cache entries after 30 days by default, configurable through cacheMaxAgeDays; support concurrent builds through atomic cache publication.
  • Reuse successful asset verification while filesystem identity and timestamps remain unchanged. Retain initial hash verification, symlink checks, collision detection, and serialized cleanup.
  • Share content-root resolution per build, fix Windows dependency matching and missing-file recovery, and normalize completion-test paths.
  • Dispose Shiki instances after tests, fix parsing of unquoted HTML URLs, update schemas and documentation, and bump package versions to 1.1.16.

Validation

  • All 1,129 tests passed.
  • TypeScript 7 builds, permanent contract checks, frontend/extension checks, and compiled-consumer checks passed.
  • Lint, dependency consistency, line endings, bundling, tarball packaging, and installed CLI fixtures passed.
  • Isolated frontend publishes produced 353 files and 162 HTML pages each, with no unexplained drift. Nine JavaScript bundles differed only in verified local minified names.
  • All 13 image variants retained identical filenames and bytes across the contract cleanup and repeated clean publishes.
  • Built CLI fixtures verified JSON selection, TypeScript precedence, conflicting package copies, and site-only plugins. Equivalent JSON and TypeScript configurations produced matching CSS and image bytes, with HTML differences limited to CSS build tokens.

…dd optional image optimization through @purestack/ts-images. Preserve existing default site output while making plugin configuration and asset lifecycle contracts explicit.
One shared content-root lookup per build, with retry after failure.
Configurable image-cache expiry: 30 days unused by default, with atomic publication for concurrent builds. Set cacheMaxAgeDays: 0 to disable expiry.
…enerated-asset verification without weakening integrity checks.
@koculu
koculu merged commit ee733bb into main Oct 18, 2026
5 checks passed
@koculu
koculu deleted the improve-plugin-architecture branch October 18, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant