serverless-localstack
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -0,9 +1,10 @@ | ||
{ | ||
"name": "serverless-localstack", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"description": "Connect Serverless to LocalStack!", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"lint-fix": "eslint . --fix", | ||
"lint": "node_modules/eslint/bin/eslint.js .", | ||
"lint-fix": "node_modules/eslint/bin/eslint.js . --fix", | ||
"test": "jasmine --config=spec/support/jasmine.json", | ||
@@ -46,4 +47,5 @@ "test:watch": "jasmine --config=spec/support/jasmine.json", | ||
"sinon": "^6.2.0", | ||
"tempy": "^0.2.1" | ||
"tempy": "^0.2.1", | ||
"eslint": "^5.5.0" | ||
} | ||
} |
@@ -172,2 +172,4 @@ [![Build Status](https://travis-ci.org/localstack/serverless-localstack.svg)](https://travis-ci.org/localstack/serverless-localstack) | ||
* v0.4.7: Fix port mapping for service endpoints | ||
* v0.4.6: Fix port mapping for service endpoints | ||
* v0.4.5: Fix config to activate or deactivate the plugin for certain stages | ||
@@ -174,0 +176,0 @@ * v0.4.4: Add `LAMBDA_MOUNT_CWD` configuration for customizing Lambda mount dir |
@@ -36,4 +36,2 @@ const tempy = require('tempy'); | ||
const pluginsDir = path.join(dir, '.serverless_plugins'); | ||
const myPluginDir = path.join(pluginsDir, packageJson.name); | ||
const rootPluginDir = path.join(__dirname, '../../'); | ||
@@ -40,0 +38,0 @@ fs.mkdirsSync(pluginsDir); |
'use strict'; | ||
const path = require('path'); | ||
const expect = require('chai').expect; | ||
const services = require('../helpers/services'); | ||
@@ -6,0 +4,0 @@ |
'use strict'; | ||
const AWS = require('aws-sdk'); | ||
const example_endpoints = require('../../example/service/localstack_endpoints'); | ||
@@ -4,0 +3,0 @@ const expect = require('chai').expect; |
@@ -43,3 +43,3 @@ 'use strict'; | ||
if (debug) { | ||
console.log.apply(this, arguments); | ||
console.log.apply(this, arguments); // eslint-disable-line no-console | ||
} | ||
@@ -145,11 +145,6 @@ } | ||
describe('#request() bound on AWS provider', ()=>{ | ||
let service; | ||
let credentials; | ||
describe('#request() bound on AWS provider', () => { | ||
beforeEach(()=> { | ||
class FakeService { | ||
constructor(_credentials) { | ||
credentials = _credentials; | ||
} | ||
@@ -175,8 +170,8 @@ foo() { | ||
it('should overwrite the S3 hostname', () => { | ||
let pathToTemplate = 'https://s3.amazonaws.com/path/to/template'; | ||
let request = sinon.stub(awsProvider, 'request'); | ||
const pathToTemplate = 'https://s3.amazonaws.com/path/to/template'; | ||
const request = sinon.stub(awsProvider, 'request'); | ||
instance = new LocalstackPlugin(serverless, defaultPluginState) | ||
simulateBeforeDeployHooks(instance); | ||
awsProvider.request('s3','foo',{ | ||
awsProvider.request('s3', 'foo', { | ||
TemplateURL: pathToTemplate | ||
@@ -190,6 +185,5 @@ }); | ||
it('should not send validateTemplate calls to localstack', () => { | ||
let pathToTemplate = 'https://s3.amazonaws.com/path/to/template'; | ||
let request = sinon.stub(awsProvider, 'request'); | ||
const request = sinon.stub(awsProvider, 'request'); | ||
instance = new LocalstackPlugin(serverless, defaultPluginState) | ||
awsProvider.request('S3','validateTemplate',{}); | ||
awsProvider.request('S3', 'validateTemplate', {}); | ||
@@ -196,0 +190,0 @@ expect(request.called).to.be.false; |
'use strict'; | ||
const AWS = require('aws-sdk'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const util = require('util'); | ||
@@ -40,2 +38,3 @@ // Default stage used by serverless | ||
's3': 4572, | ||
'S3': 4572, | ||
'ses': 4579, | ||
@@ -84,5 +83,4 @@ 'sns': 4575, | ||
this.skipIfMountLambda('AwsDeploy', 'uploadFunctionsAndLayers'); | ||
} | ||
beforeDeploy() { | ||
// reconfigure AWS endpoints based on current stage variables | ||
this.getStageVariable(); | ||
@@ -92,2 +90,6 @@ this.reconfigureAWS(); | ||
beforeDeploy() { | ||
// TODO check if still needed | ||
} | ||
findPlugin(name) { | ||
@@ -156,3 +158,3 @@ return this.serverless.pluginManager.plugins.find(p => p.constructor.name === name); | ||
const host = this.config.host; | ||
let configChanges = {}; | ||
const configChanges = {}; | ||
@@ -162,2 +164,3 @@ // If a host has been configured, override each service | ||
for (const service of Object.keys(this.AWS_SERVICES)) { | ||
const serviceLower = service.toLowerCase(); | ||
const port = this.AWS_SERVICES[service]; | ||
@@ -167,3 +170,7 @@ const url = `${host}:${port}`; | ||
this.debug(`Reconfiguring service ${service} to use ${url}`); | ||
configChanges[service.toLowerCase()] = { endpoint: url }; | ||
configChanges[serviceLower] = { endpoint: url }; | ||
if (serviceLower == 's3') { | ||
configChanges[serviceLower].s3ForcePathStyle = true; | ||
} | ||
} | ||
@@ -176,5 +183,7 @@ } | ||
const url = this.endpoints[service]; | ||
const serviceLower = service.toLowerCase(); | ||
this.debug(`Reconfiguring service ${service} to use ${url}`); | ||
configChanges[service.toLowerCase()] = { endpoint: url }; | ||
configChanges[serviceLower] = configChanges[serviceLower] || {}; | ||
configChanges[serviceLower].endpoint = url; | ||
} | ||
@@ -181,0 +190,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37125
19
872
178
11