This boilerplate repo pulls together a demo of what I consider to be some of the current best practices for generic Node + Typescript development.
- Node + TypeScript
- Containerized build
- Testing with
vitest- Unit tests
- Integration tests run against containerized build
- Zod env validation
npm run dev recommended for feature development.
npm ci
npm run test:unit
npm run dev
npm run test:integrationContainerized build provided for testing out more infrastructure dependent things like OTEL tracing.
podman compose up --build -d
npm run test:integration
podman compose down- Type stripping is such a nice approach to TypeScript use. No more fiddling
with sourcemaps or compiler build steps. Just
npm ciandnode src/main.ts. - I was initially using
node --watchfor thedevscript but I've gone back tonodemonbecause I kept running into an issue wherenode --watchwould restart once or twice and then never trigger a restart again. Not sure what's up there butnodemonstill works great even if it is a bit of a bummer to expandnode_modules. - I was initially using
node --testand while I'm still excited for a potential future where I can avoid yet more dependencies innode_modules, tools likevitestJust Work TM and imo are nicer to use day to day.
- Set up CI
- Formatter check
- Type check
- Linter check
- Unit tests
- Build image
- Integration tests against image
- Publish image
- Make OTEL optional
- Currently baked in as required when running the image but I want the flexibility of not turning on the instrumentation