Skip to content

src: namespace config file flags #57170

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -928,17 +928,19 @@ with the following structure:
```json
{
"$schema": "https://nodejs.org/dist/REPLACEME/docs/node_config_json_schema.json",
"experimental-transform-types": true,
"import": [
"amaro/transform"
],
"disable-warning": "ExperimentalWarning",
"watch-path": "src",
"watch-preserve-output": true
"nodeOptions": {
"experimental-transform-types": true,
Copy link
Member

Choose a reason for hiding this comment

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

Can we support all of experimental-transform-types, experimental_transform_types and experimentalTransformTypes for each flag? Just as currently the CLI supports either of the first two.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm ok with the second, not sure how feasible is the third one. I think we can defer to a followup

Copy link
Contributor

Choose a reason for hiding this comment

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

Given this is just a sample of how to use the config file to persist flags, would it be better to stick to non-experimental flags?

This example maximizes hiding of the dependency on experimental features, e.g. by disabling the warnings too. That's fine if you are experienced enough to understand the implications.

Whilst it's certainly possible to use configs for this purpose, having it as the shining model example seems risky IMO and may be construed as encouragement to use this pattern.

Copy link
Member Author

Choose a reason for hiding this comment

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

will do in the followup PR #57171 since this is ready to land and we have added the not-land-on-v23

"import": [
"amaro/transform"
],
"disable-warning": "ExperimentalWarning",
"watch-path": "src",
"watch-preserve-output": true
}
}
```

Only flags that are allowed in [`NODE_OPTIONS`][] are supported.
In the `nodeOptions` field, only flags that are allowed in [`NODE_OPTIONS`][] are supported.
No-op flags are not supported.
Not all V8 flags are currently supported.

Expand Down
Loading
Loading