Skip to content

src: avoid URL parsing in GetPackageScopeConfig - #67523

Open
araujogui wants to merge 3 commits into
nodejs:mainfrom
araujogui:module-package-scope-no-url
Open

araujogui wants to merge 3 commits into
nodejs:mainfrom
araujogui:module-package-scope-no-url

Conversation

@araujogui

Copy link
Copy Markdown
Member

Walk the file path string up the directory tree instead of parsing a URL for every directory level. Resolves the TODO in GetPackageScopeConfig.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Nov 16, 2026
Walk the file path string up the directory tree instead of parsing
a URL for every directory level.

Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
@araujogui
araujogui force-pushed the module-package-scope-no-url branch from fecdb85 to 241534e Compare November 16, 2026 15:44
@araujogui
araujogui requested a review from anonrig November 16, 2026 15:49
@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.72%. Comparing base (52bfcaf) to head (11049ef).
⚠️ Report is 104 commits behind head on main.

Files with missing lines Patch % Lines
src/node_modules.cc 80.00% 0 Missing and 3 partials ⚠️
src/node_file.cc 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67523      +/-   ##
==========================================
+ Coverage   90.70%   90.72%   +0.02%     
==========================================
  Files         802      801       -1     
  Lines      282176   280790    -1386     
  Branches    54379    54206     -173     
==========================================
- Hits       255934   254734    -1200     
+ Misses      16365    16250     -115     
+ Partials     9877     9806      -71     
Files with missing lines Coverage Δ
src/path.cc 78.64% <100.00%> (+0.42%) ⬆️
src/path.h 100.00% <ø> (ø)
src/node_file.cc 77.08% <75.00%> (+1.10%) ⬆️
src/node_modules.cc 79.87% <80.00%> (-0.04%) ⬇️

... and 150 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@araujogui araujogui added module Issues and PRs related to the module subsystem. esm Issues and PRs related to the ECMAScript Modules implementation. labels Nov 16, 2026
@araujogui

Copy link
Copy Markdown
Member Author

CC @nodejs/loaders @nodejs/platform-windows

@StefanStojanovic StefanStojanovic added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 17, 2026
@araujogui
araujogui force-pushed the module-package-scope-no-url branch from c261f0c to d295857 Compare November 17, 2026 14:19
Comment thread src/node_modules.cc Resolved
ToNamespacedPath() only accepted a BufferValue, so
GetPackageScopeConfig() and LegacyMainResolve() copied std::string
paths into a V8 string or Buffer just to namespace them on Windows.
Use the new overload there instead.

Assisted-by: Claude Opus 5.5
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
@araujogui araujogui added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. esm Issues and PRs related to the ECMAScript Modules implementation. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants