Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui-devkit): Add "exclude" option to UI extensions #2009

Conversation

vrosa
Copy link
Contributor

@vrosa vrosa commented Jan 26, 2023

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

  • Update @vendure/ui-devkit to support a new optional exclude property in AdminUiExtension objects, which takes a string array and works the exact same way as TypeScript's tsconfig.json counterpart.
  • Update typescript-doc-parser.ts to support escaped /* tokens in comment descriptions. I decided to introduce this additional change because the best example of exclude 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 the exclude comment description.

@michaelbromley michaelbromley merged commit dd6eee3 into vendure-ecommerce:minor Jan 31, 2023
@michaelbromley
Copy link
Member

I'm very happy that you and your team are exercising the admin ui extensions heavily and finding these points to improve! Thanks again!

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.

2 participants