Skip to content

Commit

Permalink
vex&tables migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Jun 26, 2021
1 parent f855cdf commit fbfe96c
Show file tree
Hide file tree
Showing 7 changed files with 1,354 additions and 1,179 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = (grunt) => {
const BUILD_DIR = path.join(BASE_DIR, 'build');
const RELEASE_DIR = path.join(BASE_DIR, 'releases');
const REFERENCE_DIR = path.join(BASE_DIR, 'reference');
const MODULE_ENTRY = path.join(BASE_DIR, 'src/index.js');
const MODULE_ENTRY = path.join(BASE_DIR, 'src/index.ts');
const MODULE_ENTRY_TESTS = path.join(BASE_DIR, 'tests/run.js');
const TARGET_RAW = 'vexflow-debug.js';
const TARGET_MIN = 'vexflow-min.js';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vexflow",
"version": "3.0.9",
"description": "A JavaScript library for rendering music notation and guitar tablature",
"main": "src/index.js",
"main": "src/index.ts",
"repository": {
"type": "git",
"url": "https://github.com/0xfe/vexflow.git"
Expand Down
8 changes: 4 additions & 4 deletions src/articulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { TabNote } from './tabnote';
import { GraceNote } from './gracenote';

export interface ArticulationStruct {
code: string;
aboveCode: string;
belowCode: string;
code?: string;
aboveCode?: string;
belowCode?: string;
between_lines: boolean;
}

Expand Down Expand Up @@ -269,7 +269,7 @@ export class Articulation extends Modifier {

const code =
(this.position === ABOVE ? this.articulation.aboveCode : this.articulation.belowCode) || this.articulation.code;
this.glyph = new Glyph(code, this.render_options.font_scale);
this.glyph = new Glyph(code ?? '', this.render_options.font_scale);

this.setWidth(check<number>(this.glyph.getMetrics().width));
}
Expand Down
158 changes: 0 additions & 158 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,163 +1,5 @@
// [VexFlow](http://vexflow.com) - Copyright (c) Mohit Muthanna 2010.

import { Vex } from './vex';
import { Flow } from './tables';
import { Element } from './element';
import { Fraction } from './fraction';
import { Renderer } from './renderer';
import { Formatter } from './formatter';
import { Music } from './music';
import { Glyph } from './glyph';
import { Stave } from './stave';
import { StaveNote } from './stavenote';
import { StaveModifier } from './stavemodifier';
import { StaveTempo } from './stavetempo';
import { Voice } from './voice';
import { Accidental } from './accidental';
import { Beam } from './beam';
import { StaveTie } from './stavetie';
import { TabStave } from './tabstave';
import { TabNote } from './tabnote';
import { Bend } from './bend';
import { Vibrato } from './vibrato';
import { VibratoBracket } from './vibratobracket';
import { Note } from './note';
import { ModifierContext } from './modifiercontext';
import { MultiMeasureRest } from './multimeasurerest';
import { TickContext } from './tickcontext';
import { Articulation } from './articulation';
import { Annotation } from './annotation';
import { ChordSymbol } from './chordsymbol';
import { Barline } from './stavebarline';
import { NoteHead } from './notehead';
import { StaveConnector } from './staveconnector';
import { ClefNote } from './clefnote';
import { KeySignature } from './keysignature';
import { KeySigNote } from './keysignote';
import { TimeSignature } from './timesignature';
import { TimeSigNote } from './timesignote';
import { Stem } from './stem';
import { TabTie } from './tabtie';
import { Clef } from './clef';
import { Dot } from './dot';
import { Modifier } from './modifier';
import { TabSlide } from './tabslide';
import { Tuplet } from './tuplet';
import { GraceNote } from './gracenote';
import { GraceTabNote } from './gracetabnote';
import { Tuning } from './tuning';
import { KeyManager } from './keymanager';
import { StaveHairpin } from './stavehairpin';
import { BoundingBox } from './boundingbox';
import { Stroke } from './strokes';
import { TextNote } from './textnote';
import { Curve } from './curve';
import { TextDynamics } from './textdynamics';
import { StaveLine } from './staveline';
import { Ornament } from './ornament';
import { PedalMarking } from './pedalmarking';
import { TextBracket } from './textbracket';
import { FretHandFinger } from './frethandfinger';
import { Repetition } from './staverepetition';
import { BarNote } from './barnote';
import { GhostNote } from './ghostnote';
import { NoteSubGroup } from './notesubgroup';
import { GraceNoteGroup } from './gracenotegroup';
import { Tremolo } from './tremolo';
import { StringNumber } from './stringnumber';
import { Crescendo } from './crescendo';
import { Volta } from './stavevolta';
import { System } from './system';
import { Factory } from './factory';
import { Parser } from './parser';
import { EasyScore } from './easyscore';
import { Registry } from './registry';
import { StaveText } from './stavetext';
import { GlyphNote } from './glyphnote';
import { RepeatNote } from './repeatnote';
import { TextFont } from './textfont';
import { PetalumaScriptTextMetrics } from './fonts/petalumascript_textmetrics';
import { RobotoSlabTextMetrics } from './fonts/robotoslab_textmetrics';
import { Font, Fonts } from './font';

Vex.Flow = Flow;
Vex.Flow.Element = Element;
Vex.Flow.Fraction = Fraction;
Vex.Flow.Renderer = Renderer;
Vex.Flow.Formatter = Formatter;
Vex.Flow.Music = Music;
Vex.Flow.Glyph = Glyph;
Vex.Flow.Stave = Stave;
Vex.Flow.StaveNote = StaveNote;
Vex.Flow.StaveModifier = StaveModifier;
Vex.Flow.StaveTempo = StaveTempo;
Vex.Flow.Voice = Voice;
Vex.Flow.Accidental = Accidental;
Vex.Flow.Beam = Beam;
Vex.Flow.StaveTie = StaveTie;
Vex.Flow.TabStave = TabStave;
Vex.Flow.TabNote = TabNote;
Vex.Flow.Bend = Bend;
Vex.Flow.Vibrato = Vibrato;
Vex.Flow.VibratoBracket = VibratoBracket;
Vex.Flow.Note = Note;
Vex.Flow.ModifierContext = ModifierContext;
Vex.Flow.MultiMeasureRest = MultiMeasureRest;
Vex.Flow.TickContext = TickContext;
Vex.Flow.Articulation = Articulation;
Vex.Flow.Annotation = Annotation;
Vex.Flow.ChordSymbol = ChordSymbol;
Vex.Flow.Barline = Barline;
Vex.Flow.NoteHead = NoteHead;
Vex.Flow.StaveConnector = StaveConnector;
Vex.Flow.ClefNote = ClefNote;
Vex.Flow.KeySignature = KeySignature;
Vex.Flow.KeySigNote = KeySigNote;
Vex.Flow.TimeSignature = TimeSignature;
Vex.Flow.TimeSigNote = TimeSigNote;
Vex.Flow.Stem = Stem;
Vex.Flow.TabTie = TabTie;
Vex.Flow.Clef = Clef;
Vex.Flow.Dot = Dot;
Vex.Flow.Modifier = Modifier;
Vex.Flow.TabSlide = TabSlide;
Vex.Flow.Tuplet = Tuplet;
Vex.Flow.GraceNote = GraceNote;
Vex.Flow.GraceTabNote = GraceTabNote;
Vex.Flow.Tuning = Tuning;
Vex.Flow.KeyManager = KeyManager;
Vex.Flow.StaveHairpin = StaveHairpin;
Vex.Flow.BoundingBox = BoundingBox;
Vex.Flow.Stroke = Stroke;
Vex.Flow.TextNote = TextNote;
Vex.Flow.Curve = Curve;
Vex.Flow.TextDynamics = TextDynamics;
Vex.Flow.StaveLine = StaveLine;
Vex.Flow.Ornament = Ornament;
Vex.Flow.PedalMarking = PedalMarking;
Vex.Flow.TextBracket = TextBracket;
Vex.Flow.FretHandFinger = FretHandFinger;
Vex.Flow.Repetition = Repetition;
Vex.Flow.BarNote = BarNote;
Vex.Flow.GhostNote = GhostNote;
Vex.Flow.NoteSubGroup = NoteSubGroup;
Vex.Flow.GraceNoteGroup = GraceNoteGroup;
Vex.Flow.Tremolo = Tremolo;
Vex.Flow.StringNumber = StringNumber;
Vex.Flow.Crescendo = Crescendo;
Vex.Flow.Volta = Volta;
Vex.Flow.System = System;
Vex.Flow.Factory = Factory;
Vex.Flow.Parser = Parser;
Vex.Flow.EasyScore = EasyScore;
Vex.Flow.Registry = Registry;
Vex.Flow.StaveText = StaveText;
Vex.Flow.GlyphNote = GlyphNote;
Vex.Flow.RepeatNote = RepeatNote;
Vex.Flow.Font = Font;
Vex.Flow.Fonts = Fonts;
Vex.Flow.TextFont = TextFont;
Vex.Flow.PetalumaScriptTextMetrics = PetalumaScriptTextMetrics;
Vex.Flow.RobotoSlabTextMetrics = RobotoSlabTextMetrics;

export default Vex;
Loading

0 comments on commit fbfe96c

Please sign in to comment.