Skip to content

refactor!: drop the learned id style, new ids follow element-id-naming - #118

Merged
emaarco merged 3 commits into
mainfrom
emaarco/refactor-drop-the-learned-id-style-new-ids-follo
Oct 28, 2026
Merged

emaarco merged 3 commits into
mainfrom
emaarco/refactor-drop-the-learned-id-style-new-ids-follo

Conversation

@emaarco

@emaarco emaarco commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Why

bpmn-cli learned an id style from each file's existing ids. New ids were hard to predict, and they often failed @miragon/rules/element-id-naming as soon as a project turned the rule on.

What

  • Ids: new ids follow the conventions the .bpmnlintrc declares, else the rule's defaults (userTask_checkInvoice, flow_checkInvoiceToBookInvoice).
  • Plugin: 0.19.0; the conventions are read through its ElementIdConvention API instead of a copy of its logic.
  • Unchecked types: bpmn-cli's own prefix (message_, dataObjectItem_); a named process is its name (orderToCash).
  • Docs: docs/bpmnlint.md explains how to get matching ids; all examples, shots and evals use the new ids.

Verification

  • npm run gate and npm run docs:build are green after rebasing on main.

Breaking changes

  • A file without a .bpmnlintrc gets the default ids, whatever its existing ids look like; existing ids are never renamed.
  • idConventionsFromLint needs the plugin's naming namespace from 0.19 on; MutationResult.conventions and conventionsLines are removed.

Closes #115

New ids no longer come from a style learned from the file's existing ids. They
follow the conventions element-id-naming declares in the .bpmnlintrc, else the
plugin's defaults (camelCase), so generated ids pass the rule out of the box.
Types the rule does not check take bpmn-cli's own prefix (message_, laneSet_,
dataObjectItem_...); a named process is its name (orderToCash), an unnamed one
Process_1. Only flows in the current form follow their ends; kebab-case is
supported.

- bump @miragon/bpmnlint-plugin-rules 0.14.0 -> 0.19.0 and read the conventions
  through its ElementIdConvention API
- remove LearnedStyle, Tally, the learned flow forms and tools/speaking-ids.mjs
- remove MutationResult.conventions, ConventionsReport, conventionsLines and the
  `conventions:` output line
- `bpmn show --conventions` sources are now lint / default / bpmn-cli
- rework docs/bpmnlint.md "Id conventions" into a guide on getting matching ids

BREAKING CHANGE: files without a .bpmnlintrc get element-id-naming's default ids
even where their existing ids look different; idConventionsFromLint needs the
naming namespace of @miragon/bpmnlint-plugin-rules 0.19 or later;
MutationResult.conventions and the conventionsLines export are removed.
The backing data object and data store have their own prefixes now
(dataObjectItem_, dataStoreItem_), so they no longer share an id with their
reference. Where a .bpmnlintrc declares the same prefix for both, the usual
collision suffix applies.
…and eval

The examples, the regenerated pictures, the guide and help texts, the plugin
README and the evals use the ids the CLI now generates (userTask_checkInvoice,
flow_checkInvoiceToBookInvoice, orderHandling). The speaking-new-ids grader of
edit-hand-drawn-model checks the new convention.
@emaarco
emaarco marked this pull request as ready for review October 28, 2026 10:14
@emaarco
emaarco enabled auto-merge (squash) October 28, 2026 10:15
@emaarco
emaarco merged commit b998c7d into main Oct 28, 2026
8 checks passed
@emaarco
emaarco deleted the emaarco/refactor-drop-the-learned-id-style-new-ids-follo branch October 28, 2026 10:16
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.

[Refactor]: Drop the learned id style; new ids follow the declared convention or one default

1 participant