Skip to content

fix(npm): ship README + LICENSE in the published wrapper package - #55

Merged
amondnet merged 2 commits into
mainfrom
fix/npm-wrapper-readme
Jun 22, 2026
Merged

fix(npm): ship README + LICENSE in the published wrapper package#55
amondnet merged 2 commits into
mainfrom
fix/npm-wrapper-readme

Conversation

@amondnet

@amondnetamondnet commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Problem

The published @pleaseai/csp package has no READMEnpm view @pleaseai/csp readme returns No README data found, so the npm page shows no documentation.

The generator (generate-platform-packages.mjs) writes only package.json + bin/csp.js into npm/dist/csp, so nothing renders on npmjs.com.

Fix

The generator now copies the repo-root README.md and LICENSE into the wrapper dir. npm always includes README.md/LICENSE in the tarball regardless of the files allowlist.

Verified with npm pack --dry-run on the generated wrapper:

npm notice Tarball Contents
npm notice 1.1kB LICENSE
npm notice 20.6kB README.md
npm notice 2.8kB bin/csp.js
npm notice 765B package.json

Also refreshes the stale internal npm/README.md note (scaffold → live; drops the --provenance flag 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 clean
  • npm pack --dry-run shows README.md + LICENSE in the tarball

Summary by cubic

Fixes missing docs on the @pleaseai/csp npm page by shipping README.md and LICENSE in the wrapper so npm renders docs. Also adds LICENSE to each platform package for license compliance.

  • Bug Fixes
    • Generator (npm/scripts/generate-platform-packages.mjs) now copies repo-root README.md + LICENSE into the wrapper, and LICENSE into every platform package.
    • Verified with npm pack --dry-run; files are included in the tarball.
    • Takes effect on the next publish; updates npm/README.md to 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

    • Updated the npm documentation to reflect that the published @pleaseai/csp package is a Rust-binary wrapper and to clarify the release flow and publishing behavior.
  • Packaging / Distribution

    • Included the repository README and LICENSE in the published npm packages, including the top-level wrapper, to improve visibility directly on the npm page.

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).
@coderabbitai

coderabbitaiBot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f8ead7c1-36b6-4957-b0b3-55331df0d75e

📥 Commits

Reviewing files that changed from the base of the PR and between ebd8841 and 51d2f2c.

📒 Files selected for processing (1)
  • npm/scripts/generate-platform-packages.mjs

📝 Walkthrough

Walkthrough

The generate-platform-packages.mjs script now resolves the repository root directory and copies README.md and LICENSE into both per-platform package directories and the wrapper package directory (npm/dist/csp/). The npm/README.md is updated to mark the wrapper as live since v0.1.4, document the asset-copy steps, and revise the release flow to use OIDC Trusted Publishing instead of an explicit --provenance flag.

Changes

npm Wrapper Asset Distribution

Layer / File(s)Summary
Add repo root asset copying to generation script
npm/scripts/generate-platform-packages.mjs
The script resolves the repository root path and copies the LICENSE file into each generated per-platform package directory. It also copies the root README.md and LICENSE into the wrapper output directory (dist/csp/) for publication.
Document live wrapper status and asset publishing
npm/README.md
The wrapper status changes to "live" and documentation now describes the README.md and LICENSE copy behavior. The release flow section is updated to remove the explicit --provenance flag and clarify that provenance is generated automatically via npm Trusted Publishing (OIDC).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • pleaseai/code-search#42: Updates CI publishing flow to generate and publish platform/wrapper npm packages using the updated generate-platform-packages script with OIDC-based Trusted Publishing for provenance.

Poem

🐇 Hop hop, the wrapper's alive!
README and LICENSE now arrive,
Copied neat into the dist,
No provenance flag is missed—
OIDC does the trick,
Publishing smooth and quick! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely summarizes the main change: adding README and LICENSE files to the published npm wrapper package, which directly addresses the core issue of missing documentation on npmjs.com.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/npm-wrapper-readme

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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

@codacy-production

codacy-productionBot commented Jun 22, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment threadnpm/scripts/generate-platform-packages.mjs Outdated
@codecov

codecovBot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cubic-dev-aicubic-dev-aiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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
Loading

Re-trigger cubic

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)
@amondnet
amondnet merged commit efff12b into mainJun 22, 2026
7 checks passed
@amondnet
amondnet deleted the fix/npm-wrapper-readme branch June 22, 2026 14:28
Sign up for freeto 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

@amondnet