Skip to content

fix(package): ship the audit subpath in the published build - #120

Merged
mr-kelly merged 1 commit into
mainfrom
cursor/fix-audit-export-889a
Nov 20, 2026
Merged

mr-kelly merged 1 commit into
mainfrom
cursor/fix-audit-export-889a

Conversation

@mr-kelly

@mr-kelly mr-kelly commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Verification: 🟢 Fully verified

Problem and fix

The package advertises busabase-package/audit, but its build omits the entry files. Add the existing audit source to the build entry map so packed consumers receive both JavaScript and declarations.

Validation

Built and packed the public source, installed its tarball into a fresh consumer with its own TypeScript, and compiled and executed real imports of auditPackage and auditSkill. A valid parsed package has no findings; a mismatched directory produces the expected package/identity finding. Both dist/audit.js and dist/audit.d.ts are present and the packed export map points to them.

Packed-consumer verification transcript and artifact checksum.

Known risk: none identified in the changed export path. No visual change.

Fixes #118

publishConfig already exports ./audit, but tsdown never compiled
src/audit.ts, so dist/audit.js and dist/audit.d.ts were absent from
the package tarball.

Fixes #118

Co-authored-by: Kelly Peilin Chan <[email protected]>
@mr-kelly

Copy link
Copy Markdown
Contributor Author

Verification level: 🟢 Full verification — I independently built, packed, installed, imported, and typechecked the published ./audit subpath. This is a package-only change, so there is no UI screenshot.

Problem

busabase-package advertises import { auditPackage, auditSkill } from "busabase-package/audit", but the published npm tarball does not contain dist/audit.js or dist/audit.d.ts. Consumers get ERR_MODULE_NOT_FOUND / TS2307. This is still true on npm 1.5.0.

Root cause

src/audit.ts and publishConfig.exports["./audit"] were already present, but tsdown.config.ts never listed audit as an entry, so the build never emitted those files.

Fix

The PR adds one entry, audit: "src/audit.ts", to the tsdown entry map. I re-read the diff: that is the only change.

Validation

  • Method: I checked out 9009a08 and ran this myself, rather than relying on the PR description. Package typecheck and biome check on tsdown.config.ts both passed. I built the package, packed it, installed that tarball in a fresh consumer, imported the subpath at runtime, and typechecked the consumer with module / moduleResolution: nodenext. I then reverted the one-line change, rebuilt, and packed again as a baseline. I also ran the existing busabase-package test suite on the PR revision.
  • Result:
    • With this PR: dist/audit.js is 14,628 bytes and dist/audit.d.ts is 2,110 bytes. Both export auditPackage and auditSkill. The packed tarball contains those files, and package.json exports["./audit"] points at them. The declaration file does not leak a busabase-contract import. In the consumer, import("busabase-package/audit") resolves to functions, and tsc accepts import { auditPackage, auditSkill } from "busabase-package/audit".
    • Baseline without this line: dist/audit.js is absent, and the packed tarball contains no audit files — matching the reported bug.
    • Existing package tests: 24 files, 339 tests, all passed.
  • Verification level: 🟢 Full verification — the real publish path (build → pack → install tarball → import → consumer tsc) was exercised, and the baseline confirms the same path fails without this line.
  • Known risk / not covered:
    • Merging this does not fix the already-published [email protected] tarball. The issue stays broken on npm until a new version is released.
    • There is still no test that keeps the tsdown entry map in sync with publishConfig.exports, so this class of bug could regress.
    • At review time, GitHub checks test, coverage, and e2e were still running. Lint, typecheck, Email SDK package, and Docker build had already passed. I did not wait for those remaining checks, and I did not run the full monorepo e2e suite locally.

No screenshots: nothing user-visible changed, and verification did not go through a browser.

@mr-kelly
mr-kelly merged commit 91e0126 into main Nov 20, 2026
9 checks passed
@mr-kelly
mr-kelly deleted the cursor/fix-audit-export-889a branch November 20, 2026 04:38
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.

[Bug]: busabase-package "./audit" export is missing from built dist files

2 participants