Summary
When a bundle renames a name, the same word inside a template literal type is renamed too. With src/flag.ts:
export default 1and src/index.ts:
import enabled from './flag'
export type Status = `enabled` | `disabled`
export function isEnabled(): number { return Number(enabled) }generate({ bundle: true }) emits type Status = `__dtsx_default_export__` | `disabled`;, and a consumer assigning 'enabled' fails with TS2322. A declaration renamed for a collision (Options to Options_1) does the same to `Options-${Options}`.
Changes
renameIdentifiers skipped quoted strings and comments, but not template literals. It now copies template literal text as written and still renames inside ${} placeholders, including nested templates. A // inside template text is no longer read as a comment either.
Testing
A renameIdentifiers case in test/bundle-linker.test.ts and an end-to-end generate({ bundle: true }) case in test/module-graph.test.ts, which type-checks a consumer with the existing runTsc helper. Both fail on main.
bun test (Zig library built with the pinned Zig, so its tests run too), typecheck, lint and zig build test pass. Bundles of pinia, vue-router, vue-core's runtime-core, reactivity and shared, knip and tailwindcss are byte-identical before and after.