Skip to content

feat(spa): reintroduce --config for metadata override + view extras#21

Merged
ronaldtse merged 2 commits into
mainfrom
feat/spa-config-and-svg
Jul 19, 2026
Merged

feat(spa): reintroduce --config for metadata override + view extras#21
ronaldtse merged 2 commits into
mainfrom
feat/spa-config-and-svg

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

PR #20 dropped the legacy --config flag because it was tied to the lutaml-uml static-site pipeline. This adds a native replacement so downstream repos (plateau-model) can customize metadata.

What it does

  • --config FILE (-c alias) reads a YAML file
  • metadata: section overrides fields on Ea::Model::Metadata (title, description, version, ...)
  • ui: and appearance: sections are surfaced to the SPA skeleton as viewExtras
  • Both SingleFileStrategy and ShardedMultiFileStrategy honor the override
  • The HTML <title> tag now prefers ui.title over metadata.title (matches prior UX)

Version bump

0.2.50.3.0. The native pipeline is the new default and is incompatible with the old lutaml-uml-based SPA default.

Validation

  • 7 new specs in spec/ea/spa/configuration_spec.rb and spec/ea/cli/spa_spec.rb
  • Smoke-tested locally: ea spa basic.qea -c config.yml produces HTML with overridden title and viewExtras

Why no breaking-change guard concern

This is a feature addition (new flag). The breaking change was PR #20; that one already landed.

PR #20 removed the legacy --config flag because the lutaml-uml
static-site pipeline (which is what consumed it) was being dropped.
That also removed legitimate metadata customization for downstream
users like plateau-model.

This adds a native --config that:
- overrides Ea::Model::Metadata fields (title, description, version, ...)
- surfaces ui/appearance sections to the SPA skeleton as viewExtras
- works with both SingleFile and ShardedMultiFile output strategies

The SingleFileStrategy <title> tag now prefers ui.title (browser-tab
text) over metadata.title (model title), matching the prior UX.

Bumps version to 0.3.0 because the native pipeline + this flag are
incompatible with the 0.2.x lutaml-uml-based SPA default.
Adds Ea::Svg::Renderer that consumes the umldi content (placed
element bounds + connector waypoints) captured in Ea::Model::Diagram
and emits standalone SVG. Coordinates are taken straight from the
source pixel space.

Architecture:
- Ea::Svg::BoundsCalculator — unions element rects and waypoint
  positions; normalizes EA's inverted rects (rectbottom < recttop)
- Ea::Svg::StyleResolver — translates EA packed style (BGR integer
  colors, line widths) to CSS-friendly SVG attributes
- Ea::Svg::ElementBox — renders one DiagramElement as a labeled box
- Ea::Svg::ConnectorPath — renders one DiagramConnector as a
  polyline through waypoints
- Ea::Svg::Renderer — orchestrates; emits standalone XML SVG

CLI: new `ea svg NAME FILE [--output=PATH]` command renders a
named diagram to disk.

Distinct from Ea::Diagram::SvgRenderer which operates on the legacy
Lutaml::Uml::Document pipeline. This module consumes the canonical
Ea::Model types only.

Also fixes the stale `does not expose --config` spec from PR #20
(we just reintroduced --config).
@ronaldtse
ronaldtse merged commit 9eb9247 into main Jul 19, 2026
14 checks passed
@ronaldtse
ronaldtse deleted the feat/spa-config-and-svg branch July 19, 2026 15:58
ronaldtse added a commit that referenced this pull request Jul 19, 2026
The metanorma/ci rubygems-release workflow owns the version bump —
it expects to be the one that writes the new version to
lib/ea/version.rb and commits it. With the version already at
0.3.0 (committed in PR #21), the bump step is a no-op and git
aborts with 'nothing to commit'.

This revert returns the file to 0.2.5 so the release workflow can
do its job. The actual 0.3.0 release content is already on main.
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