@coderline/alphatab-vite 1.7.0-alpha.1617 → 1.7.0-alpha.1626
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/AlphaTabVitePluginOptions.d.ts +30 -0
- package/dist/AlphaTabVitePluginOptions.mjs +36 -0
- package/dist/alphaTab.vite.d.ts +1 -33
- package/dist/alphaTab.vite.mjs +2 -2326
- package/dist/alphaTabVitePlugin.d.ts +5 -0
- package/dist/alphaTabVitePlugin.mjs +53 -0
- package/dist/bridge/asset.mjs +63 -0
- package/dist/bridge/build.mjs +217 -0
- package/dist/bridge/config.mjs +36 -0
- package/dist/bridge/constants.mjs +82 -0
- package/dist/bridge/fsUtils.mjs +56 -0
- package/dist/bridge/index.mjs +43 -0
- package/dist/bridge/optimizer.mjs +148 -0
- package/dist/bridge/plugins.mjs +47 -0
- package/dist/bridge/resolve.mjs +71 -0
- package/dist/bridge/typeUtils.d.ts +3 -0
- package/dist/bridge/typeUtils.mjs +36 -0
- package/dist/bridge/utils.mjs +151 -0
- package/dist/bridge/worker.d.ts +10 -0
- package/dist/bridge/worker.mjs +180 -0
- package/dist/copyAssetsPlugin.d.ts +5 -0
- package/dist/copyAssetsPlugin.mjs +143 -0
- package/dist/importMetaPlugin.d.ts +5 -0
- package/dist/importMetaPlugin.mjs +197 -0
- package/dist/workerPlugin.d.ts +5 -0
- package/dist/workerPlugin.mjs +201 -0
- package/package.json +9 -5
- package/dist/alphaTab.vite.js +0 -2386
- package/dist/alphaTab.vite.min.mjs +0 -36
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Vite Plugin v1.7.0-alpha.1626 (develop, build 1626)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
import { copyAssetsPlugin } from './copyAssetsPlugin.mjs';
|
|
38
|
+
import { importMetaUrlPlugin } from './importMetaPlugin.mjs';
|
|
39
|
+
import { workerPlugin } from './workerPlugin.mjs';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
function alphaTab(options) {
|
|
45
|
+
const plugins = [];
|
|
46
|
+
options ??= {};
|
|
47
|
+
plugins.push(importMetaUrlPlugin(options));
|
|
48
|
+
plugins.push(workerPlugin(options));
|
|
49
|
+
plugins.push(copyAssetsPlugin(options));
|
|
50
|
+
return plugins;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { alphaTab };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Vite Plugin v1.7.0-alpha.1626 (develop, build 1626)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
import * as path from 'node:path';
|
|
38
|
+
import { withTrailingSlash, joinUrlSegments, removeLeadingSlash } from './utils.mjs';
|
|
39
|
+
|
|
40
|
+
// index.ts for more details on contents and license of this file
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
44
|
+
const FS_PREFIX = '/@fs/';
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
async function fileToUrl(id, config) {
|
|
49
|
+
let rtn;
|
|
50
|
+
if (id.startsWith(withTrailingSlash(config.root))) {
|
|
51
|
+
// in project root, infer short public path
|
|
52
|
+
rtn = `/${path.posix.relative(config.root, id)}`;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// outside of project root, use absolute fs path
|
|
56
|
+
// (this is special handled by the serve static middleware
|
|
57
|
+
rtn = path.posix.join(FS_PREFIX, id);
|
|
58
|
+
}
|
|
59
|
+
const base = joinUrlSegments(config.server?.origin ?? '', config.base);
|
|
60
|
+
return joinUrlSegments(base, removeLeadingSlash(rtn));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { FS_PREFIX, fileToUrl };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Vite Plugin v1.7.0-alpha.1626 (develop, build 1626)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
import * as path from 'node:path';
|
|
38
|
+
import { ROLLUP_HOOKS } from './constants.mjs';
|
|
39
|
+
import { getHookHandler } from './plugins.mjs';
|
|
40
|
+
import { joinUrlSegments, partialEncodeURIPath } from './utils.mjs';
|
|
41
|
+
|
|
42
|
+
// index.ts for more details on contents and license of this file
|
|
43
|
+
const needsEscapeRegEx = /[\n\r'\\\u2028\u2029]/;
|
|
44
|
+
const quoteNewlineRegEx = /([\n\r'\u2028\u2029])/g;
|
|
45
|
+
const backSlashRegEx = /\\/g;
|
|
46
|
+
function escapeId(id) {
|
|
47
|
+
if (!needsEscapeRegEx.test(id)) {
|
|
48
|
+
return id;
|
|
49
|
+
}
|
|
50
|
+
return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1');
|
|
51
|
+
}
|
|
52
|
+
const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
|
|
53
|
+
const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`);
|
|
54
|
+
const getFileUrlFromFullPath = (path) => `require('u' + 'rl').pathToFileURL(${path}).href`;
|
|
55
|
+
const getFileUrlFromRelativePath = (path) => getFileUrlFromFullPath(`__dirname + '/${escapeId(path)}'`);
|
|
56
|
+
const relativeUrlMechanisms = {
|
|
57
|
+
amd: relativePath => {
|
|
58
|
+
if (relativePath[0] !== '.') {
|
|
59
|
+
relativePath = `./${relativePath}`;
|
|
60
|
+
}
|
|
61
|
+
return getResolveUrl(`require.toUrl('${escapeId(relativePath)}'), document.baseURI`);
|
|
62
|
+
},
|
|
63
|
+
cjs: relativePath => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath)})`,
|
|
64
|
+
es: relativePath => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`),
|
|
65
|
+
iife: relativePath => getRelativeUrlFromDocument(relativePath),
|
|
66
|
+
// NOTE: make sure rollup generate `module` params
|
|
67
|
+
system: relativePath => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`),
|
|
68
|
+
umd: relativePath => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(relativePath)} : ${getRelativeUrlFromDocument(relativePath, true)})`
|
|
69
|
+
};
|
|
70
|
+
const customRelativeUrlMechanisms = {
|
|
71
|
+
...relativeUrlMechanisms,
|
|
72
|
+
'worker-iife': relativePath => getResolveUrl(`'${escapeId(partialEncodeURIPath(relativePath))}', self.location.href`)
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
function createToImportMetaURLBasedRelativeRuntime(format, isWorker) {
|
|
78
|
+
const formatLong = isWorker && format === 'iife' ? 'worker-iife' : format;
|
|
79
|
+
const toRelativePath = customRelativeUrlMechanisms[formatLong];
|
|
80
|
+
return (filename, importer) => ({
|
|
81
|
+
runtime: toRelativePath(path.posix.relative(path.dirname(importer), filename))
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
function toOutputFilePathInJS(filename, type, hostId, hostType, config, toRelative) {
|
|
88
|
+
const { renderBuiltUrl } = config.experimental;
|
|
89
|
+
let relative = config.base === '' || config.base === './';
|
|
90
|
+
if (renderBuiltUrl) {
|
|
91
|
+
const result = renderBuiltUrl(filename, {
|
|
92
|
+
hostId,
|
|
93
|
+
hostType,
|
|
94
|
+
type,
|
|
95
|
+
ssr: !!config.build.ssr
|
|
96
|
+
});
|
|
97
|
+
if (typeof result === 'object') {
|
|
98
|
+
if (result.runtime) {
|
|
99
|
+
return { runtime: result.runtime };
|
|
100
|
+
}
|
|
101
|
+
if (typeof result.relative === 'boolean') {
|
|
102
|
+
relative = result.relative;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else if (result) {
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (relative && !config.build.ssr) {
|
|
110
|
+
return toRelative(filename, hostId);
|
|
111
|
+
}
|
|
112
|
+
return joinUrlSegments(config.base, filename);
|
|
113
|
+
}
|
|
114
|
+
// https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/build.ts#L1131
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
function injectEnvironmentToHooks(environment, plugin) {
|
|
119
|
+
const { resolveId, load, transform } = plugin;
|
|
120
|
+
const clone = { ...plugin };
|
|
121
|
+
for (const hook of Object.keys(clone)) {
|
|
122
|
+
switch (hook) {
|
|
123
|
+
case 'resolveId':
|
|
124
|
+
clone[hook] = wrapEnvironmentResolveId(environment, resolveId);
|
|
125
|
+
break;
|
|
126
|
+
case 'load':
|
|
127
|
+
clone[hook] = wrapEnvironmentLoad(environment, load);
|
|
128
|
+
break;
|
|
129
|
+
case 'transform':
|
|
130
|
+
clone[hook] = wrapEnvironmentTransform(environment, transform);
|
|
131
|
+
break;
|
|
132
|
+
default:
|
|
133
|
+
if (ROLLUP_HOOKS.includes(hook)) {
|
|
134
|
+
clone[hook] = wrapEnvironmentHook(environment, clone[hook]);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return clone;
|
|
140
|
+
}
|
|
141
|
+
function wrapEnvironmentResolveId(environment, hook) {
|
|
142
|
+
if (!hook) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const fn = getHookHandler(hook);
|
|
146
|
+
const handler = function (id, importer, options) {
|
|
147
|
+
return fn.call(injectEnvironmentInContext(this, environment), id, importer, injectSsrFlag(options, environment));
|
|
148
|
+
};
|
|
149
|
+
if ('handler' in hook) {
|
|
150
|
+
return {
|
|
151
|
+
...hook,
|
|
152
|
+
handler
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return handler;
|
|
156
|
+
}
|
|
157
|
+
function wrapEnvironmentLoad(environment, hook) {
|
|
158
|
+
if (!hook) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const fn = getHookHandler(hook);
|
|
162
|
+
const handler = function (id, ...args) {
|
|
163
|
+
return fn.call(injectEnvironmentInContext(this, environment), id, injectSsrFlag(args[0], environment));
|
|
164
|
+
};
|
|
165
|
+
if ('handler' in hook) {
|
|
166
|
+
return {
|
|
167
|
+
...hook,
|
|
168
|
+
handler
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return handler;
|
|
172
|
+
}
|
|
173
|
+
function wrapEnvironmentTransform(environment, hook) {
|
|
174
|
+
if (!hook) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const fn = getHookHandler(hook);
|
|
178
|
+
const handler = function (code, importer, ...args) {
|
|
179
|
+
return fn.call(injectEnvironmentInContext(this, environment), code, importer, injectSsrFlag(args[0], environment));
|
|
180
|
+
};
|
|
181
|
+
if ('handler' in hook) {
|
|
182
|
+
return {
|
|
183
|
+
...hook,
|
|
184
|
+
handler
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
return handler;
|
|
188
|
+
}
|
|
189
|
+
function wrapEnvironmentHook(environment, hook) {
|
|
190
|
+
if (!hook) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const fn = getHookHandler(hook);
|
|
194
|
+
if (typeof fn !== 'function') {
|
|
195
|
+
return hook;
|
|
196
|
+
}
|
|
197
|
+
const handler = function (...args) {
|
|
198
|
+
return fn.call(injectEnvironmentInContext(this, environment), ...args);
|
|
199
|
+
};
|
|
200
|
+
if ('handler' in hook) {
|
|
201
|
+
return {
|
|
202
|
+
...hook,
|
|
203
|
+
handler
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return handler;
|
|
207
|
+
}
|
|
208
|
+
function injectEnvironmentInContext(context, environment) {
|
|
209
|
+
context.environment ??= environment;
|
|
210
|
+
return context;
|
|
211
|
+
}
|
|
212
|
+
function injectSsrFlag(options, environment) {
|
|
213
|
+
const ssr = environment ? environment.config.consumer === 'server' : true;
|
|
214
|
+
return { ...(options ?? {}), ssr };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, toOutputFilePathInJS };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Vite Plugin v1.7.0-alpha.1626 (develop, build 1626)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Vite Plugin v1.7.0-alpha.1626 (develop, build 1626)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
// index.ts for more details on contents and license of this file
|
|
38
|
+
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L143
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
const METADATA_FILENAME = '_metadata.json';
|
|
43
|
+
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/constants.ts#L63#
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
const ENV_PUBLIC_PATH = '/@vite/env';
|
|
48
|
+
// https://github.com/vitejs/vite/blob/v6.1.1/packages/vite/src/node/constants.ts#L10C1-L38C32
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
const ROLLUP_HOOKS = [
|
|
53
|
+
'options',
|
|
54
|
+
'buildStart',
|
|
55
|
+
'buildEnd',
|
|
56
|
+
'renderStart',
|
|
57
|
+
'renderError',
|
|
58
|
+
'renderChunk',
|
|
59
|
+
'writeBundle',
|
|
60
|
+
'generateBundle',
|
|
61
|
+
'banner',
|
|
62
|
+
'footer',
|
|
63
|
+
'augmentChunkHash',
|
|
64
|
+
'outputOptions',
|
|
65
|
+
'renderDynamicImport',
|
|
66
|
+
'resolveFileUrl',
|
|
67
|
+
'resolveImportMeta',
|
|
68
|
+
'intro',
|
|
69
|
+
'outro',
|
|
70
|
+
'closeBundle',
|
|
71
|
+
'closeWatcher',
|
|
72
|
+
'load',
|
|
73
|
+
'moduleParsed',
|
|
74
|
+
'watchChange',
|
|
75
|
+
'resolveDynamicImport',
|
|
76
|
+
'resolveId',
|
|
77
|
+
'shouldTransformCachedModule',
|
|
78
|
+
'transform',
|
|
79
|
+
'onLog'
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
export { ENV_PUBLIC_PATH, METADATA_FILENAME, ROLLUP_HOOKS };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Vite Plugin v1.7.0-alpha.1626 (develop, build 1626)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
import fs from 'node:fs';
|
|
38
|
+
import { tryStatSync } from './utils.mjs';
|
|
39
|
+
|
|
40
|
+
// index.ts for more details on contents and license of this file
|
|
41
|
+
// https://github.com/vitejs/vite/blob/b7ddfae5f852c2948fab03e94751ce56f5f31ce0/packages/vite/src/node/fsUtils.ts#L388
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
function tryResolveRealFile(file, preserveSymlinks) {
|
|
46
|
+
const fileStat = tryStatSync(file);
|
|
47
|
+
if (fileStat?.isFile()) {
|
|
48
|
+
return file;
|
|
49
|
+
}
|
|
50
|
+
if (fileStat?.isSymbolicLink()) {
|
|
51
|
+
return preserveSymlinks ? file : fs.realpathSync(file);
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { tryResolveRealFile };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* alphaTab Vite Plugin v1.7.0-alpha.1626 (develop, build 1626)
|
|
3
|
+
*
|
|
4
|
+
* Copyright © 2025, Daniel Kuschny and Contributors, All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*
|
|
10
|
+
* This library uses code from Vite (https://github.com/vitejs/vite/), licensed under:
|
|
11
|
+
*
|
|
12
|
+
* MIT License
|
|
13
|
+
* Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
16
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
17
|
+
* in the Software without restriction, including without limitation the rights
|
|
18
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
19
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
20
|
+
* furnished to do so, subject to the following conditions:
|
|
21
|
+
*
|
|
22
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
23
|
+
* copies or substantial portions of the Software.
|
|
24
|
+
*
|
|
25
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
* SOFTWARE.
|
|
32
|
+
*
|
|
33
|
+
* @preserve
|
|
34
|
+
* @license
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export { fileToUrl } from './asset.mjs';
|
|
38
|
+
export { createToImportMetaURLBasedRelativeRuntime, toOutputFilePathInJS } from './build.mjs';
|
|
39
|
+
export { ENV_PUBLIC_PATH } from './constants.mjs';
|
|
40
|
+
export { tryOptimizedDepResolve } from './optimizer.mjs';
|
|
41
|
+
export { tryFsResolve } from './resolve.mjs';
|
|
42
|
+
export { cleanUrl, encodeURIPath, evalValue, injectQuery } from './utils.mjs';
|
|
43
|
+
export { AlphaTabWorkerTypes, WORKER_ASSET_ID, WORKER_FILE_ID, isSameContent, workerCache, workerFileToUrl } from './worker.mjs';
|