This is an opinionated boilerplate I use when building AWS Cloud Development Kit (CDK) applications.
For building open-source constructs, I recommend using projen
's awscdk-construct
project type.
- Latest (best-effort) versions of dependencies
- Package management using
yarn
- Strict Typescript config
- Auto-formatting via
prettier
- Strict(ish) linting rules enforced by
eslint
- Standard unit testing setup using
jest
- Git hooks via
husky
andlink-staged
- Standard commit messages using
commitlint
- For VSCode users:
- Recommended extensions
- Pre-configured settings and launch configurations for debugging
- For Linux/Mac/WSL users:
Makefile
with pre-configured commands for convenience
- For Github:
- Built-in dependabot config
- Built-in Github Actions workflows for pull requests and
main
branch - Scanning for cloud infrastructure misconfigurations via
checkov
shellcheck
for checking shell scripts
- CDK-specific:
- Use of project-installed
cdk
instead of a globally-installed one - Use
BaseStack
instead of CDK's ownStack
class to get some standard resource-tagging in place - Use of
cdk-nag
to statically check if best practices are followed
- Use of project-installed
- Node 20+
- yarn for package management
A few git hooks are set up during the project setup process (make install
).
- A
pre-commit
hook that runs some checks depending on the staged files. The hook itself is found at.husky/pre-commit
. - A
commit-msg
hook that checks whether the commit message conforms to thecommitlint
spec. Allowed commit "types" are found incommitlint.config.js
.
❯ make
Available commands:
help Show help (default)
install Install node dependencies
format Format the project source code
lint Check for common errors
typecheck Check static type annotations
synth Synthesize deployment code
build Synthesize deployment code (alias of `synth`)
test Execute unit tests
deploy Deploy infrastructure
outdated Check for outdated dependencies
upgrade Upgrade dependencies
clean Delete artifacts
checks Runs format, typecheck, test and build
tag Tags the current commit using CalVer
unreleased Lists the commits since the latest tag