[x] used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
Imagine models located as part of an external npm package. They are not all consumed by a codebase that needs or has knowledge of tsoa. For this reason it is not ideal to decorate each with @tsoamodel.
If a developer was able to specify multiple globs, including negations that are properly resolved, then we can support a configuration such as:
Where we ignore all node_modulesexcept a whitelisted package.
Current Behavior
With the current ignore definition in the config, the globs are resolved by minimatch which are resolved in such a way that we return early if any match is detected. See here for relevant lines.
Possible Solution
By moving to a glob-matching package that supports multi-globs being resolved as an array rather than one-by-one (there are many options here), we can improve support for configuration ignore globs.
Breaking change?
Difficult to say. The behaviour of the ignore configuration would change. I would argue in a non-breaking way, but this may be up for debate :)
I am happy to create a PR that adds support for the above via a library such as multimatch.
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Imagine models located as part of an external npm package. They are not all consumed by a codebase that needs or has knowledge of tsoa. For this reason it is not ideal to decorate each with
@tsoamodel
.If a developer was able to specify multiple globs, including negations that are properly resolved, then we can support a configuration such as:
Where we ignore all
node_modules
except a whitelisted package.Current Behavior
With the current
ignore
definition in the config, the globs are resolved byminimatch
which are resolved in such a way that we return early if any match is detected. See here for relevant lines.Possible Solution
By moving to a glob-matching package that supports multi-globs being resolved as an array rather than one-by-one (there are many options here), we can improve support for configuration ignore globs.
Breaking change?
Difficult to say. The behaviour of the
ignore
configuration would change. I would argue in a non-breaking way, but this may be up for debate :)I am happy to create a PR that adds support for the above via a library such as multimatch.