-
Notifications
You must be signed in to change notification settings - Fork 237
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
Adding plugin metadata to validator #2297
Conversation
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.
Looks good to me
lib/plugins/plugin-validator.js
Outdated
errors.push(`meta.urls.${key} doesn't appear to be a public URL`) | ||
} | ||
|
||
const unknownVariables = (url.match(/\{\{(\w+)\}\}/g) || []).map(x => `${x}`).filter(variable => !allowedVariables.includes(variable)) |
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.
Webstorm is reporting Redundant character escape '\}' in RegExp
. The url.match can be replaced with url.match(/\{\{(\w+)}}/g)
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.
Fixed, would you mind re-reviewing?
ea6eb2b
to
1777523
Compare
#2296
The format I've chosen is:
I'm allowing for two variables in the URLs
{{version}}
- the version number of the plugin{{kitVersion}}
- the version number of the kit that's runningI'm using both of these variables in the govuk-prototype-kit project which has the meta set to:
These variables allow plugin developers to point to release-specific URLs, and also to tailor documentation to the kit version.
I've added
?linkFromKit={{kitVersion}}%3A{{version}}
to the kit documentation link so that we can show warnings on the website if we need to later for specific versions.