VS Code, Typescript – Bare Metal New Project

i’m basically following this guide, humbly attempting to trim to bare necessity and align a couple crucial bits that have shifted since it was written

  1. install Node
  2. from command line (“cmd>” from hereon) npm install -g typescript
  3. install VS Code
  4. launch VS Code… commands inside VS Code designated as “vsc>” from hereon
  5. vsc> File > Open > New Folder > “projectFolder” > then Open that folder
  6. vsc> F1 > type “task” > “Configure Task Runner” > Enter > “TypeScript – Watch Mode” > Enter
    1. this will create a crucial tasks.json file with working default settings…
    2. -AND- that “watch mode” choice means the moment you save any .ts file, the IDE will automatically regen the corresponding .js files… which plays into live edit and continue style debugging; perhaps something to expand upon next turn of our communicaiton
  7. vsc> File > New File > populate with following and save as tsconfig.json … this is what tells vscode that you need to “transpile” .ts script to standard .js
    {
    "compilerOptions": {
    "target": "es5",
    "outDir": "out/",
    "sourceMap": true
    }
    }
  8. vsc> File > New File > throw in something simple like console.log("Hello World!"); and save as app.ts (file name referenced in config file below)
  9. vsc> build aka compile via CTRL+SHIFT+B… after a few pregnant seconds, this will gen some stuff in the out folder we specified in above tsconfig.json
  10. vsc> CTRL+SHIFT+D to get into Debug panel > click the gear icon which creates and opens default launch.json which should have working defaults going by what we’ve done previously
  11. crucial navigate back to the app.ts file as the active script you wish to run/debug (correspondig to the "program": "${file}" entry in launch.json)
  12. now we should be able to simply hit F5 to run/debug from hereon as we’d normally expect… F9 to set breakpoints, etc.

hopefully you’re off to the races and you can bootstrap yourself further by googling

i am a bit “ashamed” that this initial startup is still this obtuse