Skip to content

v1.12.2

Latest

Choose a tag to compare

@kevinccbsg kevinccbsg released this 16 Nov 18:13
78e723f

TWD's type declarations work again under moduleResolution node16 and nodenext.

Update your service worker

npx twd-js init public

The worker did not change, but it carries the version number, so a 1.12.1 mock-sw.js logs a version mismatch warning with 1.12.2.

Types under node16 and nodenext

Since 1.7.3, the published .d.ts files used relative imports without file extensions (export { twd } from './twd'). Because the package is "type": "module", TypeScript rejects those imports under node16 and nodenext, so most exports resolved to any: twd, screenDom, userEvent, initTests, TWDSidebar, every twd-js/vite-plugin export and MockedComponent. With skipLibCheck on, nothing reported it. You just lost autocomplete and assertion names like twd.should(el, 'not.a.real.assertion') compiled.

Projects on moduleResolution: "bundler", the default in Vite templates, were not affected.

Now each entry ships as one self-contained declaration file. The twd-js/bundled types moved to dist/bundled.d.mts; the package.json export points at it, so import { initTWD } from 'twd-js/bundled' needs no change.

CI now type-checks the packed package as a consumer under nodenext, node16 and bundler before every release, so this can't regress silently again.

Thanks to @trackoor for the detailed report in #434.

Also in this release

  • Dependencies: preact 11.1.0, used by the bundled sidebar.
  • Docs: a support page with hello@twd.dev, accessibility fixes on the landing, and the AI setup eval now checks the mock service worker.
  • Tooling: TypeScript 6.0.3, jsdom 31, vitest, vite, eslint and other dev dependency updates.

Full changelog: v1.12.1...v1.12.2