Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@
"localRoot": "${workspaceFolder}/packages"
},
{
"name": "CLI: Run Current File",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most of the updates to .vscode/launch.json were already merged in PR #22894 is this still applicable? You will need to rebase this PR onto main to resolve conflicts.

"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
"program": "${file}",
"outFiles": ["${workspaceFolder}/**/*.js"]
"runtimeArgs": ["--import", "tsx"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"NODE_ENV": "development"
}
Comment on lines +44 to +54

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Using npm exec as the runtimeExecutable in a launch.json configuration is problematic for debugging. VS Code's Node.js debugger attempts to inject debugging flags (such as --inspect-brk) into the runtimeExecutable. Since npm does not recognize these flags, it will likely fail to start or ignore them, preventing the debugger from attaching to the actual script process. This means breakpoints will not work as expected.

Additionally, npm exec introduces significant startup overhead. Since this project uses Node.js 20 (recommended ~20.19.0 per the repository style guide), the preferred approach is to use node directly with the --import tsx flag.

Furthermore, since this is a CLI project using Ink, you should set "console": "integratedTerminal" to ensure the output is rendered correctly in a TTY-enabled environment, consistent with other configurations in this file (e.g., lines 15, 72, 90).

Suggested change
"name": "CLI: Run Current File",
"type": "node",
"request": "launch",
"name": "Launch Program",
"runtimeExecutable": "npm",
"runtimeArgs": ["exec", "tsx", "--", "${file}"],
"cwd": "${workspaceFolder}",
"skipFiles": ["<node_internals>/**"],
"program": "${file}",
"outFiles": ["${workspaceFolder}/**/*.js"]
"outFiles": ["${workspaceFolder}/**/*.js"],
"env": {
"NODE_ENV": "development"
}
"name": "CLI: Run Current File",
"type": "node",
"request": "launch",
"program": "${file}",
"runtimeArgs": ["--import", "tsx"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"env": {
"NODE_ENV": "development"
}
References
  1. The project recommends Node.js ~20.19.0 for development, which supports the --import flag for loaders. (link)

},
{
"type": "node",
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ npm run lint
2. In VS Code, use the "Attach" launch configuration (found in
`.vscode/launch.json`).

Alternatively, you can use the "Launch Program" configuration in VS Code if you
prefer to launch the currently open file directly, but 'F5' is generally
Alternatively, you can use the "CLI: Run Current File" configuration in VS Code
if you prefer to launch the currently open file directly, but 'F5' is generally
recommended.

To hit a breakpoint inside the sandbox container run:
Expand Down