diff --git a/lib/index2.js b/lib/index2.js index cd310bdef..9c0f08e46 100644 --- a/lib/index2.js +++ b/lib/index2.js @@ -40,22 +40,22 @@ let JAWS = class JAWS { // Create registry for actions, with defaults this.actions = { - ProjectCreate: null, - StageCreate: null, - RegionCreate: null, - ModuleCreate: null, - ModulePostInstall: null, - LambdaPackageNodeJs0_10_32: null, - LambdaUpload: null, - LambdaProvision: null, - ApiGatewayProvision: null, - ResourcesProvision: null, - EnvList: null, - EnvGet: null, - EnvSet: null, - TagResource: null, - LambdaRun: null, - Dash: null, + ProjectCreate: null, + StageCreate: null, + RegionCreate: null, + ModuleCreate: null, + ModulePostInstall: null, + LambdaPackageNodeJs: null, + LambdaUpload: null, + LambdaProvision: null, + ApiGatewayProvision: null, + ResourcesProvision: null, + EnvList: null, + EnvGet: null, + EnvSet: null, + TagResource: null, + LambdaRun: null, + Dash: null, }; // Create registry for hooks @@ -70,8 +70,8 @@ let JAWS = class JAWS { PostModuleCreate: [], PreModulePostInstall: [], PostModulePostInstall: [], - PreLambdaPackageNodeJs0_10_32: [], - PostLambdaPackageNodeJs0_10_32: [], + PreLambdaPackageNodeJs: [], + PostLambdaPackageNodeJs: [], PreLambdaUpload: [], PostLambdaUpload: [], PreLambdaProvision: [], @@ -119,29 +119,37 @@ let JAWS = class JAWS { * Set Action */ - action(action, actionGenerator) { + action(actionName, actionGenerator) { // Check action is valid - if (!this.actions[action]) { + if (!this.actions[actionName]) { } - this.action = actionGenerator; + this.action[actionName] = actionGenerator; } /** * Set Hook */ - hook(hook, hookGenerator, index) { + hook(hookName, hookGenerator, index) { // Check hook is valid - if (!this.hooks[hook]) { + if (!this.hooks[hookName]) { } - index = (!index && index !== 0) ? this.hooks[hook].length : index; - this.hooks[hook].splice(index, 0, hookGenerator); + index = (!index && index !== 0) ? this.hooks[hookName].length : index; + this.hooks[hookName].splice(index, 0, hookGenerator); + } + + /** + * Set Plugin + */ + + plugin(plugin) { + this = plugin(this); } /**