test dependency injection

This commit is contained in:
Stewart Allen 2021-12-29 10:37:17 -05:00
commit a1dc0dea06
10 changed files with 98 additions and 46 deletions

View file

@ -3,7 +3,10 @@
"use strict";
(function() {
var AP = {};
gapp.register('add.array');
let AP = {};
/** ******************************************************************
* Array prototype helpers

View file

@ -1,3 +1,11 @@
/** Copyright 2014-2019 Stewart Allen -- All Rights Reserved */
"use strict";
if (!self.ArrayWriter) {
gapp.register('add.class');
}
self.ArrayWriter = class ArrayWriter {
constructor() {
this.pos = 0;

View file

@ -4,6 +4,8 @@
(function() {
gapp.register('add.three');
var MP = THREE.Mesh.prototype,
BP = THREE.BufferGeometry.prototype;

View file

@ -2,6 +2,12 @@
"use strict";
/** node compatibility **/
if (typeof(self) === 'undefined') {
var self = this;
}
(function () {
/** debug and logging **/

View file

@ -117,6 +117,7 @@ document.onreadystatechange = function() {
// finalize modules
gapp.finalize("main.mesh", [
"moto.client", // dep: moto.client
"moto.broker", // dep: moto.broker
"moto.space" // dep: moto.space
]);

View file

@ -4,6 +4,8 @@
(function() {
gapp.finalize("mesh.pool");
gapp.finalize("mesh.pool", [
"moto.worker" // dep: moto.worker
]);
})();

View file

@ -7,6 +7,8 @@
// start worker pool (disabled for now with *0)
moto.client.start(`/code/mesh_pool?${gapp.version}`, moto.client.max() * 0);
gapp.finalize("mesh.work");
gapp.finalize("mesh.work", [
"moto.client" // dep: moto.client
]);
})();

View file

@ -10,6 +10,7 @@
module.exports = terms;
}
// allow license to be required() by app without gapp
if (typeof(self) !== 'undefined' && self.gapp) {
let app = self.gapp;
app.license = terms.LICENSE;

View file

@ -3,7 +3,10 @@
"use strict";
(function() {
gapp.register('moto.space');
gapp.register('moto.space', [
'add.array', // dep: add.array
'moto.orbit' // dep: moto.orbit
]);
let MOTO = self.moto = self.moto || {},
WIN = window,