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: add validator run event to allow plugins to perform custom validation #2184
Conversation
d493ad7
to
2052114
Compare
I don't think I want the validator to be a separate thing - it's not nearly complicated enough to deserve that... I'd rather just add the validate event to If it does deserve pulling out into its own class someday - I'd still want to avoid the component and emit that event from the application I think... I'm not convinced that there's value for plugins in seeing a new class. |
2052114
to
d97d3b8
Compare
d97d3b8
to
ccdaa2c
Compare
@Gerrit0 I've reworked this PR to address those issues :) |
When working on my plugin that relies on this PR, |
src/lib/application.ts
Outdated
* Emitted when validation is being run. | ||
* The listener will be given an instance of {@link ProjectReflection}. | ||
*/ | ||
static readonly EVENT_VALIDATION_RUN = ApplicationEvents.VALIDATION_RUN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think validateProject
might be better - it immediately implies that the callback will be passed a project, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So ApplicationEvents.VALIDATE_PROJECT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, and validateProject
for the string, otherwise lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's all set up :)
Thanks! Should release today. |
Just realized I forgot to answer this -- |
fix #2183