Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into obfuscate
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRogersDAZN committed Feb 14, 2019
2 parents 5d93ced + 9ff876c commit 9397122
Show file tree
Hide file tree
Showing 60 changed files with 9,132 additions and 55,143 deletions.
22 changes: 22 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pipeline:
npm-auth:
image: robertstettner/drone-npm-auth
secrets: [ npm_token ]
when:
event: [ push, deployment ]
test:
image: node:carbon-jessie
when:
event: push
commands:
- npm i
- npm run install
- npm test
publish:
image: node:carbon-jessie
secrets: [ github_token ]
when:
event: push
branch: master
commands:
- npm run new-version
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
coverage
docs
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "standard",
"env": {
"jest": true
}
}
2 changes: 1 addition & 1 deletion example/functions/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const wrap = require('@perform/lambda-powertools-pattern-basic')
module.exports.handler = wrap(async ({ x, y }, context) => {
Log.debug(`adding ${x} and ${y}`)
return x + y
})
})
9 changes: 4 additions & 5 deletions example/functions/api-a.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports.handler = apiGateway(async (event, context) => {
const host = event.headers.Host

Log.debug(`the current host is: ${host}`)

const userId = uuid()
// this is how you add new correlation IDs
CorrelationIds.set('user-id', userId)
Expand Down Expand Up @@ -44,8 +43,8 @@ module.exports.handler = apiGateway(async (event, context) => {
Log.error('failed to put record to Kinesis', { putRecordReq }, err)
}

return {
statusCode: 200,
body: JSON.stringify({ message: 'all done' })
return {
statusCode: 200,
body: JSON.stringify({ message: 'all done' })
}
})
})
2 changes: 1 addition & 1 deletion example/functions/api-b.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ module.exports.handler = apiGateway(async (event, context) => {
Log.debug(`the current host is: ${host}`)

return { statusCode: 202 }
})
})
2 changes: 1 addition & 1 deletion example/functions/double.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const wrap = require('@perform/lambda-powertools-pattern-basic')
module.exports.handler = wrap(async ({ z }, context) => {
Log.debug(`doubling ${z}`)
return z * 2
})
})
2 changes: 1 addition & 1 deletion example/functions/kinesis.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module.exports.handler = kinesisProcessor(async (event, context) => {

evt.unscope() // and you have to unscope at the end...
}
})
})
4 changes: 2 additions & 2 deletions example/functions/sns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Log = require('@perform/lambda-powertools-logger')
const Lambda = require('@perform/lambda-powertools-lambda-client')
const SFN = require('@perform/lambda-powertools-step-functions-client')
const SFN = require('@perform/lambda-powertools-step-functions-client')
const CorrelationIds = require('@perform/lambda-powertools-correlation-ids')
const snsProcessor = require('@perform/lambda-powertools-pattern-basic')

Expand Down Expand Up @@ -28,4 +28,4 @@ module.exports.handler = snsProcessor(async (event, context) => {
await SFN.startExecution(startReq).promise()

Log.debug('my job is done...')
})
})
2 changes: 1 addition & 1 deletion example/functions/stand-alone.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ const wrap = require('@perform/lambda-powertools-pattern-basic')
module.exports.handler = wrap(async (event, context) => {
Log.debug('finding the answer to life, the universe and everything...')
return { answer: 42 }
})
})
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
collectCoverage: true,
testEnvironment: 'node'
}
7 changes: 6 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"packages": [
"packages/*"
],
"version": "0.10.0"
"version": "0.10.0",
"command": {
"version": {
"allowBranch": "master"
}
}
}
Loading

0 comments on commit 9397122

Please sign in to comment.