@mcqj/vexflow 0.0.1-alpha.6 → 0.0.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -93,7 +93,21 @@ Update committed visual baselines deliberately after reviewing an intentional re
|
|
|
93
93
|
npm run test:visual:update
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
To update only the snapshots exercised by one named Playwright test, pass its title to `-g`. For example, update the Barline visual cases:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
npx playwright test -g 'matches source-rendered barline cases' --update-snapshots
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Inspect the changed PNG files with `git diff` before committing them. A title can cover multiple screenshots, so prefer the most specific test title available and never update baselines for an unexplained difference.
|
|
103
|
+
|
|
104
|
+
Playwright stores failure artifacts in `build/playwright-artifacts/`, including expected, actual, and pixel-diff images. Each run also writes an HTML report to `build/playwright-report/`:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
npx playwright show-report build/playwright-report
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The committed snapshots are macOS Chromium baselines, and CI runs the visual suite on macOS to match them.
|
|
97
111
|
|
|
98
112
|
The legacy reference-image workflow generates images with the Playwright backend:
|
|
99
113
|
|
|
@@ -6,16 +6,13 @@ import { Stave } from './stave.js';
|
|
|
6
6
|
import { StaveConnector } from './staveconnector.js';
|
|
7
7
|
import { Tables } from './tables.js';
|
|
8
8
|
import { TickContext } from './tickcontext.js';
|
|
9
|
-
import {
|
|
9
|
+
import { isNote, isStaveNote } from './typeguard.js';
|
|
10
10
|
import { defined, log, midLine, RuntimeError, sumArray } from './util.js';
|
|
11
11
|
import { Voice } from './voice.js';
|
|
12
12
|
function L(...args) {
|
|
13
13
|
if (Formatter.DEBUG)
|
|
14
14
|
log('VexFlow.Formatter', args);
|
|
15
15
|
}
|
|
16
|
-
function isBarNote(tickable) {
|
|
17
|
-
return isCategory(tickable, "BarNote");
|
|
18
|
-
}
|
|
19
16
|
function getRestLineForNextNoteGroup(notes, currRestLine, currNoteIndex, compare) {
|
|
20
17
|
let nextRestLine = currRestLine;
|
|
21
18
|
for (let noteIndex = currNoteIndex + 1; noteIndex < notes.length; noteIndex++) {
|
|
@@ -252,9 +249,7 @@ export class Formatter {
|
|
|
252
249
|
staveTickToContextMap[integerTicks] = newContext;
|
|
253
250
|
}
|
|
254
251
|
tickable.addToModifierContext(staveTickToContextMap[integerTicks]);
|
|
255
|
-
|
|
256
|
-
ticksUsed.add(tickable.getTicks());
|
|
257
|
-
}
|
|
252
|
+
ticksUsed.add(tickable.getTicks());
|
|
258
253
|
});
|
|
259
254
|
});
|
|
260
255
|
this.modifierContexts.push({
|
|
@@ -288,9 +283,7 @@ export class Formatter {
|
|
|
288
283
|
}
|
|
289
284
|
const tickContext = tickToContextMap[integerTicks];
|
|
290
285
|
tickContext.addTickable(tickable, voiceIndex, voice.isDependent());
|
|
291
|
-
|
|
292
|
-
ticksUsed.add(tickable.getTicks());
|
|
293
|
-
}
|
|
286
|
+
ticksUsed.add(tickable.getTicks());
|
|
294
287
|
});
|
|
295
288
|
});
|
|
296
289
|
const contexts = {
|
package/build/esm/src/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const VERSION = '0.0.1-alpha.
|
|
1
|
+
export const VERSION = '0.0.1-alpha.7';
|
|
2
2
|
export const ID = 'a4bb5ff157f4570b2d6149b7199b0baa4c7e3775';
|
|
3
|
-
export const DATE = '2026-09-
|
|
3
|
+
export const DATE = '2026-09-14T16:33:09.139Z';
|
|
@@ -84,18 +84,23 @@ function getGlyphWidth(glyph) {
|
|
|
84
84
|
return el.getWidth();
|
|
85
85
|
}
|
|
86
86
|
function ignoredBarNotesPreserveLyricTickAlignment(assert) {
|
|
87
|
-
const musicNotes =
|
|
87
|
+
const musicNotes = [
|
|
88
|
+
...Array.from({ length: 6 }, () => new StaveNote({ keys: ['c/4'], duration: '8' })),
|
|
89
|
+
new BarNote(),
|
|
90
|
+
...Array.from({ length: 6 }, () => new StaveNote({ keys: ['c/4'], duration: '8' })),
|
|
91
|
+
];
|
|
88
92
|
const when = new TextNote({ text: 'When', duration: '8' });
|
|
89
93
|
const lyricNotes = [
|
|
90
94
|
...Array.from({ length: 6 }, () => new GhostNote({ duration: '8' })),
|
|
91
|
-
new
|
|
95
|
+
new GhostNote({ duration: 'b' }),
|
|
92
96
|
when,
|
|
93
97
|
...Array.from({ length: 5 }, () => new TextNote({ text: '', duration: '8' })),
|
|
94
98
|
];
|
|
95
99
|
const musicVoice = new Voice({ numBeats: 6, beatValue: 4 }).addTickables(musicNotes);
|
|
96
|
-
const lyricVoice = new Voice({ numBeats: 6, beatValue: 4 }).addTickables(lyricNotes);
|
|
100
|
+
const lyricVoice = new Voice({ numBeats: 6, beatValue: 4 }).setMode(Voice.Mode.SOFT).addTickables(lyricNotes);
|
|
97
101
|
new Formatter().joinVoices([musicVoice, lyricVoice]).format([musicVoice, lyricVoice], 500);
|
|
98
|
-
assert.
|
|
102
|
+
assert.notStrictEqual(musicNotes[6].getTickContext(), musicNotes[7].getTickContext());
|
|
103
|
+
assert.strictEqual(when.getTickContext(), musicNotes[7].getTickContext());
|
|
99
104
|
}
|
|
100
105
|
function dependentVoicesDoNotAffectMusicLayout(assert) {
|
|
101
106
|
const makeMusicNotes = () => Array.from({ length: 4 }, () => new StaveNote({ keys: ['c/4'], duration: '4' }));
|