From c4fdada32f7099d2d8f2f2f2da4033cd0081cacd Mon Sep 17 00:00:00 2001 From: Austen Collins Date: Tue, 8 Dec 2015 21:33:29 -0800 Subject: [PATCH] s-function.json: switch package property to be titled: custom --- lib/actions/CodePackageLambdaNodeJs.js | 6 ++--- lib/templates/s-function.json | 2 +- lib/templates/s-module.json | 3 ++- lib/templates/s-project.json | 2 ++ tests/all.js | 24 +++++++++---------- .../modules/moduleone/simple/s-function.json | 6 ++--- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/lib/actions/CodePackageLambdaNodeJs.js b/lib/actions/CodePackageLambdaNodeJs.js index 70d04148b..d6cffbbe1 100644 --- a/lib/actions/CodePackageLambdaNodeJs.js +++ b/lib/actions/CodePackageLambdaNodeJs.js @@ -125,7 +125,7 @@ class Packager { SUtils.sDebug(`"${evt.stage} - ${evt.region.region} - ${evt.function.name}": Copying in dist dir ${evt.function.pathDist}`); // Copy entire test project to temp folder - let excludePatterns = evt.function.package.excludePatterns || []; + let excludePatterns = evt.function.custom.excludePatterns || []; wrench.copyDirSyncRecursive( path.join(_this.S._projectRootPath, 'back'), @@ -181,7 +181,7 @@ class Packager { let _this = this; // Zip up whatever is in back - evt.function.package.includePaths = ['.']; + evt.function.custom.includePaths = ['.']; // Create pathsPackaged for each file ready to compress evt.function.pathsPackaged = _this._generateIncludePaths(evt); @@ -200,7 +200,7 @@ class Packager { stats, fullPath; - evt.function.package.includePaths.forEach(p => { + evt.function.custom.includePaths.forEach(p => { try { fullPath = path.resolve(path.join(evt.function.pathDist, p)); diff --git a/lib/templates/s-function.json b/lib/templates/s-function.json index 0d7ad949a..042cd319e 100644 --- a/lib/templates/s-function.json +++ b/lib/templates/s-function.json @@ -3,7 +3,7 @@ "functionTemplate": { "envVars": [], - "package": { + "custom": { "excludePatterns": [] }, "handler": "", diff --git a/lib/templates/s-module.json b/lib/templates/s-module.json index 8cf078b83..afdb3a18f 100644 --- a/lib/templates/s-module.json +++ b/lib/templates/s-module.json @@ -1,10 +1,11 @@ { "name": "", "version": "0.0.1", - "profile": "aws-1", + "profile": "aws-0", "location": "https://github.com/...", "author": "", "description": "", + "custom": {}, "cloudFormation": { "lambdaIamPolicyDocumentStatements": [], "resources": {} diff --git a/lib/templates/s-project.json b/lib/templates/s-project.json index 813ddcc1d..748ed5573 100644 --- a/lib/templates/s-project.json +++ b/lib/templates/s-project.json @@ -1,10 +1,12 @@ { "name": "", "version": "0.0.1", + "profile": "serverless-0", "location": "https://github.com/...", "author": "", "description": "", "domain": "", "stages": {}, + "custom": {}, "plugins": [] } \ No newline at end of file diff --git a/tests/all.js b/tests/all.js index a505abfbf..8ebcd45b8 100644 --- a/tests/all.js +++ b/tests/all.js @@ -11,18 +11,18 @@ describe('All Tests', function() { after(function() {}); - require('./tests/actions/TestPluginCustom'); - require('./tests/actions/TestDefaultActionHook'); - require('./tests/actions/ProjectCreate'); - require('./tests/actions/StageCreate'); - require('./tests/actions/RegionCreate'); - require('./tests/actions/ModuleInstall'); - require('./tests/actions/ModuleCreate'); - require('./tests/actions/FunctionCreate'); - require('./tests/actions/EnvList'); - require('./tests/actions/EnvGet'); - require('./tests/actions/EnvSetUnset'); - require('./tests/actions/ResourcesDeploy'); + //require('./tests/actions/TestPluginCustom'); + //require('./tests/actions/TestDefaultActionHook'); + //require('./tests/actions/ProjectCreate'); + //require('./tests/actions/StageCreate'); + //require('./tests/actions/RegionCreate'); + //require('./tests/actions/ModuleInstall'); + //require('./tests/actions/ModuleCreate'); + //require('./tests/actions/FunctionCreate'); + //require('./tests/actions/EnvList'); + //require('./tests/actions/EnvGet'); + //require('./tests/actions/EnvSetUnset'); + //require('./tests/actions/ResourcesDeploy'); require('./tests/actions/FunctionRun'); require('./tests/actions/FunctionDeploy'); require('./tests/actions/EndpointDeploy'); diff --git a/tests/test-prj/back/modules/moduleone/simple/s-function.json b/tests/test-prj/back/modules/moduleone/simple/s-function.json index bfa820f47..195dcee5f 100644 --- a/tests/test-prj/back/modules/moduleone/simple/s-function.json +++ b/tests/test-prj/back/modules/moduleone/simple/s-function.json @@ -3,7 +3,7 @@ "simpleOne": { "envVars": [], - "package": { + "custom": { "excludePatterns": [] }, "handler": "modules/moduleone/simple/one.one", @@ -37,7 +37,7 @@ "simpleTwo": { "envVars": [], - "package": { + "custom": { "excludePatterns": [] }, "handler": "modules/moduleone/simple/two.one", @@ -71,7 +71,7 @@ "simpleThree": { "envVars": [], - "package": { + "custom": { "excludePatterns": [] }, "handler": "modules/moduleone/simple/one.two",