Note
This repo is inspired by Felix Spöttel's excellent Rust template that I used in 2023 - you can find that here.
Template for developing solutions for Advent of Code.
- Install Fast Node Manager or Node Version Manager.
- Use the right version of Node:
fnm use
# or
nvm use
- Install pnpm.
- Install required dependencies:
pnpm i
- ✅ You're ready to go!
This project comes with scripts to make problem-solving fun.
# example: `pnpm scaffold 1`
pnpm scaffold <day>
# output:
# Created empty example file "data/examples/01.txt"
# Created empty input file "data/inputs/01.txt"
# Created test file "src/solutions/01/01.test.ts"
# Created solution file "src/solutions/01/01.ts"
# ---
# 🎄 Type `pnpm solve 1` to run your solution.
Individual solutions live in the ./src/solutions/
directory as separate files. Inputs and examples live in the the ./data
directory.
Every solution has tests referencing its example file in ./data/examples
. Use these tests to develop and debug your solutions against the example input.
# example: `pnpm solve 01`
pnpm solve <day>
# output:
# Part One: 42
# Part Two: 42
The solve
command runs your solution against real puzzle inputs from the ./data/inputs
directory.
pnpm test
This just runs vitest under-the-hood and supports all of the same CLI options at the vitest CLI.
pnpm lint
pnpm typecheck