Skip to content

Commit

Permalink
Merge pull request #2376 from alphagov/fix-plugin-config-schema-comment
Browse files Browse the repository at this point in the history
Fix plugin config schema comment
  • Loading branch information
BenSurgisonGDS authored Nov 20, 2023
2 parents 71623da + 5b3058b commit d1ec553
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions lib/plugins/plugins.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* plugins.js (Use with caution)
*
* Experimental feature which is likely to change.
* This file returns helper methods to enable services to include
* their own departmental frontend(Styles, Scripts, nunjucks etc)
*
Expand All @@ -15,21 +13,32 @@
*
* // govuk-prototype-kit.config.json
* {
* "assets": path | path[],
* "importNunjucksMacrosInto": path | path[],
* "nunjucksPaths": path | path[],
* "nunjucksFilters": path | path[],
* "sass": path | path[],
* "scripts": path | path[],
* "stylesheets": path | path[],
* "assets": string | string[],
* "importNunjucksMacrosInto": string | string[],
* "meta": {
* "description": string,
* "urls": {
* "documentation": string,
* "versionHistory": string,
* "releaseNotes": string
* }
* },
* "nunjucksMacros": {"importFrom": string, "macroName": string} | {"importFrom": string, "macroName": string}[],
* "nunjucksPaths": string | string[],
* "nunjucksFilters": string | string[],
* "nunjucksFunctions": string | string[],
* "pluginDependencies": [{"packageName": string, "minVersion": string, "maxVersion": string}],
* "sass": string | string[],
* "scripts": string | string[] | {"path": string, "type": string} | {"path": string, "type": string}[],
* "stylesheets": string | string[],
* "templates": {
* "name": string,
* "path": path,
* "path": string,
* "type": string
* }[]
* }
*
* Note that all of the top-level keys are optional.
* Note that all the top-level keys are optional.
*
*/

Expand Down Expand Up @@ -83,7 +92,7 @@ function getPluginConfig (packageName) {
/**
* Handle errors to do with plugin paths
* @param {{ packageName: string, item: string }} subject - For example { packageName: 'govuk-frontend', item: '/all.js' }
* @throws if path in item is badly formatted
* @throws when path in item is badly formatted
*/
function throwIfBadFilepath (subject) {
if (('' + subject.item).indexOf('\\') > -1) {
Expand Down

0 comments on commit d1ec553

Please sign in to comment.