Skip to content

Commit d30f7ba

Browse files
authored
Compile alphaTab to ES6 (#512)
1 parent 0466854 commit d30f7ba

File tree

80 files changed

+27
-15
lines changed

Some content is hidden

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

80 files changed

+27
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ bin/
99
*.user
1010
*.tgz
1111
test-results/
12-
debug.log
12+
debug.log
13+
src/generated/VersionInfo.ts

src.compiler/csharp/CSharpAstTransformer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export default class CSharpAstTransformer {
182182
this._context.addTsNodeDiagnostics(
183183
p,
184184
'Unsupported export',
185-
ts.DiagnosticCategory.Error
185+
ts.DiagnosticCategory.Message
186186
);
187187
}
188188
});
@@ -191,7 +191,7 @@ export default class CSharpAstTransformer {
191191
this._context.addTsNodeDiagnostics(
192192
d,
193193
'Unsupported export',
194-
ts.DiagnosticCategory.Error
194+
ts.DiagnosticCategory.Message
195195
);
196196
}
197197
})

src.compiler/typescript/AlphaTabGenerator.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import * as ts from 'typescript';
22
import cloneEmit from './CloneEmitter';
33
import serializerEmit from './SerializerEmitter';
4-
import transpiler from '../TranspilerBase'
4+
import transpiler from '../TranspilerBase';
5+
import * as path from 'path';
6+
import * as fs from 'fs';
57

68
transpiler([{
79
name: 'Clone',
@@ -11,4 +13,16 @@ transpiler([{
1113
emit: serializerEmit
1214
}]);
1315

16+
// Write version file
17+
import { version } from '../../package.json';
18+
const fileHandle = fs.openSync('src/generated/VersionInfo.ts', 'w');
19+
fs.writeSync(fileHandle, '// <auto-generated>\n');
20+
fs.writeSync(fileHandle, '// This code was auto-generated.\n');
21+
fs.writeSync(fileHandle, '// Changes to this file may cause incorrect behavior and will be lost if\n');
22+
fs.writeSync(fileHandle, '// the code is regenerated.\n');
23+
fs.writeSync(fileHandle, '// </auto-generated>\n');
24+
fs.writeSync(fileHandle, 'export class VersionInfo {\n');
25+
fs.writeSync(fileHandle, ` public static readonly version:string = '${version}';\n`);
26+
fs.writeSync(fileHandle, ` public static readonly date:string = '${new Date().toISOString()}';\n`);
27+
fs.writeSync(fileHandle, '}\n');
1428
ts.sys.exit(ts.ExitStatus.Success);

src.csharp/AlphaTab.Windows/WinForms/AlphaTabControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public IEnumerable<Track>? Tracks
5454
/// <remarks>
5555
/// The control has an overall background on which the notation
5656
/// itself is placed in a page-style fashion depending on the chosen layout.
57-
/// The <see cref="AlphaTabControl.BackColor"/> property controls the background
57+
/// The <see cref="Control.BackColor"/> property controls the background
5858
/// of the overall area background while this property controls the background of
5959
/// the part showing the notation.
6060
/// </remarks>

src/alphatab.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ export {
117117
Logger
118118
};
119119

120+
import { VersionInfo } from '@src/generated/VersionInfo';
121+
export const meta = VersionInfo;
122+
120123
import { ScoreImporter } from '@src/importer/ScoreImporter';
121124
import { ScoreLoader } from '@src/importer/ScoreLoader';
122125
import { UnsupportedFormatError } from '@src/importer/UnsupportedFormatError';

src/rendering/layout/ScoreLayout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export abstract class ScoreLayout {
236236

237237
public renderAnnotation(): void {
238238
// attention, you are not allowed to remove change this notice within any version of this library without permission!
239-
let msg: string = 'rendered by alphaTab (https://alphaTab.net)';
239+
let msg: string = 'rendered by alphaTab';
240240
let canvas: ICanvas = this.renderer.canvas!;
241241
let resources: RenderingResources = this.renderer.settings.display.resources;
242242
let size: number = 12 * this.renderer.settings.display.scale;
-709 Bytes
-670 Bytes
-669 Bytes
-664 Bytes

0 commit comments

Comments
 (0)