Skip to content
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

src: add --run-from flag #57592

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

src: add --run-from flag #57592

wants to merge 6 commits into from

Conversation

flakey5
Copy link
Member

@flakey5 flakey5 commented Mar 22, 2025

Closes #57489

This differs from #57523 in that this changes the working directory that the script is executed from.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/config

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Mar 22, 2025
Closes nodejs#57489

Signed-off-by: flakey5 <[email protected]>

Co-authored-by: Mert Can Altin <[email protected]>
Co-authored-by: Yagiz Nizipli <[email protected]>
Signed-off-by: flakey5 <[email protected]>
Copy link

codecov bot commented Mar 22, 2025

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Project coverage is 90.23%. Comparing base (4a7d501) to head (6dc382a).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/node_task_runner.cc 40.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57592      +/-   ##
==========================================
- Coverage   90.23%   90.23%   -0.01%     
==========================================
  Files         630      630              
  Lines      185149   185065      -84     
  Branches    36235    36222      -13     
==========================================
- Hits       167066   166989      -77     
- Misses      11037    11046       +9     
+ Partials     7046     7030      -16     
Files with missing lines Coverage Δ
src/node_options.cc 85.36% <100.00%> (+0.01%) ⬆️
src/node_options.h 98.88% <ø> (ø)
src/node_task_runner.cc 86.70% <40.00%> (-2.69%) ⬇️

... and 42 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.

@pmarchini
Copy link
Member

Is this a duplicate of #57523?

@jasnell
Copy link
Member

jasnell commented Mar 22, 2025

@pmarchini ... it is a simpler alternative to #57523. @flakey5 had started working on it before #57523 was opened based on the discussion in the original issue.

@anonrig anonrig added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Mar 22, 2025
@anonrig anonrig added semver-minor PRs that contain new features and should be released in the next minor version. notable-change PRs with changes that should be highlighted in changelogs. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 22, 2025
Copy link
Contributor

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @anonrig.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM! Left a minor comment, that might lead to misunderstandings on the expected behavior, but besides that, cool stuff!

Signed-off-by: flakey5 <[email protected]>
Copy link
Member

@mertcanaltin mertcanaltin left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

doc/api/cli.md Outdated
Comment on lines 2305 to 2308
Run a `package.json` script from a specified path to a `package.json` file or
path to the containing folder of a `package.json` file.

The script is run from the directory of the `package.json` file.
Copy link
Member

Choose a reason for hiding this comment

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

I think this is not entirely correct, as you can also path a subdirectory.
For example, if the package.json is in /some/path/package.json, you can use --run-from=/some/path/deeper/path and it will still work, right?

Wouldn't it be simpler for everything (documentation, implementation, users), if this only supported a path to a folder and said that it will look for the closest package.json in the hierarchy?

Copy link
Member

Choose a reason for hiding this comment

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

I don't believe it does parent traversal search 🤔

Copy link
Member

Choose a reason for hiding this comment

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

It does parent traversal path

Co-authored-by: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Mar 25, 2025

I think this change is generally ready to go but due to some ongoing maintenance issues with CI we are restricted from running jenkins CI on this PR just yet. Once that is opened back up we can run CI and get this merged.

@jasnell jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. request-ci Add this label to start a Jenkins CI on a PR. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify working directory for node --run