[pull] develop from mermaid-js:develop - #230
Merged
Merged
Conversation
`scripts/tsc-check.ts` built its throwaway project with `type-fest: '*'`
and a hardcoded `@types/d3: '^7.4.3'`, which means "whatever the registry
serves today". `mermaid`'s emitted declarations reference both directly,
and they were compiled against the ranges `packages/mermaid/package.json`
declares -- so resolving them freely checks the published types against
versions mermaid has never been built with.
That went off on 2026-08-30, when `type-fest@5.9.0` added `Float16Array`
to its `TypedArray` union. The generated tsconfig uses `lib: ["dom",
"es2020"]`, where that type does not exist, and leaves `skipLibCheck` off
so third-party declarations are checked too:
node_modules/type-fest/source/typed-array.d.ts(14,4):
error TS2304: Cannot find name 'Float16Array'.
Nothing in the repo had changed. Two `Unit Tests` runs of the same commit
started three seconds apart disagreed, purely on what npm resolved.
Read both ranges from the package under test instead, which is what the
note below the field already asked for. `typescript` stays unpinned on
purpose: a downstream picks its own compiler, so checking against the
current release is the signal this job exists to give.
`stdio: 'inherit'` goes in alongside it. Without it `execFileSync` buffers
the compiler output and a failure prints `<Buffer 0a 3e ...>`, which is
most of why this read as mysterious rather than as a version bump.
Fixes #8179
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix(ci): pin tsc-check's type dependencies to what mermaid declares
The edge joining a state to its note rendered as a solid line under
`look: neo`. Reproduces on `develop` today with any theme -- it is a neo
bug, not a theme one -- but making neo the default is what turns a
long-standing quirk into everyone's problem.
The dashes were expressed only as CSS: `.note-edge { stroke-dasharray: 5 }`
in `state/styles.js`. That is enough under `classic`, which writes no inline
stroke properties. Under `neo`, `insertEdge` writes an *inline*
`stroke-dasharray` on every edge, computed from the path length -- for a
solid edge, one long run trimmed at both ends so the arrow markers keep
their gaps. An inline style outranks a stylesheet rule, so the note edge
took the solid pattern with `.note-edge` still present and simply losing.
`insertEdge` picks between its two dash generators on `edge.pattern`, so
that is where the dashing belongs. The note edge now declares
`pattern: 'dashed'`, which routes it through the same generator every other
dashed edge uses and so keeps the marker gaps.
The `note-edge` class stays: `classic` has no inline dasharray, so that rule
is what dashes the line there, and it beats `edge-pattern-dashed` on source
order at equal specificity. Dropping it would change classic's dash length
from 5 to 3.
Verified by rendering: under neo the note edge goes from a single 93px run
to 49 segments of 2px, while `Active --> Idle` stays solid at one run;
under classic both are unchanged. Three unit tests pin the pattern, that
transitions stay patternless, and that the class is retained; removing the
fix fails the first. `stateDiagram-neo.spec.js` already renders a state with
a note, so Argos covers this visually.
Unit suite 5941 passing (2 pre-existing domus harness env-var failures);
lint, Prettier, cspell and build:types clean.
fix(state): draw the note edge dashed under the neo look
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )