Skip to content

feat(cli): add --config/-c option to ea spa for site customization#18

Merged
ronaldtse merged 1 commit into
mainfrom
feat/spa-config-option
Jul 18, 2026
Merged

feat(cli): add --config/-c option to ea spa for site customization#18
ronaldtse merged 1 commit into
mainfrom
feat/spa-config-option

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

  • The lutaml-uml StaticSite::Generator already accepts config_path: and uses it to drive the SPA title, description, logos, and other branding metadata via a YAML schema. The ea spa CLI previously had no way to pass a config through, so every generated SPA inherited the generic "UML Browser" defaults.
  • This adds option :config (short alias -c) to ea spa, validates the file exists, and forwards it as config_path: to the Generator. Per-site branding is now possible (e.g., the plateau-model deployment can have its SPAs show the PLATEAU logo and "PLATEAU Model" title).

Changes

  • lib/ea/cli/app.rb: declare option :config on spa, using a new CONFIG_OPTION shared-kwargs constant that mirrors the existing OUTPUT_OPTION pattern.
  • lib/ea/cli/command/spa.rb: resolve the path (expand ~, raise Ea::Cli::FileNotFound if missing) and forward it into the Generator options.
  • spec/ea/cli/app_spec.rb: three new specs — help-text alias visibility, end-to-end run asserting the config title appears in the generated HTML, and the missing-file error path.

Test plan

  • bundle exec rspec spec/ea/cli/ — 10 examples, 0 failures
  • Manual: ea spa model.qea -c config.yml -o out.html produces HTML containing the configured title
  • Manual: ea spa model.qea -c /nonexistent raises Ea::Cli::FileNotFound

The lutaml-uml StaticSite::Generator already accepts a config_path
option and uses it to set the SPA title, description, logos, and other
branding metadata. But the ea spa CLI had no way to pass a config
through, so every generated SPA used the default "UML Browser" /
"UML Model Documentation" title and the default LutaML logo.

This blocks per-site branding. The plateau-model deployment, for
example, needs the generated CityGML 2.0 and 3.0 SPAs to show the
PLATEAU logo and "PLATEAU Model" title, not generic LutaML defaults.

Changes
- app.rb: declare option :config on spa with -c short alias, using
  the same CONFIG_OPTION shared-kwargs pattern as OUTPUT_OPTION
- spa.rb: resolve the path (expanding ~ and raising FileNotFound if
  missing) and forward it as config_path into the Generator options
- app_spec.rb: three new specs covering the -c help-text alias, a
  full end-to-end run that asserts the config title appears in the
  generated HTML, and the missing-file error path

Existing -o specs continue to pass (10 examples, 0 failures total).
@ronaldtse
ronaldtse merged commit 2360c7b into main Jul 18, 2026
14 checks passed
@ronaldtse
ronaldtse deleted the feat/spa-config-option branch July 18, 2026 09:27
ronaldtse added a commit to metanorma/plateau-models that referenced this pull request Jul 18, 2026
Three coordinated changes that together make both the landing page
and the generated SPAs carry the actual PLATEAU brand identity.

1. Landing page logo (index.html)
   Replaced the invented bar-chart "P" with the official PLATEAU logo
   lockup, copied verbatim from mlit.go.jp/plateau/assets/img/common/
   logo.svg. The mark paths keep their brand fills (#463C64 deep
   indigo, #00BEBE teal); the PLATEAU wordmark and "by MLIT" tagline
   paths use currentColor so they flip with the theme. Same lockup is
   reused in the footer dark band. Page <title>, meta description, and
   visible brand text now read "PLATEAU by MLIT — UML Models" with
   proper JA / EN translations via the existing data-i18n swap.

2. Per-SPA customization (citygml-2.config.yml, citygml-3.config.yml)
   Two lutaml-uml static-site configs that set metadata.title,
   metadata.description, metadata.appearance.logos (PLATEAU logo URLs),
   plus ui.title and ui.description. The generated SPAs now show
   "PLATEAU Model|CityGML 2.0 UML Browser" / "...3.0..." in the
   browser tab and the Vue app shell, with the PLATEAU logo wired into
   the metadata. Same logo URLs for light/dark use the official
   logo.svg / logo_white.svg pair.

3. Workflow + Gemfile
   - deploy-pages.yml: ea spa invocations now pass --config
     citygml-{2,3}.config.yml so each generated SPA picks up its
     config-driven branding.
   - Gemfile: pin ea >= 0.2.4, which is the version that ships the
     --config / -c option (released today as lutaml/ea#18).
ronaldtse added a commit to metanorma/plateau-models that referenced this pull request Jul 18, 2026
Three coordinated changes that together make both the landing page
and the generated SPAs carry the actual PLATEAU brand identity.

1. Landing page logo (index.html)
   Replaced the invented bar-chart "P" with the official PLATEAU logo
   lockup, copied verbatim from mlit.go.jp/plateau/assets/img/common/
   logo.svg. The mark paths keep their brand fills (#463C64 deep
   indigo, #00BEBE teal); the PLATEAU wordmark and "by MLIT" tagline
   paths use currentColor so they flip with the theme. Same lockup is
   reused in the footer dark band. Page <title>, meta description, and
   visible brand text now read "PLATEAU by MLIT — UML Models" with
   proper JA / EN translations via the existing data-i18n swap.

2. Per-SPA customization (citygml-2.config.yml, citygml-3.config.yml)
   Two lutaml-uml static-site configs that set metadata.title,
   metadata.description, metadata.appearance.logos (PLATEAU logo URLs),
   plus ui.title and ui.description. The generated SPAs now show
   "PLATEAU Model|CityGML 2.0 UML Browser" / "...3.0..." in the
   browser tab and the Vue app shell, with the PLATEAU logo wired into
   the metadata. Same logo URLs for light/dark use the official
   logo.svg / logo_white.svg pair.

3. Workflow + Gemfile
   - deploy-pages.yml: ea spa invocations now pass --config
     citygml-{2,3}.config.yml so each generated SPA picks up its
     config-driven branding.
   - Gemfile: pin ea >= 0.2.4, which is the version that ships the
     --config / -c option (released today as lutaml/ea#18).
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