chore: upgrade to Langium v4 and TypeScript v5.8#7377
chore: upgrade to Langium v4 and TypeScript v5.8#7377aloisklink merged 6 commits intomermaid-js:masterfrom
Conversation
🦋 Changeset detectedLatest commit: 426a616 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7377 +/- ##
=========================================
- Coverage 3.59% 3.59% -0.01%
=========================================
Files 474 475 +1
Lines 47168 47185 +17
Branches 734 734
=========================================
Hits 1696 1696
- Misses 45472 45489 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This is now required by TypeScript v5.8 and Node.js 22, and was officially added to ECMAScript 2025 🥳
This is required to upgrade to Langium v4.
I've also unpinned the dependency and instead added a caret to the specifier, so that any future security updates mean we won't need to make a new release of the `@mermaid-js/parser` package. I'm not sure why, but something between Langium v3.4.0 and v3.5.0 breaks indentation in treemaps, so we need to move the rule before the `hidden terminal WS` rule.
Updates the `@mermaid-js/parser` to Langium v4. There were a couple of breaking changes we had to fix to do this upgrade: - Rename all the grammers from Abc to AbcGrammar, as rules within grammars cannot have the same name as the grammar. - Update the tests, since the generated type names from `ast.ts` have been moved from `<typeName>` to `<typeName>.$type`. - Turn the EOL fragment into a rule, as in Langium v4, it's no longer allowed and throws an error. As this is a **BREAKING CHANGE** for users, I've made a new major release in the changeset (and it means we can finally get a v1.0.0 of `@mermaid-js/parser`).
This pulls part of the following changes from `develop`: - 99f17be (fix: update @argos-ci/cypress to version 6.1.3, 2025-10-07) - 15e2824 (fix(deps): update all patch dependencies, 2025-11-06) - 847b3aa (fix(deps): update all patch dependencies, 2025-11-10) - 3c75242 (chore(deps): update all patch dependencies, 2025-11-19) But, this is needed to get Argos working properly for PRs to `master`.
478473b to
426a616
Compare
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
Marking this as ready for review again! I went through and fixed a bunch of issues in treemap diagrams before finally finding the one that was breaking this. Apparently, the I've also updated @argos-ci in this PR, just so we can see the result. |
|
Not a big deal for us, but upgrading to Langium in a minor release means requiring a newer Node version, which is kind of a breaking change for Mermaid consumers (see facebook/docusaurus#11812)
I'm not sure what your commitment to semver is, but maybe it could be useful to use GitHub actions with node matrices with min/max supported versions so that you detect early when a dependency require. |

📑 Summary
Note
This PR targets the
masterbranch, notdevelop.Upgrade the
@mermaid-js/parserpackage to use Langium v4.There were a couple of breaking changes we had to fix to do this upgrade:
ast.tshave been moved from<typeName>to<typeName>.$type.v3.5.0 of Langium also had a breaking change with treemap diagrams, but I've moved the
terminal INDENTATIONin front of thehidden terminal WSand that seems to have fixed it!Because of this, I've made the changeset for
@mermaid-js/parserto be a major version, so we'd release v1.0.0 of it.However, I don't believe any of these changes will be breaking to any user of
mermaid, sincemermaiddoesn't re-export anything from@mermaid-js/parser, so just the default patch release that changeset makes would be okay for it.Resolves #7345
📏 Design Decisions
Since there's some merge conflicts with
developand themasterbranch, I've also made https://github.com/aloisklink/mermaid/tree/chore/upgrade-to-langium-v4-develop so we can easily merge the changes intodevelop.Also, due to @argos-ci failing, I've updated it so we can see the status of it on this PR.
📋 Tasks
Make sure you
MERMAID_RELEASE_VERSIONis used for all new features.pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.