Class: Ea::Cli::Command::Spa

Inherits:
Base
  • Object
show all
Defined in:
lib/ea/cli/command/spa.rb

Overview

ea spa FILE [--output=PATH] [--mode=MODE]

Generates a static single-page application (SPA) from a QEA, XMI, or LUR file. The SPA shows the package hierarchy, class details, diagram list, and member navigation in a browser.

Pipeline:

1. Ea::Transformations.parse(file) → Lutaml::Uml::Document
2. Lutaml::UmlRepository::Repository.from_document(document)
3. Lutaml::UmlRepository::StaticSite::Generator.new(repo, ...).generate

Output format defaults to single-file Vue IIFE HTML.

Constant Summary collapse

DEFAULT_MODE =
:single_file

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Ea::Cli::Command::Base

Instance Method Details

#callObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ea/cli/command/spa.rb', line 21

def call
  repository = RepositoryBuilder.build_repository(file_path)

  require_lutaml_uml_static_site!
  strategy = resolve_output_strategy

  output_path = resolve_output_path
  options = {
    output: output_path,
    mode: mode,
    output_strategy: strategy,
  }.compact

  Lutaml::UmlRepository::StaticSite::Generator
    .new(repository, options)
    .generate

  formatter.render([[output_path]], columns: [:written_to])
end