Skip to content

Copy README and LICENSE into dist#31

Merged
gentamura merged 1 commit intomainfrom
chore/copy-readme-license
Oct 23, 2025
Merged

Copy README and LICENSE into dist#31
gentamura merged 1 commit intomainfrom
chore/copy-readme-license

Conversation

@gentamura
Copy link
Member

@gentamura gentamura commented Oct 23, 2025

Summary

  • extend write-dist-manifest script to copy README.md and LICENSE into each dist folder
  • ensures publishConfig.directory="dist" packages retain documentation files on npm

Summary by CodeRabbit

  • Chores
    • Improved the distribution build process to ensure static assets (README.md, LICENSE) are included in the distribution package with enhanced error handling for missing or failed asset operations.

@coderabbitai
Copy link

coderabbitai bot commented Oct 23, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The script scripts/write-dist-manifest.mjs now includes logic to copy static assets (README.md and LICENSE) into the dist directory before finalizing the manifest. Helper predicates for type checking were added, and error handling distinguishes between missing files and copy failures.

Changes

Cohort / File(s) Summary
Dist manifest asset copying
scripts/write-dist-manifest.mjs
Added imports for copyFile and stat from node:fs/promises; introduced helper predicates isRecord() and isErrnoWithCode() for type validation; implemented asset copying logic for README.md and LICENSE with existence checks and granular error handling (skip on ENOENT, throw on other errors); reordered control flow to execute asset copying before manifest serialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A rabbit's hop, a copy spree,
README and LICENSE bundled free,
Into dist they swiftly go,
Before the manifest's grand show! 📦

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/copy-readme-license

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e7cdf29 and dc04830.

📒 Files selected for processing (1)
  • scripts/write-dist-manifest.mjs (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gentamura gentamura merged commit 5bbedc8 into main Oct 23, 2025
4 of 5 checks passed
@gentamura gentamura deleted the chore/copy-readme-license branch October 23, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant