feat(codegen): emit module boundary in TypeScript definitions
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 58s

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-03-31 20:54:40 +00:00
parent 1d11472136
commit c088e5a5ac
2 changed files with 3 additions and 0 deletions

View file

@ -95,6 +95,7 @@ func TestGenerateTypeScriptDefinitions_DeduplicatesAndOrders_Good(t *testing.T)
assert.Equal(t, 1, countSubstr(dts, `"alpha-panel": AlphaPanel;`))
assert.Equal(t, 1, countSubstr(dts, `export declare class AlphaPanel extends HTMLElement`))
assert.Equal(t, 1, countSubstr(dts, `export declare class ZedPanel extends HTMLElement`))
assert.Contains(t, dts, "export {};")
assert.Less(t, strings.Index(dts, `"alpha-panel": AlphaPanel;`), strings.Index(dts, `"zed-panel": ZedPanel;`))
}

View file

@ -55,5 +55,7 @@ func GenerateTypeScriptDefinitions(slots map[string]string) string {
b.WriteString("}\n\n")
}
b.WriteString("export {};\n")
return b.String()
}