playback improvements, dependancy updates, and updated SDK

This commit is contained in:
2026-11-15 16:19:18 -05:00
parent 97c45f14c2
commit 2c094e254d
5 changed files with 704 additions and 475 deletions

View File

@@ -56,14 +56,52 @@ globalThis.VylaLocal = {
`;
fs.writeFileSync(path.join(tmp, 'entry.js'), entry);
const nodeStubPlugin = {
name: 'node-stub',
setup(build) {
build.onResolve(
{
filter: /^(node:|fs(\/promises)?$|path$|crypto$|https$|http$|events$|os$|stream$|util$|url$|zlib$|net$|tls$|child_process$|worker_threads$|async_hooks$|perf_hooks$|readline$|koffi$|piscina$|node-tls-client$)/,
},
(args) => ({
path: args.path,
namespace: 'node-stub',
})
);
build.onLoad({ filter: /^node-tls-client$/, namespace: 'node-stub' }, () => ({
contents: `
export const ClientIdentifier = {};
export const destroyTLS = async () => {};
export const initTLS = async () => {};
export class Session {
async get() { throw new Error('node-tls-client not supported in webview'); }
async post() { throw new Error('node-tls-client not supported on webview'); }
async close() {}
}
export default { ClientIdentifier, destroyTLS, initTLS, Session };
`,
loader: 'js',
}));
build.onLoad({ filter: /.*/, namespace: 'node-stub' }, () => ({
contents: 'module.exports = {};',
loader: 'js',
}));
},
};
await build({
entryPoints: [path.join(tmp, 'entry.js')],
bundle: true,
format: 'iife',
target: 'chrome70',
platform: 'browser',
plugins: [nodeStubPlugin],
minify: true,
alias: { 'node:crypto': path.join(shim, 'crypto.js') },
alias: {
'node:crypto': path.join(shim, 'crypto.js')
},
inject: [path.join(shim, 'inject.js')],
outfile: path.join(www, 'js/vyla-local.js'),
logLevel: 'info'

1
scripts/empty-shim.js Normal file
View File

@@ -0,0 +1 @@
export default {};