Skip to content

fix(bindings): make published TSRX sources pass strict consumer typechecks - #345

Merged
trueadm merged 3 commits into
octanejs:mainfrom
openai-oss-forks:fix/published-tsrx-strict-consumer-332
Jul 28, 2026
Merged

trueadm merged 3 commits into
octanejs:mainfrom
openai-oss-forks:fix/published-tsrx-strict-consumer-332

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix strict TSRX typechecking of the published @octanejs/cmdk, @octanejs/sonner, and @octanejs/tiptap source packages.
  • Add an isolated real-tarball consumer that installs all three bindings and their packed internal dependencies, selects Octane's published Volar compiler, and runs tsrx-tsc --noEmit with full strict diagnostics.
  • Extend the repository's TSRX-aware binding gate to include Sonner and Tiptap while retaining Cmdk.

Why

Closes #332.

These bindings publish src/index.ts and raw .tsrx components, so those components become part of an external consumer's TypeScript program. Checking only workspace-local projects or running tsgo does not establish that the actual packed source packages pass tsrx-tsc.

Changes

  • Preserve Cmdk's optional public ref contract while normalizing absent refs before passing them to strict host and multi-ref attributes.
  • Type Sonner's toast icons, class-name lookups, native CSS properties, CSS custom properties, assets, and public Toaster component without widening them to any.
  • Type Tiptap's provider/consumer props, context editor, state selector, portal registry, renderer snapshots, editor refs, and source-exported JSX component declarations.
  • Add an external packed consumer with real local .tsrx components and negative type assertions proving invalid positions, callbacks, editor ownership, and CSS values remain rejected.
  • Require the packed octane/compiler/volar, the exact pinned TypeScript and TSRX tooling, one physical Octane runtime, and packed Floating UI/Radix dependency tarballs; reject workspace fallback.
  • Add patch changesets for the three affected published packages. No ambient declare module '*.tsrx' is added.

Validation

  • node --test scripts/package-pack-canaries.test.mjs scripts/npm-release-preflight.test.mjs — 17 tests pass.
  • node scripts/check-tsrx-module-decls.mjs.
  • node scripts/check-changesets.js.
  • node scripts/check-test-markers.mjs.
  • node scripts/workspace-packages.mjs --check.
  • node --check scripts/check-package-packs.mjs and both packed-canary modules.
  • Exact pinned Prettier 3.9.6 checks for changed JavaScript, TypeScript declarations, and JSON.
  • git verify-commit HEAD — verified SSH signature.
  • Full local installation and TSRX formatting/typechecking: the unmodified frozen upstream install reproducibly receives ERR_PNPM_FETCH_403 for the protected @tsrx/[email protected] tarball. No credentials are bypassed, lockfile is altered, or parser is substituted.
  • Authenticated upstream GitHub Actions: pnpm format:check, pnpm typecheck, pnpm test, and pnpm packages:pack:check, including the new real-tarball strict TSRX consumer.

Risk / follow-ups

  • Focused on the three source-published binding packages and their existing package-release/typecheck gates; runtime, compiler output, unrelated worktrees, and unrelated issues are unchanged.
  • The new tarball canary intentionally fails if future changes erase consumer-visible props, relax strict checking, replace the published Octane compiler, resolve into the workspace, or omit a packed internal dependency.

Note

Low Risk
Changes are typing and validation gates on binding packages; runtime behavior is limited to ref ?? null coalescing with no auth or data-path impact.

Overview
Makes @octanejs/cmdk, @octanejs/sonner, and @octanejs/tiptap typecheck under strict tsrx-tsc when consumers install the published tarballs, not only from workspace projects.

Cmdk normalizes optional public refs with props.ref ?? null (including multi-ref arrays) so strict ref typing stays sound without changing runtime behavior.

Sonner replaces any with OctaneNode, a CSSProperties type that allows --* custom properties, typed icon/class lookups, and a precise Toaster JSX return in declarations; Sonner’s tsconfig drops skipLibCheck.

Tiptap adds explicit props/return types for provider, consumer, EditorContent, portal registry, and useTiptapState, plus the same ref normalization on the editor host.

CI/gates: root bindings:typecheck runs tsrx-tsc on Sonner and Tiptap; packages:pack:check spins up an external consumer from real packed archives (cmdk, sonner, tiptap, floating-ui, radix, octane), runs tsrx-tsc with @tsrx/typescript-plugin and skipLibCheck: false, and includes compile-time probes that reject erased props and invalid API usage. Patch changesets cover the three bindings.

Reviewed by Cursor Bugbot for commit 9096bf9. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@domgan-oai is attempting to deploy a commit to the Ripple Team Team on Vercel.

A member of the Team first needs to authorize it.

@trueadm
trueadm merged commit ff0f898 into octanejs:main Jul 28, 2026
10 of 12 checks passed
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.

Published TSRX source packages fail strict consumer tsrx-tsc typecheck

2 participants