mirror of
https://github.com/meshtastic/web.git
synced 2026-07-31 06:56:28 -04:00
Previously transport-* package dts builds failed with "Missing export" because
rolldown's dts bundler couldn't follow tsdown's cross-chunk re-exports out of
@meshtastic/sdk. Three things land here:
1. mod.ts now re-exports `fromDeviceStream`, `toDeviceStream`, `Queue`, and
`Xmodem` directly. Transport packages were importing these via the legacy
`Utils` namespace; namespace re-exports are exactly what rolldown chokes
on. Transport packages (http, deno, node, node-serial, web-bluetooth,
web-serial) and shared transportContract.ts now use direct imports —
`import { Transport, DeviceOutput, ... } from "@meshtastic/sdk"`.
2. package.json `exports` split: `types` points at `./dist/<entry>.d.ts`
(built dts) so tsdown's downstream rolldown reads a self-contained file;
`default` keeps source paths so vitest + workspace-internal imports still
resolve to .ts source.
3. Postbuild `rename-dts.mjs` now (a) inlines internal chunk dts files
(Transport-<hash>.d.ts) into each entry's dts, rewriting the letter
aliases tsdown produces; (b) strips `type` modifiers from re-exports
so rolldown accepts the bindings as both value- and type-shape;
(c) declares the synthetic `Types`/`Utils` namespaces explicitly,
replacing the broken `<wrapper>_d_exports as Types` aliases tsdown
emits for `export * as` patterns.
vitest.config.ts gains `apps/*` so the workspace move keeps test discovery
working for the apps/web project.