Skip to content

fix(ts-interface-generator): pass process.argv to yargs so CLI flags work#573

Merged
akudev merged 2 commits into
mainfrom
test/verbosity
May 12, 2026
Merged

fix(ts-interface-generator): pass process.argv to yargs so CLI flags work#573
akudev merged 2 commits into
mainfrom
test/verbosity

Conversation

@akudev
Copy link
Copy Markdown
Member

@akudev akudev commented May 11, 2026

The yargs v18 migration (bf53c43) rewrote the CLI from the singleton
pattern (yargs.option({...}).argv) to the factory pattern
(yargs().option({...}).argv). The factory creates a detached instance
that never reads process.argv, so --jsdoc, --watch, --config, and
--loglevel were all silently ignored — every run used defaults.

Fix: pass hideBin(process.argv) explicitly per the yargs v18 API.

Closes #542

…work

The yargs v18 migration (bf53c43) rewrote the CLI from the singleton
pattern (yargs.option({...}).argv) to the factory pattern
(yargs().option({...}).argv). The factory creates a detached instance
that never reads process.argv, so --jsdoc, --watch, --config, and
--loglevel were all silently ignored — every run used defaults.

Fix: pass hideBin(process.argv) explicitly per the yargs v18 API.

Closes #542
@akudev akudev changed the title test(ts-interface-generator): test for verbosity fix(ts-interface-generator): pass process.argv to yargs so CLI flags work May 12, 2026
@akudev akudev requested a review from Copilot May 12, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses @ui5/ts-interface-generator CLI flag parsing so --jsdoc minimal/none is correctly applied when invoked from the command line (root cause of issue #542), and adds regression tests around JSDoc preference behaviors.

Changes:

  • Pass hideBin(process.argv) into yargs(...) so CLI flags are actually parsed.
  • Add Jest tests validating JSDoc output differences for verbose, minimal, and none modes.
  • Add tests demonstrating the yargs factory behavior that led to the regression.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/ts-interface-generator/src/generateTSInterfaces.ts Fix CLI arg parsing by wiring process.argv into yargs via hideBin.
packages/ts-interface-generator/src/test/jsdocPreference.test.ts Add tests for JSDoc preference modes and yargs argv parsing behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ts-interface-generator/src/test/jsdocPreference.test.ts
Comment thread packages/ts-interface-generator/src/test/jsdocPreference.test.ts
Comment thread packages/ts-interface-generator/src/generateTSInterfaces.ts
@akudev akudev merged commit f8b3900 into main May 12, 2026
5 checks passed
@akudev akudev deleted the test/verbosity branch May 12, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ts-interface-generator] JSDoc Parameter is not respected

2 participants