Created
March 27, 2019 12:43
-
-
Save dvddpl/f31ca1ab1c3635eaef4fbfbcfe5d9489 to your computer and use it in GitHub Desktop.
Package.json and sls.yaml with setup for conventional commits linting tests and serverless deploy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "my-project", | |
| "private": true, | |
| "version": "0.9.0", | |
| "description": "what my project does", | |
| "main": "index.js", | |
| "scripts": { | |
| "hunt.only": "dot-only-hunter tests", | |
| "deploy:dev": "sls deploy -s dev -v", | |
| "deploy:production": "sls deploy -v -s production", | |
| "deploy:staging": "sls deploy -v -s staging", | |
| "xo-fix": "xo --fix", | |
| "test:dev": "ava -w", | |
| "test": "xo && nyc ava", | |
| "test:integration": "nyc ava tests-integration/**/*.* -- $STAGE", | |
| "test:debug-file": "node --inspect-brk node_modules/ava/profile.js ", | |
| "start:offline": "sls offline -P 3001", | |
| "start:offline:chrome-debug": "node --inspect-brk `which serverless` offline start --port 3001", | |
| "invoke:chrome-debug": "node --inspect-brk `which serverless` invoke local", | |
| "format": "xo --fix", | |
| "release": "standard-version" | |
| }, | |
| "repository": { | |
| "type": "git", | |
| "url": "git@my-gitrepo.git" | |
| }, | |
| "keywords": [ | |
| "sls", | |
| "lambda" | |
| ], | |
| "author": "myname <myname@myemail.com>", | |
| "license": "UNLICENSED", | |
| "dependencies": { | |
| }, | |
| "devDependencies": { | |
| "@commitlint/cli": "^7.5.2", | |
| "@commitlint/config-conventional": "^7.5.0", | |
| "ava": "^1.4.1", | |
| "aws-sdk": "^2.429.0", | |
| "dot-only-hunter": "^1.0.3", | |
| "dotenv": "^7.0.0", | |
| "husky": "^1.3.1", | |
| "nyc": "^13.3.0", | |
| "serverless-offline": "^4.9.2", | |
| "serverless-plugin-aws-alerts": "^1.2.4", | |
| "standard-version": "^5.0.2", | |
| "xo": "^0.24.0" | |
| }, | |
| "xo": { | |
| "semicolon": false, | |
| "space": 4, | |
| "prettier": true, | |
| "env": [ | |
| "node" | |
| ], | |
| "rules": { | |
| "capitalized-comments": 0, | |
| "ava/no-ignored-test-files": 0, | |
| "ava/no-todo-test": 0, | |
| "ava/no-skip-test": 0, | |
| "camelcase": [ | |
| "error", | |
| { | |
| "properties": "never", | |
| "ignoreDestructuring": true | |
| } | |
| ] | |
| } | |
| }, | |
| "husky": { | |
| "hooks": { | |
| "pre-commit": "npm test && npm run hunt.only", | |
| "pre-push": "npm test", | |
| "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | |
| } | |
| }, | |
| "commitlint": { | |
| "extends": [ | |
| "@commitlint/config-conventional" | |
| ] | |
| }, | |
| "ava": { | |
| "files": [ | |
| "tests/", | |
| "!tests-integration/**/*.*" | |
| ] | |
| }, | |
| "standard-version": { | |
| "skip": { | |
| "commit": true, | |
| "tag": true | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| service: my-sls-service-name | |
| plugins: | |
| - serverless-offline | |
| - serverless-plugin-aws-alerts | |
| package: | |
| exclude: | |
| - config/** | |
| - envs/** | |
| - support/** | |
| - tests/** | |
| - tests-integration/** | |
| - node_modules/.cache/** | |
| - .idea/** | |
| - .nyc_output/** | |
| - scripts/** | |
| provider: | |
| name: aws | |
| runtime: nodejs8.10 | |
| stage: ${opt:stage, 'dev'} | |
| region: eu-west-1 | |
| functions: | |
| my-function: | |
| handler: index.handler | |
| events: | |
| - http: | |
| path: api | |
| method: get | |
| cors: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment