From 4172bcfb2ffa95b77dc19c191d79f947ce7ce574 Mon Sep 17 00:00:00 2001 From: duharry0915 Date: Mon, 31 Aug 2026 16:32:40 -0700 Subject: [PATCH] chore: shrink the npm patch to the README gap Generator 0.38.10 routes packageIdentity into the launcher's package.json. description, license, keywords, homepage and author now come through on their own, which was the part that mattered -- dependency scanners reject unlicensed packages, and 1.1.0 shipped as "License: none" because of this. What it still does not do is ship the README. `files` lists only "bin/", and npm packs a README only when it sits beside package.json, so the package page renders blank. The patch is reduced to that: one `files` entry and the copy step that was already separate. The old anchor carried the whole metadata block, so the script aborted on the 1.2.0 regeneration rather than silently skipping -- working as designed, but the anchor had to follow upstream. Also records in the docstring that custom.rs now ships in the generated .fernignore; the entry stays in FERNIGNORE because that patch rewrites the whole file. Exercised against four trees: raw 0.38.10 output applies all three patches; a Fern Replay-processed branch reports every one already applied; a second run on the same tree is a no-op; and a tree with a deliberately mangled `files` line still aborts loudly. --- bin/post-regen-patch.py | 58 ++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/bin/post-regen-patch.py b/bin/post-regen-patch.py index c651e0b3..76d175c7 100755 --- a/bin/post-regen-patch.py +++ b/bin/post-regen-patch.py @@ -18,14 +18,19 @@ 1. repo assets restore CHANGELOG.md + SECURITY.md and protect them via .fernignore (custom.rs is the generator's own entry, preserved because this patch rewrites the whole file) - 2. npm metadata packageIdentity reaches Cargo.toml but not the published - npm package: license, keywords and README are absent and - the description is a hardcoded placeholder + 2. npm README the launcher package lists only "bin/" in `files`, so the + README never reaches npm and the package page is blank 3. windows defer the win32-x64 npm package (npm has the name spam-flagged; support ticket open). REMOVE THIS PATCH once npm clears it — cargo-dist still ships the Windows binary via the GitHub Release either way. + Dropped on 2026-08-31, fixed upstream in generator 0.38.10 and verified: + - packageIdentity now reaches the launcher package.json (description, + license, keywords, homepage, author) -- only the README remains + - custom.rs now ships in the generated .fernignore -- the entry is kept + in FERNIGNORE below only because this patch rewrites the whole file + Dropped on 2026-08-27, fixed upstream in generator 0.38.6 and verified: - launcher signal exit codes (128+signum) — now native - prerelease dist-tags (any SemVer prerelease, never latest) — now @@ -102,48 +107,23 @@ def patch_assets(root): ) -# ── 2. npm package metadata ─────────────────────────────────────────────────── -# The launcher's package.json is written inline in ci.yml and carries only -# name/version/bin/optionalDependencies plus a hardcoded "CLI for agentmail" -# description. Everything set in packageIdentity — license, keywords, the real -# description — reaches Cargo.toml and stops there, so npm renders the package -# with "License: none", no keywords and no README. The license gap is not -# cosmetic: dependency scanners reject unlicensed packages. -PKGJSON_OLD = """ "description": "CLI for agentmail", - "repository": { - "type": "git", - "url": "https://github.com/agentmail-to/agentmail-cli" - }, - "bin": { - "agentmail": "bin/cli.js" - }, - "optionalDependencies": { - ${OPTIONAL_DEPS} - }, - "files": ["bin/"]""" - -PKGJSON_NEW = """ "description": "Command-line interface for the AgentMail API. Send, receive, reply, and manage threaded email conversations from your terminal.", - "license": "MIT", - "keywords": ["email", "api", "cli", "agent", "agentmail"], - "homepage": "https://agentmail.to", - "repository": { - "type": "git", - "url": "https://github.com/agentmail-to/agentmail-cli" - }, - "bin": { - "agentmail": "bin/cli.js" - }, - "optionalDependencies": { - ${OPTIONAL_DEPS} - }, - "files": ["bin/", "README.md"]""" +# ── 2. npm package README ───────────────────────────────────────────────────── +# Generator 0.38.10 routes packageIdentity into the launcher's package.json -- +# description, license, keywords, homepage and author now come through, which +# was the part that mattered (dependency scanners reject unlicensed packages). +# What it still does not do is ship the README: `files` lists only "bin/", and +# npm packs a README only when it sits beside package.json, so the package +# renders with no documentation on npmjs.com. +PKGJSON_OLD = """ "files": ["bin/"]""" + +PKGJSON_NEW = """ "files": ["bin/", "README.md"]""" README_COPY = ' cp README.md "${PKG_DIR}/README.md"\n' def patch_pkgjson(root): ci = root / ".github/workflows/ci.yml" - patch("npm package metadata", ci, PKGJSON_OLD, PKGJSON_NEW) + patch("npm package README (files)", ci, PKGJSON_OLD, PKGJSON_NEW) # npm only packs a README that sits beside package.json. s = ci.read_text() if README_COPY in s: