Skip to content

Commit

Permalink
chore: add note about how to attach debugger (#6273)
Browse files Browse the repository at this point in the history
* chore: add note about how to attach debugger

* Update CONTRIBUTING.md

Co-authored-by: Matt Kane <m@mk.gg>

* Apply suggestions from code review

Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>

* Update CONTRIBUTING.md

---------

Co-authored-by: Matt Kane <m@mk.gg>
Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
  • Loading branch information
3 people committed Apr 25, 2024
1 parent 12d7464 commit 7907adf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ or (`DEBUG=true` enables printing stack traces when errors are thrown):
DEBUG=true ./bin/run.js [command]
```

### Attaching a Debugger

When debugging a project, it's super helpful to attach a debugger to the CLI. If you use VS Code, here's how you can do it:

1. Open this repository in VS Code.
2. Open a "JavaScript Debug Terminal" (e.g. by searching for it in the Command Palette (Shift-Cmd+P)). Every Node process that's opened in this terminal will have a debugger attached.
3. Place a breakpoint somewhere in the CLI. You will have to place them in the compiled `.js` files as opposed to the `.ts` files.
4. In your JavaScript Debug Terminal, navigate to the project you'd like to debug.
5. Run `/path/to/netlify/cli/bin/run.js`. The debugger should be connecting automatically.

### Architecture

The CLI is written using the [commander.js](https://github.com/tj/commander.js/) cli interface and the
Expand Down

1 comment on commit 7907adf

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,345
  • Package size: 313 MB
  • Number of ts-expect-error directives: 1,001

Please sign in to comment.