Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix components package README contributing link and duplicate footers #38605

Merged
merged 3 commits into from
Feb 8, 2022

Conversation

talldan
Copy link
Contributor

@talldan talldan commented Feb 8, 2022

Description

I noticed the components package has a link to its own contributing.md file that uses a relative path. When npm displays the README file, it doesn't seem to handle that well resulting in a broken link. Testing some other links it seems npm prefers absolute paths - https://www.npmjs.com/package/@wordpress/components

This PR updates the path and also removes some duplicate 'Code is poetry' footers from README files which had somehow ended up in the middle of some files.

Note - the changes from #38122 haven't been published yet, but this is just something I noticed when checking whether they had.

Types of changes

Docs

@talldan talldan added the [Type] Developer Documentation Documentation for developers label Feb 8, 2022
@talldan talldan changed the title Fix components package contributing link in npm and duplicate footer Fix components package contributing link in npm and duplicate footers Feb 8, 2022
@talldan talldan changed the title Fix components package contributing link in npm and duplicate footers Fix components package README contributing link and duplicate footers Feb 8, 2022
@talldan talldan requested a review from ciampo February 8, 2022 05:29
Copy link
Member

@kevin940726 kevin940726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

I also did some searching and found these as well:

Most README.md in packages/components/* use relative paths as well. We can probably write a simple codemod to change them all. Bonus point if we can write a lint rule to guard them (maybe there's already one in the community?)

Not that we have to do this in this PR though, we can merge this and iterate if needed.

@talldan
Copy link
Contributor Author

talldan commented Feb 8, 2022

Thanks for the review, Kai!

Wow, yeah, there's a lot. I guess a find and replace would probably work for a lot of them. I'll try it in a separate PR and see how it goes!

@talldan talldan merged commit 4a4e32d into trunk Feb 8, 2022
@talldan talldan deleted the fix/components-package-contributing-link-in-npm branch February 8, 2022 07:30
@github-actions github-actions bot added this to the Gutenberg 12.6 milestone Feb 8, 2022
@ciampo ciampo added the [Package] Components /packages/components label Feb 8, 2022
@ciampo
Copy link
Contributor

ciampo commented Feb 8, 2022

Most README.md in packages/components/* use relative paths as well

My understanding is that the pattern that we want to avoid is a file referencing itself via a "relative" path — in case that's true, then I believe that most (if not all) paths that you flagged should be ok?

@talldan
Copy link
Contributor Author

talldan commented Feb 8, 2022

It seems like it's probably an npm bug. Maybe it worked before, but now lots of the links definitely seem broken.

It doesn't seem as many as @kevin940726 pointed out. I think we only really have to worry about the main package README file, as that's all npm shows. For the other files, github knows how to handle the relative links.

Here's a PR that fixes some more - #38609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants