@coderline/alphatab 1.4.0-alpha.1313 → 1.4.0-alpha.1322

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/alphaTab.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.4.0-alpha.1313 (develop, build 1313)
2
+ * alphaTab v1.4.0-alpha.1322 (develop, build 1322)
3
3
  *
4
4
  * Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.4.0-alpha.1313 (develop, build 1313)
2
+ * alphaTab v1.4.0-alpha.1322 (develop, build 1322)
3
3
  *
4
4
  * Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -1503,6 +1503,49 @@ async function fileToUrl(id, config) {
1503
1503
  return joinUrlSegments(base, removeLeadingSlash(rtn));
1504
1504
  }
1505
1505
 
1506
+ /**@target web */
1507
+ // index.ts for more details on contents and license of this file
1508
+ // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L143
1509
+ const METADATA_FILENAME = '_metadata.json';
1510
+ // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L63
1511
+ const ENV_PUBLIC_PATH = `/@vite/env`;
1512
+ // https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/constants.ts#L10C1-L38C32
1513
+ const ROLLUP_HOOKS = [
1514
+ 'options',
1515
+ 'buildStart',
1516
+ 'buildEnd',
1517
+ 'renderStart',
1518
+ 'renderError',
1519
+ 'renderChunk',
1520
+ 'writeBundle',
1521
+ 'generateBundle',
1522
+ 'banner',
1523
+ 'footer',
1524
+ 'augmentChunkHash',
1525
+ 'outputOptions',
1526
+ 'renderDynamicImport',
1527
+ 'resolveFileUrl',
1528
+ 'resolveImportMeta',
1529
+ 'intro',
1530
+ 'outro',
1531
+ 'closeBundle',
1532
+ 'closeWatcher',
1533
+ 'load',
1534
+ 'moduleParsed',
1535
+ 'watchChange',
1536
+ 'resolveDynamicImport',
1537
+ 'resolveId',
1538
+ 'shouldTransformCachedModule',
1539
+ 'transform',
1540
+ 'onLog',
1541
+ ];
1542
+
1543
+ /**@target web */
1544
+ // https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/plugins/index.ts#L161
1545
+ function getHookHandler(hook) {
1546
+ return (typeof hook === 'object' ? hook.handler : hook);
1547
+ }
1548
+
1506
1549
  /**@target web */
1507
1550
  const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/;
1508
1551
  const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g;
@@ -1567,13 +1610,108 @@ function toOutputFilePathInJS(filename, type, hostId, hostType, config, toRelati
1567
1610
  }
1568
1611
  return joinUrlSegments(config.base, filename);
1569
1612
  }
1570
-
1571
- /**@target web */
1572
- // index.ts for more details on contents and license of this file
1573
- // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L143
1574
- const METADATA_FILENAME = '_metadata.json';
1575
- // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L63
1576
- const ENV_PUBLIC_PATH = `/@vite/env`;
1613
+ // https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/build.ts#L1131
1614
+ function injectEnvironmentToHooks(environment, plugin) {
1615
+ const { resolveId, load, transform } = plugin;
1616
+ const clone = { ...plugin };
1617
+ for (const hook of Object.keys(clone)) {
1618
+ switch (hook) {
1619
+ case 'resolveId':
1620
+ clone[hook] = wrapEnvironmentResolveId(environment, resolveId);
1621
+ break;
1622
+ case 'load':
1623
+ clone[hook] = wrapEnvironmentLoad(environment, load);
1624
+ break;
1625
+ case 'transform':
1626
+ clone[hook] = wrapEnvironmentTransform(environment, transform);
1627
+ break;
1628
+ default:
1629
+ if (ROLLUP_HOOKS.includes(hook)) {
1630
+ clone[hook] = wrapEnvironmentHook(environment, clone[hook]);
1631
+ }
1632
+ break;
1633
+ }
1634
+ }
1635
+ return clone;
1636
+ }
1637
+ function wrapEnvironmentResolveId(environment, hook) {
1638
+ if (!hook)
1639
+ return;
1640
+ const fn = getHookHandler(hook);
1641
+ const handler = function (id, importer, options) {
1642
+ return fn.call(injectEnvironmentInContext(this, environment), id, importer, injectSsrFlag(options, environment));
1643
+ };
1644
+ if ('handler' in hook) {
1645
+ return {
1646
+ ...hook,
1647
+ handler
1648
+ };
1649
+ }
1650
+ else {
1651
+ return handler;
1652
+ }
1653
+ }
1654
+ function wrapEnvironmentLoad(environment, hook) {
1655
+ if (!hook)
1656
+ return;
1657
+ const fn = getHookHandler(hook);
1658
+ const handler = function (id, ...args) {
1659
+ return fn.call(injectEnvironmentInContext(this, environment), id, injectSsrFlag(args[0], environment));
1660
+ };
1661
+ if ('handler' in hook) {
1662
+ return {
1663
+ ...hook,
1664
+ handler
1665
+ };
1666
+ }
1667
+ else {
1668
+ return handler;
1669
+ }
1670
+ }
1671
+ function wrapEnvironmentTransform(environment, hook) {
1672
+ if (!hook)
1673
+ return;
1674
+ const fn = getHookHandler(hook);
1675
+ const handler = function (code, importer, ...args) {
1676
+ return fn.call(injectEnvironmentInContext(this, environment), code, importer, injectSsrFlag(args[0], environment));
1677
+ };
1678
+ if ('handler' in hook) {
1679
+ return {
1680
+ ...hook,
1681
+ handler
1682
+ };
1683
+ }
1684
+ else {
1685
+ return handler;
1686
+ }
1687
+ }
1688
+ function wrapEnvironmentHook(environment, hook) {
1689
+ if (!hook)
1690
+ return;
1691
+ const fn = getHookHandler(hook);
1692
+ if (typeof fn !== 'function')
1693
+ return hook;
1694
+ const handler = function (...args) {
1695
+ return fn.call(injectEnvironmentInContext(this, environment), ...args);
1696
+ };
1697
+ if ('handler' in hook) {
1698
+ return {
1699
+ ...hook,
1700
+ handler
1701
+ };
1702
+ }
1703
+ else {
1704
+ return handler;
1705
+ }
1706
+ }
1707
+ function injectEnvironmentInContext(context, environment) {
1708
+ context.environment ?? (context.environment = environment);
1709
+ return context;
1710
+ }
1711
+ function injectSsrFlag(options, environment) {
1712
+ const ssr = environment ? environment.config.consumer === 'server' : true;
1713
+ return { ...(options ?? {}), ssr };
1714
+ }
1577
1715
 
1578
1716
  /**@target web */
1579
1717
  // index.ts for more details on contents and license of this file
@@ -1652,6 +1790,8 @@ function createDepsOptimizer(config) {
1652
1790
  throw new Error('not implemented');
1653
1791
  };
1654
1792
  const depsOptimizer = {
1793
+ async init() {
1794
+ },
1655
1795
  metadata,
1656
1796
  registerMissingImport: notImplemented,
1657
1797
  run: notImplemented,
@@ -1759,10 +1899,13 @@ async function bundleWorkerEntry(config, id) {
1759
1899
  // bundle the file as entry to support imports
1760
1900
  const { rollup } = await import('rollup');
1761
1901
  const { plugins, rollupOptions, format } = config.worker;
1902
+ const workerConfig = await plugins(newBundleChain);
1903
+ const workerEnvironment = new vite.BuildEnvironment('client', workerConfig); // TODO: should this be 'worker'?
1904
+ await workerEnvironment.init();
1762
1905
  const bundle = await rollup({
1763
1906
  ...rollupOptions,
1764
1907
  input,
1765
- plugins: await plugins(newBundleChain),
1908
+ plugins: workerEnvironment.plugins.map(p => injectEnvironmentToHooks(workerEnvironment, p)),
1766
1909
  preserveEntrySignatures: false
1767
1910
  });
1768
1911
  let chunk;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.4.0-alpha.1313 (develop, build 1313)
2
+ * alphaTab v1.4.0-alpha.1322 (develop, build 1322)
3
3
  *
4
4
  * Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -50,7 +50,7 @@ import * as path from 'path';
50
50
  import path__default from 'path';
51
51
  import * as fs from 'fs';
52
52
  import { createHash } from 'node:crypto';
53
- import { normalizePath } from 'vite';
53
+ import { normalizePath, BuildEnvironment } from 'vite';
54
54
 
55
55
  const comma = ','.charCodeAt(0);
56
56
  const semicolon = ';'.charCodeAt(0);
@@ -1482,6 +1482,49 @@ async function fileToUrl(id, config) {
1482
1482
  return joinUrlSegments(base, removeLeadingSlash(rtn));
1483
1483
  }
1484
1484
 
1485
+ /**@target web */
1486
+ // index.ts for more details on contents and license of this file
1487
+ // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L143
1488
+ const METADATA_FILENAME = '_metadata.json';
1489
+ // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L63
1490
+ const ENV_PUBLIC_PATH = `/@vite/env`;
1491
+ // https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/constants.ts#L10C1-L38C32
1492
+ const ROLLUP_HOOKS = [
1493
+ 'options',
1494
+ 'buildStart',
1495
+ 'buildEnd',
1496
+ 'renderStart',
1497
+ 'renderError',
1498
+ 'renderChunk',
1499
+ 'writeBundle',
1500
+ 'generateBundle',
1501
+ 'banner',
1502
+ 'footer',
1503
+ 'augmentChunkHash',
1504
+ 'outputOptions',
1505
+ 'renderDynamicImport',
1506
+ 'resolveFileUrl',
1507
+ 'resolveImportMeta',
1508
+ 'intro',
1509
+ 'outro',
1510
+ 'closeBundle',
1511
+ 'closeWatcher',
1512
+ 'load',
1513
+ 'moduleParsed',
1514
+ 'watchChange',
1515
+ 'resolveDynamicImport',
1516
+ 'resolveId',
1517
+ 'shouldTransformCachedModule',
1518
+ 'transform',
1519
+ 'onLog',
1520
+ ];
1521
+
1522
+ /**@target web */
1523
+ // https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/plugins/index.ts#L161
1524
+ function getHookHandler(hook) {
1525
+ return (typeof hook === 'object' ? hook.handler : hook);
1526
+ }
1527
+
1485
1528
  /**@target web */
1486
1529
  const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/;
1487
1530
  const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g;
@@ -1546,13 +1589,108 @@ function toOutputFilePathInJS(filename, type, hostId, hostType, config, toRelati
1546
1589
  }
1547
1590
  return joinUrlSegments(config.base, filename);
1548
1591
  }
1549
-
1550
- /**@target web */
1551
- // index.ts for more details on contents and license of this file
1552
- // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L143
1553
- const METADATA_FILENAME = '_metadata.json';
1554
- // https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L63
1555
- const ENV_PUBLIC_PATH = `/@vite/env`;
1592
+ // https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/build.ts#L1131
1593
+ function injectEnvironmentToHooks(environment, plugin) {
1594
+ const { resolveId, load, transform } = plugin;
1595
+ const clone = { ...plugin };
1596
+ for (const hook of Object.keys(clone)) {
1597
+ switch (hook) {
1598
+ case 'resolveId':
1599
+ clone[hook] = wrapEnvironmentResolveId(environment, resolveId);
1600
+ break;
1601
+ case 'load':
1602
+ clone[hook] = wrapEnvironmentLoad(environment, load);
1603
+ break;
1604
+ case 'transform':
1605
+ clone[hook] = wrapEnvironmentTransform(environment, transform);
1606
+ break;
1607
+ default:
1608
+ if (ROLLUP_HOOKS.includes(hook)) {
1609
+ clone[hook] = wrapEnvironmentHook(environment, clone[hook]);
1610
+ }
1611
+ break;
1612
+ }
1613
+ }
1614
+ return clone;
1615
+ }
1616
+ function wrapEnvironmentResolveId(environment, hook) {
1617
+ if (!hook)
1618
+ return;
1619
+ const fn = getHookHandler(hook);
1620
+ const handler = function (id, importer, options) {
1621
+ return fn.call(injectEnvironmentInContext(this, environment), id, importer, injectSsrFlag(options, environment));
1622
+ };
1623
+ if ('handler' in hook) {
1624
+ return {
1625
+ ...hook,
1626
+ handler
1627
+ };
1628
+ }
1629
+ else {
1630
+ return handler;
1631
+ }
1632
+ }
1633
+ function wrapEnvironmentLoad(environment, hook) {
1634
+ if (!hook)
1635
+ return;
1636
+ const fn = getHookHandler(hook);
1637
+ const handler = function (id, ...args) {
1638
+ return fn.call(injectEnvironmentInContext(this, environment), id, injectSsrFlag(args[0], environment));
1639
+ };
1640
+ if ('handler' in hook) {
1641
+ return {
1642
+ ...hook,
1643
+ handler
1644
+ };
1645
+ }
1646
+ else {
1647
+ return handler;
1648
+ }
1649
+ }
1650
+ function wrapEnvironmentTransform(environment, hook) {
1651
+ if (!hook)
1652
+ return;
1653
+ const fn = getHookHandler(hook);
1654
+ const handler = function (code, importer, ...args) {
1655
+ return fn.call(injectEnvironmentInContext(this, environment), code, importer, injectSsrFlag(args[0], environment));
1656
+ };
1657
+ if ('handler' in hook) {
1658
+ return {
1659
+ ...hook,
1660
+ handler
1661
+ };
1662
+ }
1663
+ else {
1664
+ return handler;
1665
+ }
1666
+ }
1667
+ function wrapEnvironmentHook(environment, hook) {
1668
+ if (!hook)
1669
+ return;
1670
+ const fn = getHookHandler(hook);
1671
+ if (typeof fn !== 'function')
1672
+ return hook;
1673
+ const handler = function (...args) {
1674
+ return fn.call(injectEnvironmentInContext(this, environment), ...args);
1675
+ };
1676
+ if ('handler' in hook) {
1677
+ return {
1678
+ ...hook,
1679
+ handler
1680
+ };
1681
+ }
1682
+ else {
1683
+ return handler;
1684
+ }
1685
+ }
1686
+ function injectEnvironmentInContext(context, environment) {
1687
+ context.environment ?? (context.environment = environment);
1688
+ return context;
1689
+ }
1690
+ function injectSsrFlag(options, environment) {
1691
+ const ssr = environment ? environment.config.consumer === 'server' : true;
1692
+ return { ...(options ?? {}), ssr };
1693
+ }
1556
1694
 
1557
1695
  /**@target web */
1558
1696
  // index.ts for more details on contents and license of this file
@@ -1631,6 +1769,8 @@ function createDepsOptimizer(config) {
1631
1769
  throw new Error('not implemented');
1632
1770
  };
1633
1771
  const depsOptimizer = {
1772
+ async init() {
1773
+ },
1634
1774
  metadata,
1635
1775
  registerMissingImport: notImplemented,
1636
1776
  run: notImplemented,
@@ -1738,10 +1878,13 @@ async function bundleWorkerEntry(config, id) {
1738
1878
  // bundle the file as entry to support imports
1739
1879
  const { rollup } = await import('rollup');
1740
1880
  const { plugins, rollupOptions, format } = config.worker;
1881
+ const workerConfig = await plugins(newBundleChain);
1882
+ const workerEnvironment = new BuildEnvironment('client', workerConfig); // TODO: should this be 'worker'?
1883
+ await workerEnvironment.init();
1741
1884
  const bundle = await rollup({
1742
1885
  ...rollupOptions,
1743
1886
  input,
1744
- plugins: await plugins(newBundleChain),
1887
+ plugins: workerEnvironment.plugins.map(p => injectEnvironmentToHooks(workerEnvironment, p)),
1745
1888
  preserveEntrySignatures: false
1746
1889
  });
1747
1890
  let chunk;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.4.0-alpha.1313 (develop, build 1313)
2
+ * alphaTab v1.4.0-alpha.1322 (develop, build 1322)
3
3
  *
4
4
  * Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.4.0-alpha.1313 (develop, build 1313)
2
+ * alphaTab v1.4.0-alpha.1322 (develop, build 1322)
3
3
  *
4
4
  * Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.4.0-alpha.1313 (develop, build 1313)
2
+ * alphaTab v1.4.0-alpha.1322 (develop, build 1322)
3
3
  *
4
4
  * Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * alphaTab v1.4.0-alpha.1313 (develop, build 1313)
2
+ * alphaTab v1.4.0-alpha.1322 (develop, build 1322)
3
3
  *
4
4
  * Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coderline/alphatab",
3
- "version": "1.4.0-alpha.1313",
3
+ "version": "1.4.0-alpha.1322",
4
4
  "description": "alphaTab is a music notation and guitar tablature rendering library",
5
5
  "keywords": [
6
6
  "guitar",
@@ -20,6 +20,7 @@
20
20
  "type": "git",
21
21
  "url": "git+https://github.com/coderline/alphaTab.git"
22
22
  },
23
+ "type": "module",
23
24
  "main": "dist/alphaTab.js",
24
25
  "module": "dist/alphaTab.mjs",
25
26
  "typings": "dist/alphaTab.d.ts",
@@ -63,44 +64,45 @@
63
64
  "devDependencies": {
64
65
  "@coderline/alphaskia": "^2.3.120",
65
66
  "@coderline/alphaskia-windows": "^2.3.120",
66
- "@fontsource/roboto": "^5.1.0",
67
- "@fortawesome/fontawesome-free": "^6.7.1",
67
+ "@fontsource/roboto": "^5.1.1",
68
+ "@fortawesome/fontawesome-free": "^6.7.2",
68
69
  "@popperjs/core": "^2.11.8",
69
- "@rollup/plugin-commonjs": "^28.0.0",
70
+ "@rollup/plugin-commonjs": "^28.0.2",
70
71
  "@rollup/plugin-node-resolve": "^16.0.0",
71
- "@rollup/plugin-replace": "^6.0.1",
72
+ "@rollup/plugin-replace": "^6.0.2",
72
73
  "@rollup/plugin-terser": "^0.4.4",
73
- "@rollup/plugin-typescript": "^12.1.0",
74
- "@types/chai": "^5.0.0",
74
+ "@rollup/plugin-typescript": "^12.1.2",
75
+ "@types/chai": "^5.0.1",
75
76
  "@types/cors": "^2.8.17",
76
- "@types/mocha": "^10.0.9",
77
- "@typescript-eslint/eslint-plugin": "^8.8.1",
78
- "@typescript-eslint/parser": "^8.8.1",
79
- "ace-builds": "^1.36.5",
77
+ "@types/mocha": "^10.0.10",
78
+ "@typescript-eslint/eslint-plugin": "^8.24.1",
79
+ "@typescript-eslint/parser": "^8.24.1",
80
+ "ace-builds": "^1.38.0",
80
81
  "assert": "^2.1.0",
81
82
  "bootstrap": "^5.3.3",
82
- "chai": "^5.1.1",
83
- "concurrently": "^9.0.1",
83
+ "chai": "^5.2.0",
84
+ "concurrently": "^9.1.2",
84
85
  "cors": "^2.8.5",
85
- "eslint": "^9.12.0",
86
- "express": "^4.21.1",
87
- "fs-extra": "^11.2.0",
86
+ "eslint": "^9.20.1",
87
+ "express": "^4.21.2",
88
+ "fs-extra": "^11.3.0",
88
89
  "handlebars": "^4.7.8",
89
- "html-webpack-plugin": "^5.6.0",
90
- "mocha": "^11.0.1",
90
+ "html-webpack-plugin": "^5.6.3",
91
+ "mocha": "^11.1.0",
91
92
  "multer": "^1.4.5-lts.1",
92
93
  "opener": "^1.5.2",
94
+ "prettier": "^3.5.2",
93
95
  "rimraf": "^6.0.1",
94
- "rollup": "^4.24.0",
96
+ "rollup": "^4.34.8",
95
97
  "rollup-plugin-copy": "^3.5.0",
96
98
  "rollup-plugin-dts": "^6.1.1",
97
- "rollup-plugin-license": "^3.5.3",
98
- "terser": "^5.34.1",
99
- "tslib": "^2.7.0",
100
- "tsx": "^4.19.1",
101
- "typescript": "^5.7.2",
102
- "vite": "^5.4.8",
103
- "webpack": "^5.95.0",
99
+ "rollup-plugin-license": "^3.6.0",
100
+ "terser": "^5.39.0",
101
+ "tslib": "^2.8.1",
102
+ "tsx": "^4.19.3",
103
+ "typescript": "^5.7.3",
104
+ "vite": "^6.1.1",
105
+ "webpack": "^5.98.0",
104
106
  "webpack-cli": "^6.0.1"
105
107
  },
106
108
  "files": [
@@ -116,7 +118,7 @@
116
118
  ],
117
119
  "dependencies": {
118
120
  "@types/express": "^5.0.0",
119
- "@types/node": "^22.7.5",
121
+ "@types/node": "^22.13.4",
120
122
  "@types/opener": "^1.4.3"
121
123
  }
122
124
  }