FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: set default config as node.config.json by marco-ippolito · Pull Request #57171 · nodejs/node · GitHub

/ node Public

src: set default config as node.config.json - #57171

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
marco-ippolito:default-value-node-json
Feb 27, 2025
Merged

src: set default config as node.config.json#57171
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
marco-ippolito:default-value-node-json

Conversation

marco-ippolito commented Feb 21, 2025
edited
Loading

Copy link
Copy Markdown
Member

This PR changes the current behavior:

node --experimental-default-config-file foo.js

Will automatically look for a node.config.json file (I dont have strong opinion on the default)

If a --experimental-config-file is provided it will use that:

node --experimental-config-file=foo.json foo.js

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 Feb 21, 2025
marco-ippolito added the semver-minor PRs that contain new features and should be released in the next minor version. label Feb 21, 2025

jasnell commented Feb 21, 2025

Copy link
Copy Markdown
Member

Hmm, I'm a bit concerned about naming collisions with existing uses of node.json such as this https://github.com/kubeedge/kubeedge/blob/master/build/node.json.

Copy link
Copy Markdown
Member Author

Maybe noderc.json? That should not have collisions (I HOPE 😆)

targos commented Feb 21, 2025

Copy link
Copy Markdown
Member

In any case, I don't think it should be unflagged from the first release.

Copy link
Copy Markdown
Member Author

In any case, I don't think it should be unflagged from the first release.

it's not unflagged, I'm not sure what are you referring to

targos commented Feb 21, 2025

Copy link
Copy Markdown
Member

Okay then, I guess I didn't read the commit message correctly

codecov Bot commented Feb 21, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.26%. Comparing base (044d69a) to head (e38690d).
Report is 542 commits behind head on main.

Files with missing lines Patch % Lines
src/node_config_file.cc 63.63% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57171      +/-   ##
==========================================
- Coverage   90.35%   90.26%   -0.09%     
==========================================
  Files         629      630       +1     
  Lines      184424   184643     +219     
  Branches    36034    36135     +101     
==========================================
+ Hits       166633   166673      +40     
- Misses      10913    11024     +111     
- Partials     6878     6946      +68     
Files with missing lines Coverage Δ
lib/internal/process/pre_execution.js 93.03% <100.00%> (-0.28%) ⬇️
src/node_options.cc 85.34% <100.00%> (+0.01%) ⬆️
src/node_options.h 98.33% <100.00%> (+<0.01%) ⬆️
src/node_config_file.cc 73.18% <63.63%> (+1.21%) ⬆️

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

jasnell commented Feb 21, 2025

Copy link
Copy Markdown
Member

When searching I was only able to find examples of node.json in common use. Even nodejs.json might work (despite the ugly double js in there). Or .node.json (making it a dot prefixed file). The other possibility is that we look for a .nodejs directory in cwd and load .nodejs/config.json. Every option is likely equally unfortunate in their own special ways tho.

Copy link
Copy Markdown
Member Author

Best options are
.node.json or
noderc.json imho, I'll try a survey on social media so see what people think

anonrig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

How does this play with file permissions?

Copy link
Copy Markdown
Member Author

How does this play with file permissions?

I added a test, also will need a rebase after #57170 lands.

There are 6k results for node.json on github:
https://github.com/search?q=path:**/node.json+language:JSON&type=code&l=JSON

I wish we could just take it 🥺

Otherwise:

  • node.config.json

  • nodejs.json

darcyrush commented Feb 24, 2025
edited
Loading

Copy link
Copy Markdown

Modern versions of eslint and prettier both support a version of .config naming notion such as eslint.config.cjs, so node.config.json would align nicely, and having .config in the name makes it pretty obvious and explicit.

bricss commented Feb 24, 2025

Copy link
Copy Markdown
Contributor

IMO, node.config.json to de moon 🚀🌔

marco-ippolito marked this pull request as draft February 24, 2025 11:40
marco-ippolito force-pushed the default-value-node-json branch from f1b6d67 to 70b3289 Compare February 24, 2025 12:02
marco-ippolito changed the title src: set default config as node.json src: set default config as node.config.json Feb 24, 2025
marco-ippolito force-pushed the default-value-node-json branch from 70b3289 to e00ade9 Compare February 24, 2025 12:03

Copy link
Copy Markdown
Member Author

node.config.json it is

marco-ippolito marked this pull request as ready for review February 24, 2025 12:05
marco-ippolito force-pushed the default-value-node-json branch 3 times, most recently from c0373f2 to 6456729 Compare February 24, 2025 12:16
Comment thread doc/api/cli.md Outdated
marco-ippolito force-pushed the default-value-node-json branch 2 times, most recently from 434360e to 54b272c Compare February 25, 2025 06:03
RafaelGSS added the backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. label Apr 11, 2025

Copy link
Copy Markdown
Member

This commit didn't land cleanly on v22.x-staging. It requires a manual backport, so I'm adding a backport-requested label.

marco-ippolito added the backport-open-v22.x Indicate that the PR has an open backport label Apr 21, 2025
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
PR-URL: #57171
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
Notable changes:

config:
  * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016
  * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171
crypto:
  * update root certificates to NSS 3.108 (Node.js GitHub Bot) #57381
doc:
  * add geeksilva97 to collaborators (Edy Silva) #57241
src:
  * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016
test_runner:
  * (SEMVER-MINOR) change ts default glob (Marco Ippolito) #57359
tls:
  * (SEMVER-MINOR) implement `tls.getCACertificates()` (Joyee Cheung) #57107
v8:
  * (SEMVER-MINOR) add `v8.getCppHeapStatistics()` method (Aditi) #57146

PR-URL: #57424
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
PR-URL: #57171
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
Notable changes:

config:
  * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016
  * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171
crypto:
  * update root certificates to NSS 3.108 (Node.js GitHub Bot) #57381
doc:
  * add geeksilva97 to collaborators (Edy Silva) #57241
src:
  * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016
test_runner:
  * (SEMVER-MINOR) change ts default glob (Marco Ippolito) #57359
tls:
  * (SEMVER-MINOR) implement `tls.getCACertificates()` (Joyee Cheung) #57107
v8:
  * (SEMVER-MINOR) add `v8.getCppHeapStatistics()` method (Aditi) #57146

PR-URL: #57424
aduh95 pushed a commit to marco-ippolito/node that referenced this pull request May 6, 2025
PR-URL: nodejs#57171
Backport-PR-URL: nodejs#57958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
aduh95 added backported-to-v22.x PRs backported to the v22.x-staging branch. and removed backport-open-v22.x Indicate that the PR has an open backport backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. labels May 6, 2025
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57171
Backport-PR-URL: #57958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
PR-URL: #57171
Backport-PR-URL: #57958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
aduh95 pushed a commit that referenced this pull request May 16, 2025
PR-URL: #57171
Backport-PR-URL: #57958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57171
Backport-PR-URL: #57958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
aduh95 pushed a commit that referenced this pull request May 18, 2025
PR-URL: #57171
Backport-PR-URL: #57958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
aduh95 pushed a commit that referenced this pull request May 19, 2025
PR-URL: #57171
Backport-PR-URL: #57958
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
aduh95 added a commit that referenced this pull request May 19, 2025
Notable changes:

deps:
  * update timezone to 2025b (Node.js GitHub Bot) #57857
doc:
  * add dario-piotrowicz to collaborators (Dario Piotrowicz) #58102
  * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) #57765
esm:
  * (SEMVER-MINOR) graduate import.meta properties (James M Snell) #58011
  * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) #57610
sqlite:
  * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490
src:
  * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171
  * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016
  * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016
  * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) #57820
stream:
  * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) #57865
util:
  * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) #57879
worker:
  * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) #57888

PR-URL: #58388
aduh95 added a commit that referenced this pull request May 21, 2025
Notable changes:

deps:
  * update timezone to 2025b (Node.js GitHub Bot) #57857
doc:
  * add dario-piotrowicz to collaborators (Dario Piotrowicz) #58102
  * (SEMVER-MINOR) graduate multiple experimental apis (James M Snell) #57765
esm:
  * (SEMVER-MINOR) graduate import.meta properties (James M Snell) #58011
  * (SEMVER-MINOR) support top-level Wasm without package type (Guy Bedford) #57610
sqlite:
  * (SEMVER-MINOR) add StatementSync.prototype.columns() (Colin Ihrig) #57490
src:
  * (SEMVER-MINOR) set default config as `node.config.json` (Marco Ippolito) #57171
  * (SEMVER-MINOR) create `THROW_ERR_OPTIONS_BEFORE_BOOTSTRAPPING` (Marco Ippolito) #57016
  * (SEMVER-MINOR) add config file support (Marco Ippolito) #57016
  * (SEMVER-MINOR) add ExecutionAsyncId getter for any Context (Attila Szegedi) #57820
stream:
  * (SEMVER-MINOR) preserve AsyncLocalStorage context in finished() (Gürgün Dayıoğlu) #57865
util:
  * (SEMVER-MINOR) add `types.isFloat16Array()` (Livia Medeiros) #57879
worker:
  * (SEMVER-MINOR) add worker.getHeapStatistics() (Matteo Collina) #57888

PR-URL: #58388
ghost mentioned this pull request Jun 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported-to-v22.x PRs backported to the v22.x-staging branch. c++ Issues and PRs that require attention from people who are familiar with C++. config Issues or PRs related to the config subsystem needs-ci PRs that need a full CI run. 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.


Back | FazBrowse Home | New Git URL