Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/de-DE/platform-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ mxrb frontend migrate App.mpr --apply --json
script/frontend_acceptance App.mpr -o frontend-round-trip.json
script/frontend_acceptance App.mpr --mxbuild /pfad/mxbuild -o frontend.json
script/frontend_acceptance App.mpr --mx /pfad/mx -o frontend-diagnostics.json
script/frontend_lifecycle_acceptance --version 11.12.1 --mx /pfad/mx \
--mxbuild /pfad/mxbuild --strict-warnings -o frontend-lifecycle.json
```

`mxrb frontend migrate` ist standardmäßig eine unveränderliche, fail-closed
Expand Down Expand Up @@ -56,6 +58,14 @@ Modellfehler schlägt geschlossen fehl. Am 4. August 2026 schloss die sichere
Migration die akzeptierte Matrix 10.24.0.73019 und 11.12.1 ab: Quelle und Rebuild lieferten null
MxBuild-Fehler, und beide Reports setzten `frontend_ready` auf `true`.

`script/frontend_lifecycle_acceptance` erstellt eine App ausschließlich über
die CLI, erzeugt das MPR, exportiert nach Ruby, ändert Home und Navigation,
fügt Entität, Formular, Microflow, Nanoflow und Asset hinzu, erzeugt erneut,
exportiert ein zweites Mal und verlangt einen strukturell identischen Rebuild.
In der offiziellen Matrix 10.24.0.73019 und 11.12.1 endeten Quelle und Rebuild
mit null Fehlern, Warnungen, Deprecations oder Empfehlungen in `mx check` sowie
null MxBuild-Fehlern.

`--mx` führt den offiziellen schreibgeschützten Checker mit Warnungen,
Deprecations und Best-Practice-Empfehlungen aus. Das Gate validiert die
Exit-Bitmaske und vergleicht normalisierte Signaturen von Quelle und Rebuild.
Expand Down
10 changes: 10 additions & 0 deletions docs/en-US/platform-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ mxrb frontend migrate App.mpr --apply --json
script/frontend_acceptance App.mpr -o frontend-round-trip.json
script/frontend_acceptance App.mpr --mxbuild /path/to/mxbuild -o frontend.json
script/frontend_acceptance App.mpr --mx /path/to/mx -o frontend-diagnostics.json
script/frontend_lifecycle_acceptance --version 11.12.1 --mx /path/to/mx \
--mxbuild /path/to/mxbuild --strict-warnings -o frontend-lifecycle.json
```

`mxrb frontend migrate` is an immutable, fail-closed preview by default. For
Expand Down Expand Up @@ -55,6 +57,14 @@ On August 4, 2026, the safe migration completed the accepted 10.24.0.73019 and
11.12.1 matrix: source and rebuilt projects returned zero MxBuild errors and
both reports set `frontend_ready` to `true`.

`script/frontend_lifecycle_acceptance` creates an app exclusively through the
CLI, generates its MPR, exports it to Ruby, changes Home and navigation, adds
an entity, form, microflow, nanoflow, and asset, regenerates, exports again,
and requires a structurally identical rebuild. On the official 10.24.0.73019
and 11.12.1 matrix, source and rebuilt projects completed with zero errors,
warnings, deprecations, or recommendations in `mx check`, plus zero MxBuild
errors.

`--mx` runs the official read-only checker with warnings, deprecations, and
best-practice recommendations enabled. It validates the checker's exit bitmask
and compares normalized source/rebuilt signatures. The accepted 10.24 fixture
Expand Down
9 changes: 9 additions & 0 deletions docs/pt-BR/platform-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ mxrb frontend migrate App.mpr --apply --json
script/frontend_acceptance App.mpr -o frontend-round-trip.json
script/frontend_acceptance App.mpr --mxbuild /caminho/mxbuild -o frontend.json
script/frontend_acceptance App.mpr --mx /caminho/mx -o frontend-diagnostics.json
script/frontend_lifecycle_acceptance --version 11.12.1 --mx /caminho/mx \
--mxbuild /caminho/mxbuild --strict-warnings -o frontend-lifecycle.json
```

`mxrb frontend migrate` é uma prévia imutável e fail-closed por padrão. Para
Expand Down Expand Up @@ -58,6 +60,13 @@ Em 4 de agosto de 2026, a migração segura concluiu a matriz aceita 10.24.0.730
11.12.1: origem e reconstrução retornaram zero erros no MxBuild e os dois
relatórios marcaram `frontend_ready` como `true`.

`script/frontend_lifecycle_acceptance` cria um app exclusivamente pela CLI,
gera o MPR, exporta-o para Ruby, altera a Home e a navegação, adiciona entidade,
formulário, microflow, nanoflow e asset, gera novamente, exporta uma segunda vez
e exige reconstrução estruturalmente idêntica. Na matriz oficial 10.24.0.73019
e 11.12.1, origem e reconstrução concluíram com zero erros, warnings,
depreciações e recomendações no `mx check`, além de zero erros no MxBuild.

`--mx` executa o checker oficial somente leitura com warnings, depreciações e
recomendações de boas práticas. O gate valida o bitmask de saída e compara as
assinaturas normalizadas de origem e reconstrução. A fixture 10.24 aceita tem
Expand Down
38 changes: 28 additions & 10 deletions lib/mxrb/scaffold/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ class Generator
Result = Data.define(:root, :files, :updated, :kind, :name, :dry_run)
IDENTIFIER = /\A[A-Za-z][A-Za-z0-9_]*\z/
RESERVED_ENTITY_NAMES = %w[Owner ChangedBy CreatedDate ChangedDate].freeze
LAYER_AGGREGATORS = {
'domain' => 'model.rb',
'application' => 'application.rb',
'presentation' => 'presentation.rb',
'infrastructure' => 'infrastructure.rb'
}.freeze

def initialize(kind, name = nil, target: Dir.pwd, dry_run: false)
@kind = kind.to_sym
Expand Down Expand Up @@ -58,19 +64,20 @@ def ensure_infrastructure(module_name)
connect_module_aggregator(module_name, 'infrastructure', 'infrastructure.rb')
end

def ensure_application_directory(module_name, directory)
ensure_module(module_name)
ensure_evaluate_dir(module_path(module_name, 'application', 'application.rb'), directory)
end
def connect_artifact(aggregator, *segments)
source = @transaction.content(aggregator)
raise ArgumentError, "#{aggregator}: aggregator not found" unless source

def ensure_evaluate_dir(path, directory)
source = @transaction.content(path)
raise ArgumentError, "#{path}: aggregator not found" unless source

line = %(evaluate_dir File.join(__dir__, "#{directory}"))
line = artifact_evaluation(source, segments)
return if source.include?(line)

@transaction.write(path, "#{source.rstrip}\n#{line}\n")
@transaction.write(aggregator, "#{source.rstrip}\n#{line}\n")
end

def artifact_evaluation(source, segments)
return evaluate_line(segments) unless source.match?(/^\s*evaluate_dir File\.join\(__dir__, /)

%(evaluate_dir File.join(__dir__, "#{segments.fetch(0)}"))
end

def connect_module_aggregator(module_name, *segments)
Expand Down Expand Up @@ -116,6 +123,17 @@ def create_module_file(module_name, directories, artifact_name, template, suffix
filename = "#{Templates.snake_case(artifact_name)}#{suffix}.rb"
path = module_path(module_name, *directories, filename)
@transaction.create(path, Templates.render(template, module_name:, name: artifact_name))
filename
end

def create_connected_module_file(module_name, directories, artifact_name, template, suffix: nil)
filename = create_module_file(
module_name, directories, artifact_name, template, suffix:
)
layer, *relative = directories
aggregator = module_path(module_name, layer, LAYER_AGGREGATORS.fetch(layer))
connect_artifact(aggregator, *relative, filename)
filename
end

def create_project_file(directories, artifact_name, content)
Expand Down
29 changes: 18 additions & 11 deletions lib/mxrb/scaffold/recipes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,44 @@ def scaffold_query = scaffold_simple(:query)

def scaffold_constant
module_name, artifact_name = qualified_name
create_module_file(module_name, SIMPLE.fetch(:constant), artifact_name, :constant)
ensure_evaluate_dir(module_path(module_name, 'domain', 'model.rb'), 'constants')
create_connected_module_file(
module_name, SIMPLE.fetch(:constant), artifact_name, :constant
)
end

def scaffold_page
module_name, artifact_name = qualified_name
ensure_presentation(module_name)
create_module_file(module_name, %w[presentation pages], artifact_name, :page)
create_connected_module_file(
module_name, %w[presentation pages], artifact_name, :page
)
end

def scaffold_nanoflow
module_name, artifact_name = qualified_name
ensure_presentation(module_name)
create_module_file(module_name, %w[presentation client_actions], artifact_name, :nanoflow)
create_connected_module_file(
module_name, %w[presentation client_actions], artifact_name, :nanoflow
)
end

def scaffold_repository
module_name, artifact_name = qualified_name
ensure_application_directory(module_name, 'repositories')
ensure_infrastructure(module_name)
create_module_file(module_name, %w[application repositories], artifact_name, :repository)
create_module_file(
create_connected_module_file(
module_name, %w[application repositories], artifact_name, :repository
)
create_connected_module_file(
module_name, %w[infrastructure repositories], artifact_name,
:repository_implementation, suffix: '_implementation'
)
end

def scaffold_scheduled_event
module_name, artifact_name = qualified_name
ensure_application_directory(module_name, 'jobs')
create_module_file(module_name, %w[application jobs], artifact_name, :scheduled_event)
create_connected_module_file(
module_name, %w[application jobs], artifact_name, :scheduled_event
)
end

def scaffold_integration = scaffold_infrastructure_artifact(:integration)
Expand Down Expand Up @@ -134,13 +141,13 @@ def scaffold_ci

def scaffold_simple(kind)
module_name, artifact_name = qualified_name
create_module_file(module_name, SIMPLE.fetch(kind), artifact_name, kind)
create_connected_module_file(module_name, SIMPLE.fetch(kind), artifact_name, kind)
end

def scaffold_infrastructure_artifact(kind)
module_name, artifact_name = qualified_name
ensure_infrastructure(module_name)
create_module_file(
create_connected_module_file(
module_name, ['infrastructure', INFRASTRUCTURE.fetch(kind)], artifact_name, kind
)
end
Expand Down
Loading
Loading