diff --git a/plugins/pilot/lib/canon.js b/plugins/pilot/lib/canon.js index bdb98558..d9fd2b57 100644 --- a/plugins/pilot/lib/canon.js +++ b/plugins/pilot/lib/canon.js @@ -37,12 +37,14 @@ define(function(require, exports, module) { -var console = require('util/console'); -var Trace = require('util/stacktrace').Trace; -var Event = require('events').Event; -var history = require('canon/history'); +var console = require('pilot/console'); +var Trace = require('pilot/stacktrace').Trace; +//var Event = require('events').Event; exports.startup = function(data, reason) { + if (!data.env || !data.env.settings) { + return; + } var settings = data.env.settings; // TODO register these using new registration functionality @@ -89,7 +91,7 @@ exports.Canon.prototype = { } }; -exports.addedRequestOutput = new Event(); +// exports.addedRequestOutput = new Event(); /** * Current requirements are around displaying the command line, and provision @@ -188,7 +190,7 @@ exports.Request = function(options) { this.completed = false; this.error = false; - this.changed = new Event(); +// this.changed = new Event(); }; /** @@ -199,7 +201,7 @@ exports.Request.prototype._beginOutput = function() { this._begunOutput = true; this.outputs = []; - history.addRequestOutput(this); + exports.addRequestOutput(this); }; /** diff --git a/plugins/pilot/lib/index.js b/plugins/pilot/lib/index.js index f4a0327d..ecc1df10 100644 --- a/plugins/pilot/lib/index.js +++ b/plugins/pilot/lib/index.js @@ -35,17 +35,34 @@ * * ***** END LICENSE BLOCK ***** */ -define(function(require, exports, module) { +var deps = [ + "pilot/fixoldbrowsers", + "pilot/types/basic", + "pilot/canon" +]; - exports.startup = function(data, reason) { - require("fixoldbrowsers").startup(data, reason); - require("types/basic").startup(data, reason); - require("canon").startup(data, reason); - }; +var packages = deps.slice(); +packages.unshift("require", "exports", "module"); - exports.shutdown(data, reason) { - require("fixoldbrowsers").shutdown(data, reason); - require("types/basic").shutdown(data, reason); - require("canon").shutdown(data, reason); - }; +define(packages, function(require, exports, module) { + +exports.startup = function(data, reason) { + deps.forEach(function(dep) { + console.log("test startup for " + dep); + var module = require(dep); + if (typeof module.startup === "function") { + module.startup(data, reason); + } + }); +}; +/* +exports.shutdown(data, reason) { + deps.forEach(function(dep) { + var module = require(dep); + if (typeof module.shutdown === "function") { + module.shutdown(data, reason); + } + }); +}; +*/ }); diff --git a/plugins/pilot/lib/types/basic.js b/plugins/pilot/lib/types/basic.js index 86c2460a..b301f039 100644 --- a/plugins/pilot/lib/types/basic.js +++ b/plugins/pilot/lib/types/basic.js @@ -38,16 +38,16 @@ define(function(require, exports, module) { -var types = require("types"); +var types = require("pilot/types"); /** * These are the basic types that we accept. They are vaguely based on the * Jetpack settings system (https://wiki.mozilla.org/Labs/Jetpack/JEP/24) * although clearly more restricted. - * + * *
In addition to these types, Jetpack also accepts range, member, password * that we are thinking of adding. - * + * *
This module probably should not be accessed directly, but instead used * through types.js */