Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Packer
Commits
fb0886b7
Unverified
Commit
fb0886b7
authored
4 years ago
by
Zach Shilton
Browse files
Options
Download
Email Patches
Plain Diff
website: Implement basic validation for plugin docs config
parent
1d485988
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.github/workflows/check-plugin-docs.js
+14
-0
.github/workflows/check-plugin-docs.js
with
14 additions
and
0 deletions
+14
-0
.github/workflows/check-plugin-docs.js
+
14
-
0
View file @
fb0886b7
...
...
@@ -20,6 +20,20 @@ async function checkPluginDocs() {
console
.
log
(
`\n
${
COLOR_BLUE
}${
repo
}${
COLOR_RESET
}
|
${
title
}
`
);
console
.
log
(
`Fetching docs from release "
${
version
}
" …`
);
try
{
const
undefinedProps
=
[
"
title
"
,
"
repo
"
,
"
version
"
,
"
path
"
].
filter
(
(
key
)
=>
typeof
pluginEntry
[
key
]
==
"
undefined
"
);
if
(
undefinedProps
.
length
>
0
)
{
throw
new
Error
(
`Failed to validate plugin docs. Undefined configuration properties
${
JSON
.
stringify
(
undefinedProps
)}
found for "
${
title
||
pluginEntry
.
path
||
repo
}
". In "website/data/docs-remote-plugins.json", please ensure the missing properties
${
JSON
.
stringify
(
undefinedProps
)}
are defined. Additional information on this configuration can be found in "website/README.md".`
);
}
const
docsMdxFiles
=
await
fetchPluginDocs
({
repo
,
tag
:
version
});
const
mdxFilesByComponent
=
docsMdxFiles
.
reduce
((
acc
,
mdxFile
)
=>
{
const
componentType
=
mdxFile
.
filePath
.
split
(
"
/
"
)[
1
];
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help