Skip to content

Commit b5c43c7

Browse files
authored
feat(alphatex): new parser (#2339)
1 parent 6a776e3 commit b5c43c7

File tree

150 files changed

+32129
-6229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+32129
-6229
lines changed

biome.jsonc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
33
"files": {
44
"maxSize": 5242880
55
},
@@ -12,6 +12,13 @@
1212
"lineWidth": 120,
1313
"lineEnding": "lf"
1414
},
15+
"assist": {
16+
"actions": {
17+
"source": {
18+
"organizeImports": "on"
19+
}
20+
}
21+
},
1522
"linter": {
1623
"enabled": true,
1724
"rules": {
@@ -28,7 +35,8 @@
2835
"noDescendingSpecificity": "off"
2936
},
3037
"suspicious": {
31-
"noExplicitAny": "off" // used in areas where we work with dynamic JSON data
38+
"noExplicitAny": "off", // used in areas where we work with dynamic JSON data
39+
"noEmptyInterface": "off" // we use these for marker interfaces
3240
},
3341
"correctness": {
3442
"noUnusedImports": {
@@ -62,4 +70,4 @@
6270
"trailingCommas": "none"
6371
}
6472
}
65-
}
73+
}

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"generate-typescript": "npm run generate-typescript --workspace=packages/alphatab",
2020

2121
"build": "npm run build --workspace=packages/alphatab",
22-
"test": "npm run build --workspace=packages/alphatab",
22+
"test": "npm run test --workspace=packages/alphatab",
2323

2424
"build-web": "npm run build && npm run build-webpack && npm run build-vite",
2525
"test-web": "npm run test && npm run test-webpack && npm run test-vite",

packages/alphatab/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
FORCE_COLOR=1
1+
FORCE_COLOR=1
2+
NODE_OPTIONS=--expose-gc

packages/alphatab/biome.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
33
"root": false,
44
"extends": "//",
55
"files": {

packages/alphatab/src/AlphaTabApiBase.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ import type {
1919
AlphaTabRestEvent,
2020
ControlChangeEvent,
2121
EndOfTrackEvent,
22-
MidiEvent,MidiEventType,
22+
MidiEvent,
23+
MidiEventType,
2324
NoteBendEvent,
2425
NoteOffEvent,
2526
NoteOnEvent,
2627
PitchBendEvent,
2728
ProgramChangeEvent,
2829
TempoChangeEvent,
29-
TimeSignatureEvent
30+
TimeSignatureEvent
3031
} from '@src/midi/MidiEvent';
3132
import { MidiFile } from '@src/midi/MidiFile';
3233
import { MidiFileGenerator } from '@src/midi/MidiFileGenerator';
@@ -772,7 +773,7 @@ export class AlphaTabApiBase<TSettings> {
772773
*/
773774
public tex(tex: string, tracks?: number[]): void {
774775
try {
775-
const parser: AlphaTexImporter = new AlphaTexImporter();
776+
const parser = new AlphaTexImporter();
776777
parser.logErrors = true;
777778
parser.initFromString(tex, this.settings);
778779
const score: Score = parser.readScore();

packages/alphatab/src/AlphaTabError.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ export class AlphaTabError extends Error {
1616
public constructor(type: AlphaTabErrorType, message: string | null = '', inner?: Error) {
1717
super(message ?? '', { cause: inner });
1818
this.type = type;
19-
Object.setPrototypeOf(this, AlphaTabError.prototype);
2019
}
2120
}

packages/alphatab/src/FileLoadError.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ export class FileLoadError extends AlphaTabError {
1010
public constructor(message: string, xhr: XMLHttpRequest) {
1111
super(AlphaTabErrorType.General, message);
1212
this.xhr = xhr;
13-
Object.setPrototypeOf(this, FileLoadError.prototype);
1413
}
1514
}

packages/alphatab/src/FormatError.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ import { AlphaTabError, AlphaTabErrorType } from '@src/AlphaTabError';
77
export class FormatError extends AlphaTabError {
88
public constructor(message: string) {
99
super(AlphaTabErrorType.Format, message);
10-
Object.setPrototypeOf(this, FormatError.prototype);
1110
}
1211
}

0 commit comments

Comments
 (0)