Skip to content

Conversation

@jamesrweb
Copy link
Member

Related Issue

N / A

PR Type

  • 🐛 Bug Fix
  • ✨ New Feature
  • 🔨 Code Refactor
  • 📝 Documentation Update
  • 🧪 Test Update
  • 🔧 Build/CI Update
  • 🧹 Chore
  • ⏪ Revert

Description

In the last deployment for v5.0.0-rc.4, the project README.md was not deployed since it is now in a different root directory.

Proposed Changes

  • Copy the readme to the root pre-deploy
  • Remove it from the root post-deploy
  • Add it to the list of files in the package.json to make it mandatory

How Has This Been Tested?

  • Unit Tests
  • Integration Tests
  • Manual Testing (please describe)

Tested by running pnpm publish --tag next --dry-run --no-git-checks.

Screenshots/Recordings

N / A

Breaking Changes

  • Yes (please describe)
  • No

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • My changes generate no new warnings

Additional Notes

N / A

@jamesrweb jamesrweb self-assigned this Aug 18, 2025
@jamesrweb jamesrweb added bug documentation Pull requests that update project documentation labels Aug 18, 2025
@jamesrweb jamesrweb requested a review from yevdyko as a code owner August 18, 2025 15:39
@github-actions
Copy link

Coverage report for commit: 7892f66
File: ./coverage/clover.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
 100% │ ███████████████████████ │ 100.0%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 100.00% | Methods: 100.00% | Branches: 91.30%
FilesLinesMethodsBranches
src/components
   ReactP5Wrapper.tsx100.00%100.00%100.00%
   ReactP5WrapperGuard.tsx100.00%100.00%72.73%
   ReactP5WrapperWithSketch.tsx100.00%100.00%88.89%
src/constants
   P5WrapperClassName.ts100.00%100.00%100.00%
src/contracts
   CanvasInstanceRef.ts100.00%100.00%100.00%
   InputProps.ts100.00%100.00%100.00%
   P5CanvasInstance.ts100.00%100.00%100.00%
   P5WrapperProps.ts100.00%100.00%100.00%
   P5WrapperPropsWithSketch.ts100.00%100.00%100.00%
   Sketch.ts100.00%100.00%100.00%
   SketchProps.ts100.00%100.00%100.00%
   WithChildren.ts100.00%100.00%100.00%
   Wrapper.ts100.00%100.00%100.00%
   WrapperRef.ts100.00%100.00%100.00%
   p5.ts100.00%100.00%100.00%
src
   main.tsx100.00%100.00%100.00%
src/utils
   createCanvasInstance.ts100.00%100.00%100.00%
   logErrorBoundaryError.ts100.00%100.00%100.00%
   propsAreEqual.ts100.00%100.00%100.00%
   removeCanvasInstance.ts100.00%100.00%100.00%
   updateCanvasInstance.ts100.00%100.00%100.00%
   withoutKeys.ts100.00%100.00%100.00%

🤖 comment via lucassabreu/comment-coverage-clover

"integrate": "pnpm format:check && pnpm lint && pnpm test && pnpm build",
"lint": "eslint --config config/eslint/eslint.config.ts",
"lint:fix": "pnpm lint --fix",
"prepublishOnly": "cp .github/README.md ./README.md",
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, why such a complication and why not put it in the root of the repository as usual? I think the files inside the ".github" directory only relate to the Github configuration and README is needed for documentation regardless of the provider. What don't I know?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same discussion we had about the configs, I just prefer as much to not be in the root directory as possible and .github is one of three places it can't be kept, so it's grouped with other related documents. Besides, the pre and post setup is standard to NPM itself and so works well for the use case anyway since it's only an issue for NPM deployments anyway.

Copy link
Contributor

@yevdyko yevdyko Aug 18, 2025

Choose a reason for hiding this comment

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

I think this bug highlights that the current solution might be more of a workaround than an improvement and now we’re considering adding an extra hack on top.

According to the GitHub style guide, the README “should be located in the top-level directory for your product or library’s actual codebase”:

https://google.github.io/styleguide/docguide/READMEs.html#what-to-put-in-your-readme

If we move it to the root, contributors and visitors can immediately understand the project without digging into subfolders.

We could technically add a copy command in a prepublishOnly script, but that only runs right before publishing. It wouldn’t help with local development or repo clarity, and it adds unnecessary complexity. Keeping the README in the root is simpler, avoids extra steps and follows convention. Why not keep it simple? 😀

Copy link
Member Author

@jamesrweb jamesrweb Aug 18, 2025

Choose a reason for hiding this comment

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

The README is read out of the GitHub directory for the repo and temporarily copied for the NPM deployment. I honestly don't see an issue 😅. I do see your point that the two extra scripts are not needed but I don't think it's an issue to have them and it keeps the root cleaner to me. In saying that, if you insist on it being in the root for conventions sake... maybe. I'm still not convinced but if you insist I suppose I can live with that argument but I still prefer it tidied into the GitHub directory personally since it's a supported location and it's only NPM that needs the deploy scripts which have 0 overhead. Let me know what your opinion is and we can see what to do 🤷🏻‍♂️.

@jamesrweb jamesrweb merged commit 4df3752 into master Aug 19, 2025
10 checks passed
@jamesrweb jamesrweb deleted the fix-readme-deployment-issue branch August 19, 2025 10:18
@jamesrweb
Copy link
Member Author

Merged for now. We can discuss moving the README to the root again as a follow up, want to make sure people can actually see the docs on NPM for now though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug documentation Pull requests that update project documentation github-actions npm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants