A template for an AWS SAM project written in TypeScript, using Jest for testing, TSLint for code style and Snyk for vulnerability scanning.
.
├── sam.yaml
└── src
└── ...
Fork this project then start building your app.
You'll need Node 8.10+ and a Snyk account.
Authenticate with your Snyk account
npx snyk auth
npm i
Builds the project and prepares it for packaging and deployment to AWS
npm run build
- clean
- lint
- audit
- compile
- test
- copydependencies
npm run deploy -- -s <stage> -p <aws-profile-name>
Uses the CloudFormation CLI deploy command to deploy the uploaded artifact to the target environment.
npm run deploy -- -s dev -p main
Runs the deploy command using the supplied aws profile and stage.
A third argument is automatically supplied -n
the name of the project which defaults to the npm package name.
You will need to have a deployment bucket created in the target account:
<project name>-deployment-<stage name>
i.e.
my-project-deployment-dev
npm run compile
Compiles TypeScript source.
This project uses Jest for testing.
npm run test
With coverage
npm run test -- --coverage
Watch
npm run test -- --watch
npm run lint
Run npm audit and Snyk to scan for dependency vulnerabilities
npm run audit
Copies production dependencies to the dist folder
npm run copydependencies
This project is licensed under the MIT License.