-
Notifications
You must be signed in to change notification settings - Fork 47
fix(generate): show help output when no arguments or config are provided #853
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
base: main
Are you sure you want to change the base?
Changes from all commits
42a47e6
1ef7ca1
40d5928
19da3ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,21 @@ export const createConfigFromCLIOptions = options => ({ | |
| chunkSize: options.chunkSize, | ||
| }); | ||
|
|
||
| /** | ||
| * Asserts that the CLI was given somewhere to read generator targets from: | ||
| * either explicit `--target` flags or a `--config-file` that supplies them. | ||
| * | ||
| * @param {import('../../../bin/commands/generate.mjs').CLIOptions} options - User-provided options | ||
| */ | ||
| export const assertRunnableOptions = options => { | ||
| if (!options.target && !options.configFile) { | ||
| throw new Error( | ||
| 'Either `--target` or `--config-file` must be provided. ' + | ||
| 'Run `doc-kit generate --help` for usage.' | ||
| ); | ||
| } | ||
|
cursor[bot] marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Runnable guard skips inputMedium Severity The new Additional Locations (1)Reviewed by Cursor Bugbot for commit 19da3ae. Configure here. |
||
| }; | ||
|
|
||
| /** | ||
| * Creates a complete run configuration by merging config file, user options, and defaults. | ||
| * Processes and validates configuration values including version coercion, changelog parsing, | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configFile check wrong object
Medium Severity
assertRunnableOptionsis run on the merged configuration fromsetConfig, but it still treatsconfigFileas if it were CLI options. Merged configs never carryconfigFile, so that branch never applies in the generate command. Users who only pass--config-filecan get an error implying they omitted it even when they did not.Additional Locations (1)
src/utils/configuration/index.mjs#L112-L119Reviewed by Cursor Bugbot for commit 19da3ae. Configure here.