-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix components package README contributing link and duplicate footers #38605
Conversation
There was a problem hiding this 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:
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/block-editor/src/components/skip-to-selected-block/README.md?plain=1#L39: It uses
trunk
instead ofHEAD
. - https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/block-editor/src/components/block-types-list/README.md?plain=1#L52: It uses the commit SHA.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/block-editor/src/components/colors/README.md?plain=1#L40-L41: They are also commit SHAs.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/block-editor/src/components/skip-to-selected-block/README.md?plain=1#L39:
trunk
. - https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/block-editor/src/components/url-popover/README.md?plain=1: Four links here use relative paths.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/block-serialization-default-parser/README.md?plain=1#L3: Two links in this line use relative paths.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/blocks/README.md?plain=1#L60: Relative path.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/blocks/README.md?plain=1#L165: Relative path.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/components/src/button/README.md?plain=1: Relative paths on L204, L235, and L266.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/components/src/card/card/README.md?plain=1: Seven relative paths in this file.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/components/src/card/card-body/README.md?plain=1: Relative paths on L3 and L19.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/components/src/card/card-divider/README.md?plain=1: Relative paths on L3 and L23.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/components/src/card/card-footer/README.md?plain=1: Five relative paths in this file.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/core-data/README.md?plain=1: Relative paths on L3(1 link) and L5(2 links).
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/create-block/README.md?plain=1: Relative paths on L90, L96, L102, L108, L114, and L120.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/create-block-tutorial-template/README.md?plain=1#L3: Both links are relative paths.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/data/README.md?plain=1: Relative paths on L142 and L250.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/data-controls/README.md?plain=1#L3: Relative path.
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/edit-navigation/README.md?plain=1#L56: Not sure why this uses commit SHA?
- https://github.com/WordPress/gutenberg/blob/try/playwright-test/packages/edit-post/README.md?plain=1: Relative paths on L21, L23, and L210.
- ...Okay, that's probably too many to list them all.
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.
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! |
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? |
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 |
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