Skip to content

Commit

Permalink
Merge pull request #1209 from rvilarl/migration/4.0
Browse files Browse the repository at this point in the history
Migration/4.0
  • Loading branch information
0xfe authored Nov 2, 2021
2 parents fe20e5b + 79b46c0 commit 365e81e
Show file tree
Hide file tree
Showing 73 changed files with 470 additions and 529 deletions.
3 changes: 1 addition & 2 deletions src/chordsymbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
//
// See `tests/chordsymbol_tests.ts` for usage examples.

import { ModifierContextState } from 'modifiercontext';

import { Glyph } from './glyph';
import { Modifier } from './modifier';
import { ModifierContextState } from './modifiercontext';
import { StemmableNote } from './stemmablenote';
import { Tables } from './tables';
import { TextFont } from './textfont';
Expand Down
3 changes: 1 addition & 2 deletions src/multimeasurerest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//
// This class implements multiple measure rests.

import { isBarline } from 'typeguard';

import { Element } from './element';
import { Glyph } from './glyph';
import { NoteHead } from './notehead';
Expand All @@ -13,6 +11,7 @@ import { Stave } from './stave';
import { StaveModifierPosition } from './stavemodifier';
import { Tables } from './tables';
import { TimeSignature } from './timesignature';
import { isBarline } from './typeguard';
import { defined } from './util';

export interface MultimeasureRestRenderOptions {
Expand Down
3 changes: 1 addition & 2 deletions src/stave.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
// MIT License

import { isBarline } from 'typeguard';

import { BoundingBox } from './boundingbox';
import { Clef } from './clef';
import { Element, ElementStyle } from './element';
Expand All @@ -16,6 +14,7 @@ import { StaveText } from './stavetext';
import { Volta } from './stavevolta';
import { Tables } from './tables';
import { TimeSignature } from './timesignature';
import { isBarline } from './typeguard';
import { Bounds, FontInfo } from './types/common';
import { RuntimeError } from './util';

Expand Down
3 changes: 1 addition & 2 deletions src/stavetempo.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
// Author Radosaw Eichler 2012

import { FontInfo } from 'types/common';

import { Glyph } from './glyph';
import { Stave } from './stave';
import { StaveModifier, StaveModifierPosition } from './stavemodifier';
import { Tables } from './tables';
import { FontInfo } from './types/common';

export interface StaveTempoOptions {
bpm?: number;
Expand Down
3 changes: 1 addition & 2 deletions src/stavetext.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.
// Author Taehoon Moon 2014

import { FontInfo } from 'types/common';

import { Stave } from './stave';
import { StaveModifier, StaveModifierPosition } from './stavemodifier';
import { Justification, TextNote } from './textnote';
import { FontInfo } from './types/common';
import { RuntimeError } from './util';

export class StaveText extends StaveModifier {
Expand Down
3 changes: 1 addition & 2 deletions src/stringnumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
// This file implements the `StringNumber` class which renders string
// number annotations beside notes.

import { Stem } from 'stem';

import { Modifier } from './modifier';
import { ModifierContextState } from './modifiercontext';
import { Note } from './note';
import { Renderer } from './renderer';
import { Stem } from './stem';
import { isStaveNote, isStemmableNote } from './typeguard';
import { FontInfo } from './types/common';
import { RuntimeError } from './util';
Expand Down
3 changes: 1 addition & 2 deletions src/tabnote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
//
// See `tests/tabnote_tests.ts` for usage examples.

import { isDot } from 'typeguard';

import { Dot } from './dot';
import { Glyph, GlyphProps } from './glyph';
import { Modifier } from './modifier';
Expand All @@ -17,6 +15,7 @@ import { StaveNoteStruct } from './stavenote';
import { Stem } from './stem';
import { StemmableNote } from './stemmablenote';
import { Tables } from './tables';
import { isDot } from './typeguard';
import { defined, RuntimeError } from './util';

export interface TabNotePosition {
Expand Down
33 changes: 16 additions & 17 deletions tests/accidental_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
//
// Accidental Tests

import { Accidental } from 'accidental';
import { Beam } from 'beam';
import { Factory } from 'factory';
import { Flow } from 'flow';
import { Formatter } from 'formatter';
import { Modifier } from 'modifier';
import { ModifierContext } from 'modifiercontext';
import { Note } from 'note';
import { RenderContext } from 'rendercontext';
import { Stave } from 'stave';
import { StaveNote, StaveNoteStruct } from 'stavenote';
import { Stem } from 'stem';
import { TickContext } from 'tickcontext';
import { TimeSigNote } from 'timesignote';
import { isCategory } from 'typeguard';
import { Voice } from 'voice';

import { Accidental } from '../src/accidental';
import { Beam } from '../src/beam';
import { Factory } from '../src/factory';
import { Flow } from '../src/flow';
import { Formatter } from '../src/formatter';
import { Modifier } from '../src/modifier';
import { ModifierContext } from '../src/modifiercontext';
import { Note } from '../src/note';
import { RenderContext } from '../src/rendercontext';
import { Stave } from '../src/stave';
import { StaveNote, StaveNoteStruct } from '../src/stavenote';
import { Stem } from '../src/stem';
import { TickContext } from '../src/tickcontext';
import { TimeSigNote } from '../src/timesignote';
import { isCategory } from '../src/typeguard';
import { Voice } from '../src/voice';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const AccidentalTests = {
Expand Down
29 changes: 14 additions & 15 deletions tests/annotation_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@
// Did a previous version of the API accept a number as the fourth argument?
// We removed the fourth argument from all of our test cases.

import { Annotation } from 'annotation';
import { Beam } from 'beam';
import { Bend } from 'bend';
import { Flow } from 'flow';
import { Formatter } from 'formatter';
import { Registry } from 'registry';
import { ContextBuilder } from 'renderer';
import { Stave } from 'stave';
import { StaveNote, StaveNoteStruct } from 'stavenote';
import { TabNote, TabNoteStruct } from 'tabnote';
import { TabStave } from 'tabstave';
import { Tickable } from 'tickable';
import { Vibrato } from 'vibrato';
import { Voice } from 'voice';

import { Annotation } from '../src/annotation';
import { Beam } from '../src/beam';
import { Bend } from '../src/bend';
import { Flow } from '../src/flow';
import { Formatter } from '../src/formatter';
import { Registry } from '../src/registry';
import { ContextBuilder } from '../src/renderer';
import { Stave } from '../src/stave';
import { StaveNote, StaveNoteStruct } from '../src/stavenote';
import { TabNote, TabNoteStruct } from '../src/tabnote';
import { TabStave } from '../src/tabstave';
import { Tickable } from '../src/tickable';
import { Vibrato } from '../src/vibrato';
import { Voice } from '../src/voice';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const AnnotationTests = {
Expand Down
27 changes: 13 additions & 14 deletions tests/articulation_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
//
// Articulation Tests

import { Articulation } from 'articulation';
import { Beam } from 'beam';
import { Flow } from 'flow';
import { Font } from 'font';
import { Formatter } from 'formatter';
import { ContextBuilder } from 'renderer';
import { Stave } from 'stave';
import { Barline, BarlineType } from 'stavebarline';
import { StaveNote } from 'stavenote';
import { TabNote } from 'tabnote';
import { TabStave } from 'tabstave';
import { Voice } from 'voice';

import { Articulation } from '../src/articulation';
import { Beam } from '../src/beam';
import { Flow } from '../src/flow';
import { Font } from '../src/font';
import { Formatter } from '../src/formatter';
import { ContextBuilder } from '../src/renderer';
import { Stave } from '../src/stave';
import { Barline } from '../src/stavebarline';
import { StaveNote } from '../src/stavenote';
import { TabNote } from '../src/tabnote';
import { TabStave } from '../src/tabstave';
import { Voice } from '../src/voice';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const ArticulationTests = {
Expand Down Expand Up @@ -301,7 +300,7 @@ function drawArticulations2(options: TestOptions): void {
}

// Helper function to justify and draw a 4/4 voice
x += formatAndDrawToWidth(x, y, width, notesBar4, Barline.type.END, []);
formatAndDrawToWidth(x, y, width, notesBar4, Barline.type.END, []);
}

function tabNotes(options: TestOptions, contextBuilder: ContextBuilder): void {
Expand Down
11 changes: 5 additions & 6 deletions tests/auto_beam_formatting_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
// TODO: Beam.generateBeams(voice.getTickables() as StemmableNote[], ...) requires a cast to StemmableNote[].
// Is there a cleaner way to handle this?

import { Beam } from 'beam';
import { EasyScore } from 'easyscore';
import { Fraction } from 'fraction';
import { Stem } from 'stem';
import { StemmableNote } from 'stemmablenote';

import { Beam } from '../src/beam';
import { EasyScore } from '../src/easyscore';
import { Fraction } from '../src/fraction';
import { Stem } from '../src/stem';
import { StemmableNote } from '../src/stemmablenote';
import { concat, TestOptions, VexFlowTests } from './vexflow_test_helpers';

const AutoBeamFormattingTests = {
Expand Down
9 changes: 4 additions & 5 deletions tests/bach_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
//
// Bach Demo

import { Factory } from 'factory';
import { Registry } from 'registry';
import { BarlineType } from 'stavebarline';
import { StaveNote } from 'stavenote';

import { Factory } from '../src/factory';
import { Registry } from '../src/registry';
import { BarlineType } from '../src/stavebarline';
import { StaveNote } from '../src/stavenote';
import { concat, TestOptions, VexFlowTests } from './vexflow_test_helpers';

const BachDemoTests = {
Expand Down
3 changes: 1 addition & 2 deletions tests/barline_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
//
// Barline Tests

import { Barline, BarlineType } from 'stavebarline';

import { Barline, BarlineType } from '../src/stavebarline';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const BarlineTests = {
Expand Down
13 changes: 6 additions & 7 deletions tests/beam_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@

// TODO: Factory.Beam()'s 'notes' argument is a StemmableNote[], but we only have access to Tickable[].

import { Beam } from 'beam';
import { StaveNoteStruct } from 'stavenote';
import { Stem } from 'stem';
import { StemmableNote } from 'stemmablenote';
import { TabNoteStruct } from 'tabnote';
import { Voice } from 'voice';

import { Beam } from '../src/beam';
import { StaveNoteStruct } from '../src/stavenote';
import { Stem } from '../src/stem';
import { StemmableNote } from '../src/stemmablenote';
import { TabNoteStruct } from '../src/tabnote';
import { Voice } from '../src/voice';
import { concat, TestOptions, VexFlowTests } from './vexflow_test_helpers';

const BeamTests = {
Expand Down
17 changes: 8 additions & 9 deletions tests/bend_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
//
// Bend Tests

import { Bend, BendPhrase } from 'bend';
import { Formatter } from 'formatter';
import { ModifierContext } from 'modifiercontext';
import { Note } from 'note';
import { ContextBuilder } from 'renderer';
import { TabNote, TabNoteStruct } from 'tabnote';
import { TabStave } from 'tabstave';
import { TickContext } from 'tickcontext';

import { Bend, BendPhrase } from '../src/bend';
import { Formatter } from '../src/formatter';
import { ModifierContext } from '../src/modifiercontext';
import { Note } from '../src/note';
import { ContextBuilder } from '../src/renderer';
import { TabNote, TabNoteStruct } from '../src/tabnote';
import { TabStave } from '../src/tabstave';
import { TickContext } from '../src/tickcontext';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const BendTests = {
Expand Down
2 changes: 1 addition & 1 deletion tests/boundingbox_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Bounding Box Tests

import { BoundingBox } from 'boundingbox';
import { BoundingBox } from '../src/boundingbox';

const BoundingBoxTests = {
Start(): void {
Expand Down
7 changes: 3 additions & 4 deletions tests/boundingboxcomputation_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
//
// BoundingBoxComputation Tests

import { BoundingBoxComputation } from 'boundingboxcomputation';
import { Glyph, OutlineCode } from 'glyph';
import { RenderContext } from 'rendercontext';

import { BoundingBoxComputation } from '../src/boundingboxcomputation';
import { Glyph, OutlineCode } from '../src/glyph';
import { RenderContext } from '../src/rendercontext';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const BoundingBoxComputationTests = {
Expand Down
13 changes: 6 additions & 7 deletions tests/chordsymbol_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
//
// ChordSymbol Tests

import { Accidental } from 'accidental';
import { ChordSymbol } from 'chordsymbol';
import { Factory } from 'factory';
import { Formatter } from 'formatter';
import { Stave } from 'stave';
import { StaveNote } from 'stavenote';

import { Accidental } from '../src/accidental';
import { ChordSymbol } from '../src/chordsymbol';
import { Factory } from '../src/factory';
import { Formatter } from '../src/formatter';
import { Stave } from '../src/stave';
import { StaveNote } from '../src/stavenote';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const ChordSymbolTests = {
Expand Down
9 changes: 4 additions & 5 deletions tests/curve_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
//
// Curve Tests

import { CurvePosition } from 'curve';
import { BuilderOptions } from 'easyscore';
import { Factory } from 'factory';
import { StaveNote } from 'stavenote';

import { CurvePosition } from '../src/curve';
import { BuilderOptions } from '../src/easyscore';
import { Factory } from '../src/factory';
import { StaveNote } from '../src/stavenote';
import { concat, TestOptions, VexFlowTests } from './vexflow_test_helpers';

const CurveTests = {
Expand Down
17 changes: 8 additions & 9 deletions tests/dot_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
//
// Dot Tests

import { Beam } from 'beam';
import { ModifierContext } from 'modifiercontext';
import { Note } from 'note';
import { RenderContext } from 'rendercontext';
import { ContextBuilder } from 'renderer';
import { Stave } from 'stave';
import { StaveNote } from 'stavenote';
import { TickContext } from 'tickcontext';

import { Beam } from '../src/beam';
import { ModifierContext } from '../src/modifiercontext';
import { Note } from '../src/note';
import { RenderContext } from '../src/rendercontext';
import { ContextBuilder } from '../src/renderer';
import { Stave } from '../src/stave';
import { StaveNote } from '../src/stavenote';
import { TickContext } from '../src/tickcontext';
import { TestOptions, VexFlowTests } from './vexflow_test_helpers';

const DotTests = {
Expand Down
Loading

0 comments on commit 365e81e

Please sign in to comment.