move src2 -> src, web2 -> web, remove old module system, fix deps

This commit is contained in:
Stewart Allen 2025-07-06 23:44:33 -04:00
commit ce4f5d6e78
488 changed files with 26179 additions and 26609 deletions

View file

@ -1,14 +1,9 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
"use strict";
gapp.register("moto.worker", [], (root, exports) => {
let endpoints = {};
// code is running in the worker / server context
const dispatch = exports({
const dispatch = {
// bind an endpoint name to a function
bind(name, fn) {
endpoints[name] = fn;
@ -95,10 +90,9 @@ const dispatch = exports({
send.error(`no registered endpoint: ${msg.task}`);
}
}
});
};
// attach onmessage hanler
self.onmessage = dispatch.onmessage;
});
export const worker = dispatch;