DevExtreme CLI: --empty flag incorrectly parsed as string instead of boolean #1001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
When creating a new React app with explicit CLI parameters, the
--empty falseflag fails to create sample pages, even though it should include them.Expected behavior:
Actual behavior:
Workaround that works:
npx devextreme-cli new react-app MyApp # Interactive prompts work correctly and create pagesRoot Cause
The
minimistargument parser was treating--empty falseas a string"false"instead of a booleanfalse. This caused the conditional check in application.react.js to fail:When
templateOptions.empty = "false"(string):!templateOptions.emptyevaluates tofalse(non-empty strings are truthy)When
templateOptions.empty = false(boolean):!templateOptions.emptyevaluates totrueSolution
Configure
minimistto parse the--emptyflag as a boolean type by adding it to thebooleanarray in the parser options:This ensures
--empty false,--empty true, and--emptyare all parsed as proper boolean values, making the flag behavior consistent regardless of how it's specified.Ticket ID: T1311643