This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
fix(types): Correctly describe and handle various include
option types
#302
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.
There are three places where this plugin is more permissive in its option types than its underlying
@sentry/cli
dependency:include
option: Can be given as a single path (either in string or descriptor object form) here, but must be an array for@sentry/cli
ignore
option: Can be given as a single path (a string) here, but must be an array for@sentry/cli
ignore
option ininclude
descriptor object: Can be given as a single path (a string) here, but must be an array for@sentry/cli
In other words, any of the following would. be fine for this plugin, but none would be okay for
@sentry/cli
:To compensate for this, we normalize the plugin options, fixing each of the problems detailed in the example, before we pass them to
@sentry/cli
. At least, that's what we're supposed to do. The possible problems and combinations of problems got more complicated when descriptor objectinclude
values were introduced in #299, and some of them were overlooked. This should fix that problem, as well as expand the tests to cover all scenarios.There also is currently a (related) problem with our types, which predates the aforementioned PR. In the types file here, we've been inheriting the
include
andignore
types from@sentry/cli
, even though those types are (theoretically) more permissive here than they are there. This also fixes that problem, redefining those types to include the looser options.