fix(npm): ship README + LICENSE in the published wrapper package#55
Conversation
The published @pleaseai/csp had no README (npm showed 'No README data found') because the generator wrote only package.json + bin/csp.js into npm/dist/csp. Copy the repo-root README.md and LICENSE into the wrapper so the npm page renders the full docs. npm always includes README.md/LICENSE regardless of the `files` allowlist (verified with npm pack --dry-run: README.md + LICENSE now in the tarball). Also refresh the stale npm/README.md internal note (status scaffold -> live, drop --provenance since OIDC Trusted Publishing generates provenance).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changesnpm Wrapper Asset Distribution
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Code Review
This pull request transitions the npm distribution wrapper to 'live' status, updating the documentation to reflect npm Trusted Publishing and modifying the generation script to copy the repository's README.md and LICENSE into the wrapper package. The reviewer recommended extending this by also copying the LICENSE file into each platform-specific package to ensure compliance with enterprise license-checking tools.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
No issues found across 2 files
Architecture diagram
sequenceDiagram
participant Repo as Repository Root
participant Generator as generate-platform-packages.mjs
participant Wrapper as npm/dist/csp
participant Npm as npm Registry
Note over Repo,Npm: Package Generation Flow
Generator->>Generator: Read version & assets directory
Generator->>Generator: Build wrapper package.json
Generator->>Generator: Create bin/csp.js from template
Generator->>Repo: Copy README.md
Generator->>Repo: Copy LICENSE
Repo-->>Generator: Files copied
Generator->>Wrapper: Write package.json
Generator->>Wrapper: Write bin/csp.js
Generator->>Wrapper: Copy README.md
Generator->>Wrapper: Copy LICENSE
Note over Wrapper,Npm: Published Package Contents
Wrapper-->>Npm: npm publish
Note over Npm: Tarball includes:<br/>- package.json<br/>- bin/csp.js<br/>- README.md<br/>- LICENSE
Npm->>Npm: Render README on package page
Ship LICENSE in each platform package too (not just the wrapper) — they publish independently, and license-compliance scanners (FOSSA, Snyk, license-checker) look for a LICENSE file in every package directory. Hoist repoRoot to the top so both the platform loop and the wrapper use it. (gemini)
Problem
The published
@pleaseai/csppackage has no README —npm view @pleaseai/csp readmereturnsNo README data found, so the npm page shows no documentation.The generator (
generate-platform-packages.mjs) writes onlypackage.json+bin/csp.jsintonpm/dist/csp, so nothing renders on npmjs.com.Fix
The generator now copies the repo-root
README.mdandLICENSEinto the wrapper dir. npm always includesREADME.md/LICENSEin the tarball regardless of thefilesallowlist.Verified with
npm pack --dry-runon the generated wrapper:Also refreshes the stale internal
npm/README.mdnote (scaffold → live; drops the--provenanceflag mention since OIDC Trusted Publishing generates provenance automatically).Effect
Takes effect on the next release (the current 0.1.4 npm package keeps its missing README until re-published). The npm page will then render the full root README — including the npm/crates.io/coverage/Socket badges once #54 merges.
Test plan
node --check+ eslint cleannpm pack --dry-runshows README.md + LICENSE in the tarballSummary by cubic
Fixes missing docs on the
@pleaseai/cspnpm page by shippingREADME.mdandLICENSEin the wrapper so npm renders docs. Also addsLICENSEto each platform package for license compliance.npm/scripts/generate-platform-packages.mjs) now copies repo-rootREADME.md+LICENSEinto the wrapper, andLICENSEinto every platform package.npm pack --dry-run; files are included in the tarball.npm/README.mdto mark the wrapper as live and drop--provenance(OIDC Trusted Publishing handles provenance).Written for commit 51d2f2c. Summary will update on new commits.
Summary by CodeRabbit
Documentation
@pleaseai/csppackage is a Rust-binary wrapper and to clarify the release flow and publishing behavior.Packaging / Distribution