Skip to content

Published TSRX source packages fail strict consumer tsrx-tsc typecheck #332

Closed

Description

@ethan-huo

Reproduction

In a strict Octane consumer using:

add a local .tsrx component, select octane/compiler/volar in tsconfig.json, and run:

pnpm exec tsrx-tsc --noEmit

The local component compiles, but the consumer typecheck fails in dependency source files:

  • @octanejs/cmdk/src/components/command.tsrx: optional ref is not assignable to required ref.
  • @octanejs/sonner/src/sonner.tsrx: toast key indexing and CSS custom property errors.
  • @octanejs/tiptap/src/{Context,EditorContent,Tiptap}.tsrx: implicit-any, unknown-state, and context typing errors.

These packages expose src/index.ts directly, so their .tsrx implementation files become part of the consumer TypeScript program.

Why the repository gate misses this

The root typecheck script invokes tsgo for cmdk, sonner, and tiptap. Their tsconfig.json files do not load the TSRX TypeScript plugin, so the gate does not validate the .tsrx sources through the same compiler path consumers need.

Expected

Published source packages should pass a strict tsrx-tsc --noEmit consumer program. The repository gate should compile package .tsrx sources through the Octane TSRX compiler so releases cannot drift from that contract.

This was found while porting a real Tauri editor to Octane; Vite compilation and browser behavior pass, but the intended full-program TSRX typecheck is currently blocked by dependency diagnostics.

Activity

  1. domgan-oai commented on Jul 28, 2026

    @domgan-oai
    Contributor

    Thanks for the detailed consumer reproduction. I checked the published-source manifests and typecheck scripts on current main (dac0e660).

    Triage: confirmed high-priority published-package and CI-gating defect.

    @octanejs/cmdk, @octanejs/sonner, and @octanejs/tiptap all publish src/index.ts as both their implementation and type entry. Their .tsrx implementations therefore participate in a strict consumer's real TypeScript program; successful bundling or a tsgo run is not evidence that tsrx-tsc accepts the published surface.

    One nuance on current main: bindings:typecheck already includes tsrx-tsc --noEmit -p packages/cmdk/tsconfig.json. However, Sonner and Tiptap are still checked only through the separate tsgo chain, so the consumer-equivalent gap remains real. The fix also needs to verify Cmdk in a consumer program, not only against its own project config.

    Proposed resolution:

    1. Reproduce the reporter's strict consumer configuration using the packed/source-exported Cmdk, Sonner, and Tiptap entry points and octane/compiler/volar.
    2. Fix the reported errors in their owning sources: Cmdk's optional ref contract; Sonner's toast-key indexing and typed CSS custom properties; and Tiptap's props, context, registry/editor state, and implicit-parameter types.
    3. Add Sonner and Tiptap to the tsrx-tsc-backed binding gate; retain Cmdk there.
    4. Add a packed strict-consumer typecheck to the existing package/release canaries so workspace-only resolution cannot mask future published-source failures.
    5. Run the per-package TSRX checks, the packed consumer check, and pnpm typecheck; add patch changesets for affected published packages.

    Avoid ambient declare module '*.tsrx', weakening strictness, or skipLibCheck as fixes: those hide the consumer contract rather than repairing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions