From 1a6bef29b2f64c063526647760dd869462ae2a8a Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Thu, 27 Feb 2025 16:02:10 -0500 Subject: [PATCH] src: set default config as node.config.json PR-URL: https://github.com/nodejs/node/pull/57171 Reviewed-By: James M Snell Reviewed-By: Yagiz Nizipli --- Makefile | 2 +- doc/api/cli.md | 31 +++++++++---- ...on_schema.json => node-config-schema.json} | 0 doc/node.1 | 5 +- lib/internal/process/pre_execution.js | 3 +- src/node_config_file.cc | 20 ++++++-- src/node_options.cc | 5 +- src/node_options.h | 3 +- test/fixtures/rc/default/node.config.json | 5 ++ test/fixtures/rc/default/override.json | 5 ++ .../fixtures/rc/non-readable/node.config.json | 5 ++ test/parallel/test-config-file.js | 46 +++++++++++++++++++ test/parallel/test-config-json-schema.js | 4 +- tools/doc/generate-json-schema.mjs | 2 +- 14 files changed, 114 insertions(+), 22 deletions(-) rename doc/{node_config_json_schema.json => node-config-schema.json} (100%) create mode 100644 test/fixtures/rc/default/node.config.json create mode 100644 test/fixtures/rc/default/override.json create mode 100755 test/fixtures/rc/non-readable/node.config.json diff --git a/Makefile b/Makefile index 69c026755bf230..36e79eb99de38d 100644 --- a/Makefile +++ b/Makefile @@ -809,7 +809,7 @@ doc: $(NODE_EXE) doc-only ## Build Node.js, and then build the documentation wit out/doc: mkdir -p $@ - cp doc/node_config_json_schema.json $@ + cp doc/node-config-schema.json $@ # If it's a source tarball, doc/api already contains the generated docs. # Just copy everything under doc/api over. diff --git a/doc/api/cli.md b/doc/api/cli.md index 0e6ca372337651..a102038344b006 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -911,7 +911,7 @@ added: v23.6.0 Enable experimental import support for `.node` addons. -### `--experimental-config-file` +### `--experimental-config-file=config` + +> Stability: 1.0 - Early development + +If the `--experimental-default-config-file` flag is present, Node.js will look for a +`node.config.json` file in the current working directory and load it as a +as configuration file. + ### `--experimental-eventsource`