Skip to content

Fix TypeScript declarations and Node ESM package resolution - #8

Merged
bramus merged 1 commit into
mainfrom
fix-ts-and-esm
Nov 26, 2026
Merged

bramus merged 1 commit into
mainfrom
fix-ts-and-esm

Conversation

@bramus

@bramus bramus commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2 (supersedes #6).

  • Switch declaration emit in package.json from tsc --outFile dist/index.d.ts
    to tsc --outDir dist so dist/index.d.ts is emitted as an ES module instead
    of ambient declare module blocks (fixes TS2306).
  • Add main and exports entries to package.json so Node, Vitest, Jest, and
    TypeScript node16/nodenext can resolve view-transitions-mock without
    failing with ERR_MODULE_NOT_FOUND.
  • Add explicit .js extensions and type-only modifiers to relative imports in
    src/ so emitted .d.ts files resolve properly under moduleResolution
    node16/nodenext and verbatimModuleSyntax.
  • Re-export type RegistrationTrigger from src/index.ts so consumers can
    import it directly and declaration-emitting consumers don't hit TS2742.
  • Mark activeViewTransition as readonly on Document/Element and align
    ViewTransitionUpdateCallback with lib.dom.d.ts (() => any) in
    src/types.ts.

@bramus
bramus merged commit 6f32b19 into main Nov 26, 2026
9 checks passed
@bramus
bramus deleted the fix-ts-and-esm branch November 26, 2026 14:04
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.

TypeScript error

1 participant