Skip to content

refactor!: move linting out of the domain and merge duplicated domain concepts - #116

Merged
emaarco merged 1 commit into
mainfrom
emaarco/review-bpmn-cli-repository
Oct 28, 2026
Merged

emaarco merged 1 commit into
mainfrom
emaarco/review-bpmn-cli-repository

Conversation

@emaarco

@emaarco emaarco commented Oct 28, 2026

Copy link
Copy Markdown
Member

Summary

A multi-perspective review found that the domain mixed in non-domain code (the bpmnlint integration, presentation text, a second layout engine) and modelled several concepts many times over. This PR moves that code out and merges the parallel concepts, keeping the hexagon strict: CLI and entries reach the domain only through use cases.

  • Out of the domain: the bpmnlint wrapper, config resolution and id-conventions reader move to adapters/out/bpmnlint; the conventions text and OpsSchemaBuilder move to adapters/in/report.
  • Removed (breaking): the bpmn-auto-layout engine with its workaround files, the engine option and --engine.
  • One concept each: Finding + FindingMatcher instead of ~7 finding types and several comparisons; KINDS as the single kind registry and TRIGGERS as the single trigger table; ElementSummary, FlowRef and one element-line formatter shared by the four read views.
  • Structure: domain/editing is grouped into elements, connections, properties, events, extensions and ids, with classes constructed from one EditSession; all diagram commands live in domain/diagram/commands; one DocumentPort loads, targets and saves a document.
  • Language: CliError → BpmnError (deprecated alias kept), no Service suffix in the domain, command instead of op in code (the JSON key op stays).
  • Smaller items: merged geometry and moddle helpers, coded kind errors instead of regex mapping, tests mirroring src/, biome as a warn-only complexity check in the gate.

Output is unchanged apart from the removed engine: bpmn show text and JSON were compared byte for byte over all 169 repo models (54,964 views), and the layout regression score stays at 370.

Not done here, tracked separately: #113 (renderer behind a port), #114 (engine rules as bpmnlint rules), #115 (drop the learned id style).

Checklist

  • npm run typecheck passes
  • npm run gate passes
  • src/report/guide.ts and the matching page in docs/ are updated (only if a command, option or output changed)
  • PR title is a changelog-worthy Conventional-Commit summary

Linked issue

Refs #113, #114, #115

… concepts

- bpmnlint integration moves to adapters/out/bpmnlint; conventions text and the ops schema move to the report adapter
- one Finding type and one FindingMatcher replace the parallel finding types and comparisons
- KINDS is the single element-kind registry, TRIGGERS the single trigger table
- the read views share ElementSummary, FlowRef and one element-line formatter
- editing is grouped into elements, connections, properties, events, extensions and ids; classes take one EditSession
- diagram commands live in domain/diagram/commands behind one dispatch
- one DocumentPort loads, targets and saves a document
- CliError is renamed to BpmnError (CliError stays as a deprecated alias); domain classes no longer end in Service; code says command instead of op
- duplicated geometry and moddle helpers are merged; KindError is replaced by coded errors
- tests mirror src; biome warns on complex functions and nested ternaries

BREAKING CHANGE: the bpmn-auto-layout engine is removed, together with the `engine` option and the `--engine` flag. Full redraws always use the built-in clean engine.
@emaarco
emaarco enabled auto-merge (squash) October 28, 2026 06:43
@emaarco
emaarco merged commit ef1945f into main Oct 28, 2026
8 checks passed
@emaarco
emaarco deleted the emaarco/review-bpmn-cli-repository branch October 28, 2026 06:53
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