fix(emit): normalize extra-extension declaration paths (issue #63) - #68
fix(emit): normalize extra-extension declaration paths (issue #63)#68johnsoncodehk with Copilot wants to merge 2 commits into
Conversation
tsgo emits `Button.vue.d.vue.ts` for .vue source files with
allowArbitraryExtensions, but the host convention (stock TypeScript +
Volar) is `Button.vue.d.ts`.
Add `fixExtraExtDeclarationPath` to strip the redundant `.{ext}` from
`.d.{ext}.ts` declaration output paths in Program.emit, keyed on the
registered extraFileExtensions — no framework literals.
Add witness `triage-vue-tsc-decl-emit` to gate the fix in CI (TOTAL 72→73).
Co-authored-by: johnsoncodehk <16279759+johnsoncodehk@users.noreply.github.com>
|
Closing this — the root cause is an upstream tsgo bug, not a bridge divergence, so this would be a stopgap that papers over the engine rather than fixing it.
default:
ext := GetAnyExtensionFromPath(path, nil, false)
if ext != "" {
return ".d" + ext + ".ts" // Button.vue → ".d.vue.ts"
}
return ExtensionDtsStock's emitter default is
|
vue-tscdeclaration emit producesButton.vue.d.vue.tsinstead ofButton.vue.d.tswhen backed by TNB. tsgo uses the{name}.d.{ext}.tsconvention forallowArbitraryExtensionssources, but the host (stock TypeScript + Volar) expects{name}.d.ts.Changes
patches/typescript/overlay/src/compiler/tsgoChecker.ts— addsfixExtraExtDeclarationPathand applies it in theProgram.emitoutput loop. For each registered extra file extension, strips the redundant.{ext}from.d.{ext}.tsoutput paths before handing the name to the host'swriteFile:Keyed on
programCtx.pendingExtraFileExtensions— no framework name literals; covers any registered extra extension (.vue,.svelte,.astro, …).tools/triage-vue-tsc-decl-emit.mjs— new witness: registers.vueviasupportedTSExtensionsFlat, runscreateProgram+emiton a minimal.vuefixture, asserts output isButton.vue.d.tsnotButton.vue.d.vue.ts. Added to wg5 inci-witness-groups.mjs(TOTAL 72 → 73).