Skip to content

feat(spa): vendor Vue frontend + emit bundle in both output modes - #26

Merged
ronaldtse merged 1 commit into
mainfrom
feat/spa-frontend-bundle
Aug 3, 2026
Merged

feat(spa): vendor Vue frontend + emit bundle in both output modes#26
ronaldtse merged 1 commit into
mainfrom
feat/spa-frontend-bundle

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

The native SPA pipeline landed without a frontend — ea spa produced a 405-byte shell with window.__SPA_SKELETON_URL__ set but no JS to mount, so opening the output rendered a blank page. Both SingleFileStrategy and ShardedMultiFileStrategy had the same hole.

Vendor the full lutaml-uml frontend (source + dist + build pipeline) so the ea gem ships with a working SPA bundle and no longer depends on lutaml-uml for rendering. Dist is committed so gem install ea gets a working SPA without needing npm at install time.

What landed

  • frontend/ copied from lutaml-uml/lutaml-uml@0.5.2 wholesale: src/, dist/, tests/e2e/, package.json, vite.config.ts, tsconfig.json, vitest.config.ts, package-lock.json (package renamed lutaml-uml-spaea-spa)
  • frontend/README.md documenting when/how to rebuild and the data contract the shell has to honour
  • .gitignore: /frontend/node_modules/ (local only)
  • .github/workflows/frontend.yml: CI check that rebuilds the bundle and fails if dist/ drifts from src/
  • lib/ea/spa/output/strategy.rb: FRONTEND_APP_JS / FRONTEND_STYLE_CSS constants + assert_frontend_bundle! helper that raises a clear error if the bundle is missing
  • lib/ea/spa/output/single_file_strategy.rb: inline <style> and <script> into the single HTML file (stays self-contained)
  • lib/ea/spa/output/sharded_multi_file_strategy.rb: copy app.js and style.css next to index.html; shell now has <link href="style.css"> and <script src="app.js" defer>
  • spec/ea/spa/output_strategy_spec.rb: assert the bundle (JS, CSS, reference) is present in both layouts

Test plan

  • All 6 output_strategy_spec.rb specs green (4 rewritten to assert bundle presence)
  • ea spa models/.../plateau_v5.0.qea --mode=sharded produces: index.html (487 B shell with <link>/<script src> tags), app.js (109 KB Vue IIFE), style.css (24.9 KB), skeleton.json, search.json, data/{packages,classes,enumerations}/*.json
  • All assets serve 200 OK via local HTTP server
  • app.js contains Vue markers (createApp, pinia, Vue.)

@ronaldtse
ronaldtse force-pushed the feat/spa-frontend-bundle branch 5 times, most recently from 54f1015 to 222c23d Compare July 26, 2026 01:31
Comment thread lib/ea/ocl/parser.rb
end

# Collection ->exists(...) or ->forAll(...)
if (m = s.match(/^(.+?)->(exists|forAll)\s*\(\s*(\w+)\s*\|\s*(.+?)\s*\)\z/))
Comment thread lib/ea/ocl/parser.rb
end

# String.matches('regex')
if (m = s.match(/^(.+?)\.matches\(\s*['"](.+?)['"]\s*\)\z/))
Comment on lines +45 to +46
clean = source.gsub(%r{//[^\n]*}, "")
.gsub(/\/\*.*?\*\//m, "")
def parse_color_value(value)
return {} if value.nil? || value.empty?

value.scan(/#([^#=]+)#=([^;]*);/).each_with_object({}) do |(k, v), acc|
Comment on lines +121 to +123
stripped = description
.gsub(/@STEREO;.*?(?:@ENDSTEREO;|\z)/m, "")
.gsub(/@PROP=.*?@ENDPROP;/m, "")
Major expansion of the ea gem toward a drop-in headless replacement
for Sparx Enterprise Architect.

CLI commands added (13 new):
- ea diff OLD NEW (--format=html for color-coded HTML report)
- ea render NAME FILE (svg/png/pdf via rsvg-convert/ImageMagick)
- ea export SUB FILE (xmi|json|json-schema|plantuml|xsd)
- ea mdg ACTION (list|show NAME|stereotypes)
- ea lint FILE (5 rules: naming, orphan, duplicate, cyclic, missing-stereo)
- ea query FILE (chainable Ea::Query::Builder DSL)
- ea info NAME FILE (single-element details)

New subsystems:
- Ea::Sources::Qea::Xref parser (@Stereo, @prop=@name..@ENDPROP;, legends)
- Ea::Mdg::StereotypeAliasRegistry (GMLStereotypes.xml canonicalizer)
- Ea::Export::Xsd::Generator (GMLClassMapping-driven XSD)
- Ea::Export::JsonSchema::Generator (draft 2020-12)
- Ea::Export::Xmi/Json/PlantUml generators
- Ea::Image::EmfRenderer (lazy emfsvg adapter)
- Ea::Render::ImageConverter (svg→png/pdf)
- Ea::Lint engine + 5 rules
- Ea::Ocl parser + evaluator (exists, forAll, matches, and/or/not)
- Ea::Shapescript with variables, arithmetic, conditionals, labels
- Ea::Svg::EaEmitter::Element::HeaderLinePipeline (OCP provider chain)
- Ea::Svg::EaEmitter::Element::StereotypeIconRenderer

QEA table coverage: 24 → 43 tables (added glossary, lists, versions,
phase, authors, image, secrypt, palette, paletteitem, implement,
roleconstraint, objectproblems/risks/tests/efforts/resources/
scenarios/requires/trx).

Code quality:
- HeaderLines refactored to OCP provider chain (legacy module aliased)
- Xsd::CliBridge glue removed (defaults folded into Generator)
- 1974 specs, 0 failures, 55 pending

Version: 0.4.0 → 0.5.0
@ronaldtse
ronaldtse force-pushed the feat/spa-frontend-bundle branch from 6c7f578 to 9121168 Compare August 3, 2026 00:13
@ronaldtse
ronaldtse merged commit 144b9f0 into main Aug 3, 2026
12 checks passed
@ronaldtse
ronaldtse deleted the feat/spa-frontend-bundle branch August 3, 2026 00:23
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.

2 participants