Skip to content

Phase 3: Swift 6 Language Mode + Component Migration + Mermaid Support #38

@leogdion

Description

@leogdion

Overview

Upgrade all 17 subrepos to Swift 6 language mode, migrate Plot HTML generation to component-based API, fix all concurrency violations, and add mermaid diagram support. This is Phase 3 of the Swift 6 migration.

Depends on Phase 1 (#36) and Phase 2 (#37).

Key Tasks

Swift 6 Upgrades

  • Update all 17 subrepos to // swift-tools-version: 6.0
  • Enable strict concurrency checking across all targets
  • Fix Testimonial.swift data race (static var lastID — remove auto-increment, require explicit IDs)
  • Add Sendable conformances to Newsletter.Source, YouTubeContent.Source, RSSContent.Source, BrightDigitPodcast.Source
  • Fix force-try statements (YAMLStringFix.swift:6, String.swift:4, RSSContent.swift:21)
  • Push Swift 6 updates to upstream repos via git subrepo push

Component-Based Plot API

  • Enforce component-based API in Plot (mark direct Node creation internal)
  • Create site component library in Sources/BrightDigitSite/Components/
    • Layout: HeaderComponent, FooterComponent, NavigationComponent, PageLayoutComponent
    • Content: ArticleCardComponent, NewsletterItemComponent, PodcastEpisodeComponent, TutorialItemComponent, ProductCardComponent
  • Migrate PiHTMLFactory.HTML.swift and all Nodes/ files to use components
  • Validate HTML output identical to current

Mermaid Diagram Support

  • Detect mermaid code blocks in markdown and wrap in <div class="mermaid"> instead of <pre><code>
  • Add mermaid.js CDN script to HTML <head>
  • Test all mermaid diagram types (flowchart, sequence, class)

Testing

  • Expand test coverage to >25% (from ~5%)
  • Add concurrency safety tests
  • Add component unit tests

Success Criteria

  • Zero concurrency warnings across all 17 subrepos
  • swift build with Swift 6 strict mode passes on macOS and Ubuntu
  • Site output byte-for-byte identical (excluding mermaid blocks — visual verification)
  • Mermaid diagrams render correctly in production

Part of the Swift 6 Migration PRD — Phase 3 (5–7 weeks).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions