Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.DS_Store
.vscode/
db.json
package-lock.json
dist/
node_modules/
src/content-replaced
Expand Down
9 changes: 6 additions & 3 deletions helpers/update-site/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const resources = [
'parser'
];

const documentationGlobbyPattern = `${constants.dirs.NODE_MODULES}/{hint,vscode-webhint,@hint/{${resources.join(',')}}-*}`;

const trimAndUnquote = (string) => {
return string.trim().replace(/^"|"$/, '');
};
Expand Down Expand Up @@ -169,14 +171,14 @@ const getResourcesFiles = async () => {
const imageFiles = [];

for (const resource of resources) {
const images = await globby([`${constants.dirs.NODE_MODULES}/{vscode-webhint,@hint/${resource}-*,@hint/configuration-all/node_modules/{vscode-webhint,@hint/${resource}-*}}/images/**/*`], { absolute: true });
const images = await globby([`${documentationGlobbyPattern}/images/**/*`], { absolute: true });

images.forEach((image) => {
imageFiles.push(getImageItemFromResource(image, resource));
});
}

const docs = await globby([`${constants.dirs.NODE_MODULES}/{vscode-webhint,@hint/{${resources.join(',')}}-*,@hint/configuration-all/node_modules/{vscode-webhint,@hint/{${resources.join(',')}}-*}}/{README.md,docs/*.md}`], { absolute: true });
const docs = await globby([`${documentationGlobbyPattern}/{README.md,docs/*.md}`], { absolute: true });

const promises = docs.map(async (doc) => {
const { content, frontMatter } = await getExistingContent(doc);
Expand Down Expand Up @@ -725,7 +727,8 @@ const createHintCategories = (files) => {
};

const updateChangelog = async () => {
const files = await globby([`${constants.dirs.NODE_MODULES}/{hint,vscode-webhint,@hint/{${resources.join(',')},configuration-all/node_modules/{vscode-webhint,@hint/{${resources.join(',')}}}-*}}/CHANGELOG.md`]);
/** All packages should be hoisted so no need to look inside `configuration-all` */
const files = await globby([`${documentationGlobbyPattern}/CHANGELOG.md`]);

const changelog = await files.reduce(async (totalPromise, file) => {
const total = await totalPromise;
Expand Down
Loading