feat(ui-devkit): Add "exclude" option to UI extensions #2009
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.
Context
As custom UI extensions mature, a Vendure developer might want to write unit tests or perhaps Storybook stories and choose to colocate them with the corresponding component. Currently, UI Devkit copies everything inside the
extensionPath
directory, which could also bring unintended files to the output.Proposed solution
Allow developers to optionally specify files within their UI extension to be skipped during the copy process.
Description of changes
@vendure/ui-devkit
to support a new optionalexclude
property inAdminUiExtension
objects, which takes a string array and works the exact same way as TypeScript'stsconfig.json
counterpart.typescript-doc-parser.ts
to support escaped/*
tokens in comment descriptions. I decided to introduce this additional change because the best example ofexclude
is using a globstar pattern, which causes a multi-line comment to end. Escaping it using the same existing approach as the@
token seemed like an obvious choice, however, I'm more than happy not to include changes to that logic and use a different pattern in theexclude
comment description.