sindresorhus/refined-github

Support more filenames in `link-to-changelog-file` #3999

jack1142 posted onGitHub

While CHANGELOG is one way people call changelog files, it is not the only popular one out there. I've personally seen CHANGES, NEWS, and HISTORY used often too.

I think that names supported by dependabot are a good reference on what names are used in the wild.


posted by tooomm about 4 years ago

Yeah, it should be linking to a changelog file, not the folder with changelog fragments. It seems that this has been mentioned in https://github.com/sindresorhus/refined-github/pull/4005#issuecomment-782845287, but I'm not sure if there was a reason for this to not be updated.

If detecting folders was intentional, I think the extension should at least prioritize the files but I'm not sure what was the original intention here.

posted by jack1142 about 4 years ago

If detecting folders was intentional, I think the extension should at least prioritize the files but I'm not sure what was the original intention here.

šŸ‘

https://github.com/sindresorhus/refined-github/blob/d5b8ecf08b6a5d63127c2e4308da71383ec5c63e/source/features/link-to-changelog-file.tsx#L26

Adding a simple .reverse() should work here

https://github.com/sindresorhus/refined-github/blob/d5b8ecf08b6a5d63127c2e4308da71383ec5c63e/source/features/link-to-changelog-file.tsx#L43

It might work ā¬†ļø too but I am not sure.

posted by yakov116 about 4 years ago

Unfortunately a reverse would also catch changelog.3.md over changelog.md

Maybe we should just filter both by type, then only match exactly * and *.*, never *.*.*

posted by fregante about 4 years ago

Api might be simple to do that. DOM not so much, It would require another select to check the icon

posted by yakov116 about 4 years ago

Select the icon first, get the filename from there.

posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests