Code Monkey home page Code Monkey logo

advent-of-code-2022's Introduction

CodeQL unit-test

What is it?

https://adventofcode.com/2022 in TypeScript with RxJS

How to execute

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'}

e.g. dev with day 1 part 1 sample

yarn dev 1 1 ex

How to run test

Running specific test

yarn test {dayNum} {part|testname}

Running all test

yarn  test-all

Note

  • Fix Yarn version inside package.json.
    • But not store Yarn release inside repository.
    • Recommended to enable NodeJS corepack.
    • Moving to Volta instead of corepack to fix both Yarn and Node.js.
  • Using Yarn PnP but not Zero-Installs like Advent-of-Code 2021 since we need native binary from SWC and esbuild
  • Yarn PnP install still fast. But I add post-install script to update sdks and now it a bit slow.
  • Using Volta at work, so I decide to use it here too.
  • Not using TS to compile or run anythings here. Just keeping the package to maintain VS Code integration with Yarn PnP via Yarn SDKS.
  • First time try using SWC swc to build instead of TypeScript tsc.
  • First time try using esbuild to build instead of TypeScript tsc.
  • 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 native NodeJS watch or native ESM, I just can't figure out how to combine all those tool into one command that still work with Yarn PnP. So I just separate build and serve commands then combine it with concurrently.
  • After day 3, try moving from SWC to esbuild with added of bundling. SWC script command still available by append -swc.
  • dev script build before invoke concurrently, to prevent dev fail to serve since the app never build and the file didn't exist.

No Nodemon ?

advent-of-code-2022's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.