fix(generate): show help output when no arguments or config are provided#853
fix(generate): show help output when no arguments or config are provided#853bmuenzenmeyer wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The README Reviewed by Cursor Bugbot for commit 40d5928. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #853 +/- ##
==========================================
+ Coverage 84.60% 84.80% +0.19%
==========================================
Files 176 177 +1
Lines 15858 16214 +356
Branches 1411 1467 +56
==========================================
+ Hits 13417 13750 +333
- Misses 2431 2454 +23
Partials 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| File | Base | Head | Diff |
|---|---|---|---|
addons.js |
305.26 KB | 305.26 KB | +7.00 B (+0.00%) |
assert.js |
448.95 KB | 448.95 KB | +7.00 B (+0.00%) |
async_context.js |
213.43 KB | 213.43 KB | +7.00 B (+0.00%) |
async_hooks.js |
191.51 KB | 191.52 KB | +7.00 B (+0.00%) |
buffer.js |
1.08 MB | 1.08 MB | +7.00 B (+0.00%) |
child_process.js |
455.00 KB | 455.01 KB | +7.00 B (+0.00%) |
cli.js |
314.94 KB | 314.95 KB | +7.00 B (+0.00%) |
cluster.js |
188.56 KB | 188.57 KB | +7.00 B (+0.00%) |
console.js |
99.13 KB | 99.14 KB | +7.00 B (+0.01%) |
crypto.js |
1.22 MB | 1.22 MB | +7.00 B (+0.00%) |
debugger.js |
88.91 KB | 88.91 KB | +7.00 B (+0.01%) |
deprecations.js |
294.99 KB | 295.00 KB | +7.00 B (+0.00%) |
dgram.js |
179.27 KB | 179.28 KB | +7.00 B (+0.00%) |
diagnostics_channel.js |
303.25 KB | 303.26 KB | +7.00 B (+0.00%) |
dns.js |
261.77 KB | 261.77 KB | +7.00 B (+0.00%) |
documentation.js |
4.84 KB | 4.85 KB | +7.00 B (+0.14%) |
domain.js |
85.64 KB | 85.65 KB | +7.00 B (+0.01%) |
dtls.js |
82.81 KB | 82.82 KB | +7.00 B (+0.01%) |
embedding.js |
33.39 KB | 33.40 KB | +7.00 B (+0.02%) |
environment_variables.js |
11.70 KB | 11.70 KB | +7.00 B (+0.06%) |
errors.js |
362.34 KB | 362.35 KB | +7.00 B (+0.00%) |
esm.js |
131.90 KB | 131.91 KB | +7.00 B (+0.01%) |
events.js |
539.11 KB | 539.12 KB | +7.00 B (+0.00%) |
ffi.js |
97.13 KB | 97.14 KB | +7.00 B (+0.01%) |
fs.js |
1.27 MB | 1.27 MB | +7.00 B (+0.00%) |
globals.js |
122.78 KB | 122.79 KB | +7.00 B (+0.01%) |
http.js |
687.23 KB | 687.24 KB | +7.00 B (+0.00%) |
http2.js |
803.03 KB | 803.04 KB | +7.00 B (+0.00%) |
https.js |
155.41 KB | 155.42 KB | +7.00 B (+0.00%) |
inspector.js |
114.89 KB | 114.90 KB | +7.00 B (+0.01%) |
intl.js |
32.41 KB | 32.42 KB | +7.00 B (+0.02%) |
module.js |
331.70 KB | 331.70 KB | +7.00 B (+0.00%) |
modules.js |
146.23 KB | 146.24 KB | +7.00 B (+0.00%) |
n-api.js |
711.14 KB | 711.15 KB | +7.00 B (+0.00%) |
net.js |
294.67 KB | 294.68 KB | +7.00 B (+0.00%) |
os.js |
103.20 KB | 103.21 KB | +7.00 B (+0.01%) |
packages.js |
145.83 KB | 145.84 KB | +7.00 B (+0.00%) |
path.js |
91.92 KB | 91.92 KB | +7.00 B (+0.01%) |
perf_hooks.js |
353.78 KB | 353.79 KB | +7.00 B (+0.00%) |
permissions.js |
34.79 KB | 34.79 KB | +7.00 B (+0.02%) |
process.js |
695.92 KB | 695.92 KB | +7.00 B (+0.00%) |
punycode.js |
23.41 KB | 23.42 KB | +7.00 B (+0.03%) |
querystring.js |
26.14 KB | 26.14 KB | +7.00 B (+0.03%) |
quic.js |
442.59 KB | 442.59 KB | +7.00 B (+0.00%) |
readline.js |
217.31 KB | 217.32 KB | +7.00 B (+0.00%) |
repl.js |
205.07 KB | 205.08 KB | +7.00 B (+0.00%) |
report.js |
184.70 KB | 184.71 KB | +7.00 B (+0.00%) |
single-executable-applications.js |
80.17 KB | 80.18 KB | +7.00 B (+0.01%) |
sqlite.js |
254.82 KB | 254.82 KB | +7.00 B (+0.00%) |
stream.js |
854.40 KB | 854.40 KB | +7.00 B (+0.00%) |
stream_iter.js |
456.16 KB | 456.16 KB | +7.00 B (+0.00%) |
string_decoder.js |
26.63 KB | 26.63 KB | +7.00 B (+0.03%) |
synopsis.js |
11.39 KB | 11.40 KB | +7.00 B (+0.06%) |
test.js |
921.62 KB | 921.63 KB | +7.00 B (+0.00%) |
timers.js |
93.30 KB | 93.30 KB | +7.00 B (+0.01%) |
tls.js |
312.25 KB | 312.25 KB | +7.00 B (+0.00%) |
tracing.js |
72.75 KB | 72.75 KB | +7.00 B (+0.01%) |
tty.js |
43.05 KB | 43.05 KB | +7.00 B (+0.02%) |
typescript.js |
21.57 KB | 21.57 KB | +7.00 B (+0.03%) |
url.js |
331.00 KB | 331.00 KB | +7.00 B (+0.00%) |
util.js |
745.90 KB | 745.90 KB | +7.00 B (+0.00%) |
v8.js |
345.20 KB | 345.21 KB | +7.00 B (+0.00%) |
vfs.js |
43.09 KB | 43.09 KB | +7.00 B (+0.02%) |
vm.js |
432.13 KB | 432.14 KB | +7.00 B (+0.00%) |
wasi.js |
37.79 KB | 37.79 KB | +7.00 B (+0.02%) |
webcrypto.js |
423.06 KB | 423.06 KB | +7.00 B (+0.00%) |
webstreams.js |
280.37 KB | 280.37 KB | +7.00 B (+0.00%) |
worker_threads.js |
394.12 KB | 394.13 KB | +7.00 B (+0.00%) |
zlib.js |
359.52 KB | 359.53 KB | +7.00 B (+0.00%) |
| // Running `generate` with no arguments or config has nothing to do, so | ||
| // show the help output instead of failing later with an opaque error. | ||
| if (Object.keys(opts).length === 0) { | ||
| command.help(); | ||
| } |
There was a problem hiding this comment.
Shouldn't we just make certain arguments required instead?
i.e., --target OR --config-file MUST be provided.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1ef7ca1. Configure here.
…onfig file presence
| assertRunnableOptions(opts); | ||
|
|
||
| const config = await setConfig(opts); |
There was a problem hiding this comment.
swap these statements and call assertRunnableOptions on the config, checking that target and input is passed

Description
When using doc-kit, i tried
npx doc-kit generateonly to get the reported error. We can do better.We don't have any test coverage of this file, which I retained that pattern.
Validation
Before
After
Related Issues
closes #852
Check List
node --run testand all tests passed.node --run format&node --run lint.