https://adventofcode.com/2022 in TypeScript
with RxJS
Recommend to run using NodeJS
18+ with corepack
.
Recommend to run using Volta
.
Just run with dev
script for develop. The script will watch, re-build, and re-run everytime the file change.
# corepack enable # moving to Volta
yarn install
yarn dev {dayNum} {part} {input: 'ex' | 'in'}
yarn dev 1 1 ex
yarn test {dayNum} {part|testname}
yarn test-all
- Fix Yarn version inside
package.json
. - Using
Yarn PnP
but notZero-Installs
like Advent-of-Code 2021 since we need native binary fromSWC
andesbuild
Yarn PnP
install still fast. But I addpost-install
script to updatesdks
and now it a bit slow.
- Using Volta at work, so I decide to use it here too.
TypeScript (TS)
- Not using TS to compile or run anythings here. Just keeping the package to maintain VS Code integration with
Yarn PnP
viaYarn SDKS
.
- First time try using SWC
swc
to build instead of TypeScripttsc
.
- First time try using
esbuild
to build instead of TypeScripttsc
. - First time bundle output using
esbuild
. - First time minify output using
esbuild
.
- First time try using
tsx
to run, both for app and test.
- First time try using
Node.js
native test runner.
- This year I decide to goes with many new tools, e.g.
SWC
or nativeNodeJS
watch or native ESM, I just can't figure out how to combine all those tool into one command that still work withYarn PnP
. So I just separatebuild
andserve
commands then combine it withconcurrently
. - After day 3, try moving from
SWC
toesbuild
with added of bundling.SWC
script command still available by append-swc
. dev
script build before invokeconcurrently
, to preventdev
fail toserve
since the app never build and the file didn't exist.
No Nodemon ?
- While I using
Nodemon
in Advent of Code 2021.NodeJS
added native watch support.