Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 30, 2025

In monorepo setups with multiple packages containing npm scripts, the debug configuration dropdown shows identical entries like "Run Script: start" for each package, making it impossible to distinguish which script belongs to which subdirectory.

Before: Identical script names in monorepo

This change detects when npm scripts come from multiple directories and includes the directory basename in the configuration name to help users distinguish between them.

Changes:

  • Modified getFromNpmScripts in nodeDebugConfigurationProvider.ts to detect multi-directory scenarios
  • Added conditional formatting to include directory basename when multiple directories are present
  • Maintained backward compatibility for single-directory projects

Before:

Run Script: start
Run Script: start  
Run Script: build
Run Script: build

After (monorepo):

Run Script: start (frontend)
Run Script: start (backend)
Run Script: build (frontend) 
Run Script: build (backend)

After (single directory - unchanged):

Run Script: start
Run Script: build
Run Script: test

The implementation follows the same pattern used in debugNpmScript.ts for multi-directory detection and uses path.basename() to show clean directory names.

Fixes #2241.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • plugins.dprint.dev
    • Triggering command: /home/REDACTED/work/vscode-js-debug/vscode-js-debug/node_modules/dprint/dprint fmt OPTIONS.md (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Node.js monorepo - can the debug setup have the subdir name instead of just the same list? Add subdirectory names to debug script configurations in monorepos Jun 30, 2025
@Copilot Copilot AI requested a review from connor4312 June 30, 2025 20:49
Copilot finished work on behalf of connor4312 June 30, 2025 20:49
@connor4312
Copy link
Member

Run npm run fmt to fix the format errro

Copy link
Contributor Author

Copilot AI commented Jun 30, 2025

Run npm run fmt to fix the format errro

I attempted to run npm run fmt but encountered a DNS resolution error for plugins.dprint.dev due to firewall restrictions. I've manually applied formatting fixes based on the dprint configuration and existing code style patterns in the repository. The changes are now committed in b6c4d74.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • plugins.dprint.dev
    • Triggering command: /home/REDACTED/work/vscode-js-debug/vscode-js-debug/node_modules/dprint/dprint fmt (dns block)
    • Triggering command: ./node_modules/dprint/dprint fmt (dns block)
    • Triggering command: /home/REDACTED/work/vscode-js-debug/vscode-js-debug/node_modules/dprint/dprint check (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from connor4312 June 30, 2025 21:14
Copilot finished work on behalf of connor4312 June 30, 2025 21:14
@connor4312 connor4312 marked this pull request as ready for review June 30, 2025 21:18
@vs-code-engineering vs-code-engineering bot added this to the July 2025 milestone Jun 30, 2025
@connor4312 connor4312 enabled auto-merge (squash) July 1, 2025 15:49
@connor4312 connor4312 merged commit 9b12d08 into main Jul 1, 2025
3 of 7 checks passed
@connor4312 connor4312 deleted the copilot/fix-2241 branch July 1, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node.js monorepo - can the debug setup have the subdir name instead of just the same list?
4 participants