Skip to content

Commit 45b5c3d

Browse files
committed
Fix: Display full changelog
The project had different versions of the same package because of how hoisting works, `hint`'s `optionalDependencies` (the configurations are not the latest ones) and how npm handles duplicates and `package-lock.json`. By removing `package-lock.json` npm will always go fetch the latest version of the packages and avoid these issues. Also all packages will be installed in `node_modules` and not inside another folder under it. Because multiple versions of the same package, the changelog was not always accurate. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Fix #825
1 parent febd167 commit 45b5c3d

File tree

4 files changed

+7
-21017
lines changed

4 files changed

+7
-21017
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.DS_Store
44
.vscode/
55
db.json
6+
package-lock.json
67
dist/
78
node_modules/
89
src/content-replaced

helpers/update-site/documentation.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ const resources = [
6363
'parser'
6464
];
6565

66+
const documentationGlobbyPattern = `${constants.dirs.NODE_MODULES}/{hint,vscode-webhint,@hint/{${resources.join(',')}}-*}`;
67+
6668
const trimAndUnquote = (string) => {
6769
return string.trim().replace(/^"|"$/, '');
6870
};
@@ -169,14 +171,14 @@ const getResourcesFiles = async () => {
169171
const imageFiles = [];
170172

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

174176
images.forEach((image) => {
175177
imageFiles.push(getImageItemFromResource(image, resource));
176178
});
177179
}
178180

179-
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 });
181+
const docs = await globby([`${documentationGlobbyPattern}/{README.md,docs/*.md}`], { absolute: true });
180182

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

727729
const updateChangelog = async () => {
728-
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`]);
730+
/** All packages should be hoisted so no need to look inside `configuration-all` */
731+
const files = await globby([`${documentationGlobbyPattern}/CHANGELOG.md`]);
729732

730733
const changelog = await files.reduce(async (totalPromise, file) => {
731734
const total = await totalPromise;

0 commit comments

Comments
 (0)