-
Notifications
You must be signed in to change notification settings - Fork 2
ggt debugger #1991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ggt debugger #1991
Conversation
🦋 Changeset detectedLatest commit: 6019a7d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
bb9c5f5 to
80b5169
Compare
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 | ||
| node-version: 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nock in node 18 was doing something really funky with websockets and the tests would just hang
node18 is out of LTS so I think its ok to put 20 as out min version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 I was already planning on upgrading to Node.js 20 here: #1990
Mind if I merge that PR first and you rebase this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind if I merge that PR first and you rebase this one?
yah go for it
| You can now start debugging by running the "Gadget debugger" launch configuration. | ||
| `, | ||
| }); | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: what do you think of asking the user if they want to continue and start the debugger (or even just auto-run it)?
| • ${configurator.launchJsonPath} | ||
| • ${configurator.tasksJsonPath} | ||
| You can now start debugging by running the "Gadget debugger" launch configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by running the "Gadget debugger" launch configuration in where? in the IDE?
scott-rc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow 🤩
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 | ||
| node-version: 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 I was already planning on upgrading to Node.js 20 here: #1990
Mind if I merge that PR first and you rebase this one?
| }; | ||
|
|
||
| export const run: Run<DebuggerArgs> = async (ctx, args) => { | ||
| const directory = await loadSyncJsonDirectory(args._[0] || process.cwd()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about removing the [DIRECTORY] argument and forcing users to run ggt debugger inside a directory that's already been initialized with ggt dev.
We did this for ggt add, ggt open, and ggt status:
- https://github.com/gadget-inc/ggt/blob/main/src/commands/add.ts/#L100-L104
- https://github.com/gadget-inc/ggt/blob/main/src/services/filesync/error.ts/#L42-L52
That way ggt debugger isn't responsible for initializing directories and removes a lot of edge cases. We can add the ability to initialize a directory later if needed.


This PR adds the
ggt debuggerand goes with the monorepo PR https://github.com/gadget-inc/gadget/pull/18121the idea is that the user will add a an item to their vscode launch config (and
ggt debugger --configure vscodewill accelerate that); that config will set up a task that runsggt debuggeras a background processggt debuggersets up a websocket server running onlocalhost:9229which is that place that node debuggers are looking for CDP; it will also set up a remote debugging session for that environment and then proxy the debugger protocol messages through that session to the current sandbox process (that means DAP messages are doing 4 proxy hops though DAP <-> ggt debugger <-> api <-> reloader-proxy <-> sandbox; yikes)cc @airhorns for vibes