vadimdemedes / pastel

🎨 Next.js-like framework for CLIs made with Ink
https://term.ink/pastel
MIT License
2.18k stars 36 forks source link

VS Code debugging #58

Closed endquote closed 1 year ago

endquote commented 1 year ago

Is there a .vscode/launch.json configuration that would work to allow debugging through a typescript pastel project?

vadimdemedes commented 1 year ago

Pastel is a regular dependency, so if you set up a debugger for a TypeScript project, it should work. I don't use it myself, so can't help setting one up.

endquote commented 1 year ago

Thanks for the helpful reply.

In case anyone else is wondering:

Just add "sourceMap": true under compilerOptions in tsconfig.json.

Add this .vscode/launch.json file:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "launch",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "program": "${workspaceFolder}/source/cli.tsx",
      "preLaunchTask": "tsc: build - tsconfig.json",
      "outFiles": [
        "${workspaceFolder}/dist/**/*.js"
      ]
    }
  ]
}
vadimdemedes commented 1 year ago

Thanks for posting your setup, hope it'll be useful for anyone looking 👍