Skip to content

Commit b3039f0

Browse files
authored
Release 1.8.0 (#2505)
2 parents e84f69b + efb3357 commit b3039f0

909 files changed

Lines changed: 21708 additions & 18275 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- run: npm run build-language-server
4444
- run: npm run build-monaco
4545
id: test
46-
- uses: actions/upload-artifact@v5
46+
- uses: actions/upload-artifact@v6
4747
if: ${{ failure() && steps.test.conclusion == 'failure' }}
4848
with:
4949
name: test-results-web
@@ -69,7 +69,7 @@ jobs:
6969
- run: npm run build-csharp
7070
- run: npm run test-csharp
7171
id: test
72-
- uses: actions/upload-artifact@v5
72+
- uses: actions/upload-artifact@v6
7373
if: ${{ failure() && steps.test.conclusion == 'failure' }}
7474
with:
7575
name: test-results-csharp
@@ -108,7 +108,7 @@ jobs:
108108
- run: npm run build-kotlin
109109
- run: npm run test-kotlin
110110
id: test
111-
- uses: actions/upload-artifact@v5
111+
- uses: actions/upload-artifact@v6
112112
if: ${{ failure() && steps.test.conclusion == 'failure' }}
113113
with:
114114
name: test-results-kotlin

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- run: touch dummy.txt
1616

17-
- uses: actions/cache@v4
17+
- uses: actions/cache@v5
1818
id: cache
1919
with:
2020
path: dummy.txt

package-lock.json

Lines changed: 409 additions & 2211 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coderline/alphatab-monorepo",
3-
"version": "1.7.1",
3+
"version": "1.8.0",
44
"description": "Monorepo for alphaTab and its related packages",
55
"private": true,
66
"type": "module",
@@ -41,7 +41,6 @@
4141
"test-webpack": "npm run test --workspace=packages/webpack",
4242

4343
"build-monaco": "npm run build --workspace=packages/monaco"
44-
4544
},
4645
"devDependencies": {
4746
"concurrently": "^9.2.1"

packages/alphatab/.env

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

packages/alphatab/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coderline/alphatab",
3-
"version": "1.7.1",
3+
"version": "1.8.0",
44
"description": "alphaTab is a music notation and guitar tablature rendering library",
55
"keywords": [
66
"guitar",
@@ -58,23 +58,23 @@
5858
"test-accept-reference": "tsx scripts/accept-new-reference-files.ts"
5959
},
6060
"devDependencies": {
61-
"@biomejs/biome": "^2.2.6",
61+
"@biomejs/biome": "^2.3.11",
6262
"@coderline/alphaskia": "^3.4.135",
6363
"@coderline/alphaskia-linux": "^3.4.135",
6464
"@coderline/alphaskia-windows": "^3.4.135",
6565
"@types/chai": "^5.2.3",
6666
"@types/mocha": "^10.0.10",
67-
"@types/node": "^24.10.0",
67+
"@types/node": "^25.0.6",
6868
"assert": "^2.1.0",
69-
"chai": "^6.2.1",
69+
"chai": "^6.2.2",
7070
"chalk": "^5.6.2",
7171
"jest-snapshot": "^30.2.0",
7272
"mocha": "^11.7.5",
73-
"rimraf": "^6.1.0",
73+
"rimraf": "^6.1.2",
7474
"tslib": "^2.8.1",
75-
"tsx": "^4.20.6",
75+
"tsx": "^4.21.0",
7676
"typescript": "^5.9.3",
77-
"vite": "^7.2.6",
77+
"vite": "^7.3.1",
7878
"vite-plugin-static-copy": "^3.1.4"
7979
},
8080
"files": [

packages/alphatab/scripts/JsonDeclarationEmitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as ts from 'typescript';
77
import createEmitter, { generateFile } from './EmitterBase';
88
import { getTypeWithNullableInfo, type TypeWithNullableInfo } from './TypeSchema';
99

10-
function createDefaultJsonTypeNode(checker: ts.TypeChecker, type: TypeWithNullableInfo, isNullable: boolean) {
10+
function createDefaultJsonTypeNode(checker: ts.TypeChecker, type: TypeWithNullableInfo, isNullable: boolean): ts.TypeNode {
1111
if (isNullable) {
1212
const notNullable = createDefaultJsonTypeNode(checker, type, false);
1313
return ts.factory.createUnionTypeNode([notNullable, ts.factory.createLiteralTypeNode(ts.factory.createNull())]);

packages/alphatab/scripts/Serializer.setProperty.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ function generateSetPropertyBody(serializable: TypeSchema, importer: (name: stri
170170
`${mapValueTypeInfo.typeAsString}.fromJson(v)`,
171171
ts.SyntaxKind.CallExpression
172172
);
173+
174+
if(!mapValueTypeInfo.isOptional && !mapValueTypeInfo.isNullable) {
175+
mapValue = ts.factory.createNonNullExpression(mapValue);
176+
}
173177
} else {
174178
itemSerializer = `${mapValueTypeInfo.typeAsString}Serializer`;
175179
importer(itemSerializer, findSerializerModule(mapValueTypeInfo));
@@ -181,15 +185,17 @@ function generateSetPropertyBody(serializable: TypeSchema, importer: (name: stri
181185
.filter(t => t.tagName.text === 'json_add')
182186
.map(t => t.comment ?? '')[0] as string;
183187

184-
caseStatements.push(
185-
assignField(
186-
ts.factory.createNewExpression(
187-
ts.factory.createIdentifier('Map'),
188-
prop.type.typeArguments!.map(t => t.createTypeNode()),
189-
[]
188+
if(!prop.isReadOnly) {
189+
caseStatements.push(
190+
assignField(
191+
ts.factory.createNewExpression(
192+
ts.factory.createIdentifier('Map'),
193+
prop.type.typeArguments!.map(t => t.createTypeNode()),
194+
[]
195+
)
190196
)
191-
)
192-
);
197+
);
198+
}
193199

194200
caseStatements.push(
195201
ts.factory.createExpressionStatement(

packages/alphatab/scripts/Serializer.toJson.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as ts from 'typescript';
21
import { createNodeFromSource, setMethodBody } from '@coderline/alphatab-transpiler/src/BuilderHelpers';
2+
import * as ts from 'typescript';
33
import { findSerializerModule } from './Serializer.common';
44
import type { TypeSchema } from './TypeSchema';
55

@@ -30,7 +30,7 @@ function generateToJsonBody(serializable: TypeSchema, importer: (name: string, m
3030
const fieldName = prop.name;
3131
const jsonName = prop.jsonNames.filter(n => n !== '')[0];
3232

33-
if (!jsonName || prop.isReadOnly) {
33+
if (!jsonName || prop.isJsonReadOnly) {
3434
continue;
3535
}
3636

@@ -153,6 +153,17 @@ function generateToJsonBody(serializable: TypeSchema, importer: (name: string, m
153153
}`,
154154
ts.SyntaxKind.Block
155155
);
156+
} else if(prop.type.typeArguments![1].isArray && prop.type.typeArguments![1].arrayItemType!.isPrimitiveType) {
157+
serializeBlock = createNodeFromSource<ts.Block>(
158+
`{
159+
const m = new Map<string, unknown>();
160+
o.set(${JSON.stringify(jsonName)}, m);
161+
for(const [k, v] of obj.${fieldName}!) {
162+
m.set(k.toString(), v);
163+
}
164+
}`,
165+
ts.SyntaxKind.Block
166+
);
156167
} else {
157168
const itemSerializer = `${prop.type.typeArguments![1].typeAsString}Serializer`;
158169
importer(itemSerializer, findSerializerModule(prop.type.typeArguments![1]));

packages/alphatab/scripts/TypeSchema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export function buildTypeSchema(program: ts.Program, input: ts.ClassDeclaration)
6262
asRaw,
6363
partialNames: !!jsDoc.find(t => t.tagName.text === 'json_partial_names'),
6464
target: jsDoc.find(t => t.tagName.text === 'target')?.comment as string,
65-
isReadOnly: !!jsDoc.find(t => t.tagName.text === 'json_read_only'),
65+
isJsonReadOnly: isReadonly,
66+
isReadOnly: propertyDeclaration.modifiers!.some(m => m.kind == ts.SyntaxKind.ReadonlyKeyword),
6667
name: (member.name as ts.Identifier).text,
6768
jsDocTags: jsDoc,
6869
type: getTypeWithNullableInfo(
@@ -379,6 +380,7 @@ export interface TypeProperty {
379380
jsonNames: string[];
380381
asRaw: boolean;
381382
target?: string;
383+
isJsonReadOnly: boolean;
382384
isReadOnly: boolean;
383385
}
384386

0 commit comments

Comments
 (0)