Skip to content

fix: ship react.d.ts again, mirror invoice-kit's refunds (1.12.1) - #20

Merged
BackStacked merged 1 commit into
mainfrom
claude/project-thread-dsh6g4
Nov 12, 2026
Merged

BackStacked merged 1 commit into
mainfrom
claude/project-thread-dsh6g4

Conversation

@BackStacked

Copy link
Copy Markdown
Contributor

🤖 Generated with Claude Code

https://claude.ai/code/session_018jBohnZEym7gZYsPkBCmVg

Why

report-studio's main fails its typecheck in two ways:

  • Could not find a declaration file for module '@mgpl-diagnostics/client/react', followed by implicit-any errors in every page that uses the hooks.
  • The contract check TotalsOut fails, because invoice-kit 2.1.0 added refunds and the client didn't follow.

What changed

react.d.ts. tsup.config.ts has two configs that tsup builds in parallel into dist/. The first one had clean: true, so it sometimes deleted dist/react.d.ts after the second config had written it. Locally, 1 build in 3 came out without the file, and 1.10.0 to 1.12.0 were published without it.

  • npm run build now empties dist/ once and then runs tsup. Neither config cleans anymore. prepare runs the same build.
  • The new scripts/check-dist.mjs fails the build if any file named in package.json main, types or exports is missing. It caught the deleted file when I removed it by hand.

Contract. Mirrors invoice-kit src/types.ts and src/calc.ts:

  • PaymentStatus adds "REFUNDED" and "CANCELLED".
  • InvoiceTotals adds refunded.
  • Payment adds kind?: "payment" | "refund".

docs/api.md and llms-full.txt are updated to match. The version goes to 1.12.1.

Checks

  • npm run typecheck and npm run build: five builds in a row, each with all 7 export files.
  • I ran report-studio's TotalsOut and PaymentIn assertions against invoice-kit's main source. They pass with this change and fail without it.

After merge, push the v1.12.1 tag. report-studio's ^1.0.0 range then picks it up on its next CI run.


Generated by Claude Code

- The two tsup configs build in parallel into dist/ and the first one cleaned it, so
  dist/react.d.ts was sometimes deleted after it was written. 1.10.0 to 1.12.0 shipped
  without it, and report-studio's typecheck fails on '@mgpl-diagnostics/client/react'.
  npm run build now empties dist/ once before tsup, and scripts/check-dist.mjs fails the
  build when a file named in package.json exports is missing.
- PaymentStatus gains REFUNDED and CANCELLED, InvoiceTotals gains refunded and
  Payment gains kind, as in invoice-kit 2.1.0 (report-studio's contract check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018jBohnZEym7gZYsPkBCmVg
@BackStacked
BackStacked merged commit 6faaa7e into main Nov 12, 2026
1 check passed
@BackStacked
BackStacked deleted the claude/project-thread-dsh6g4 branch November 12, 2026 06:59
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.

2 participants