typeshare icon indicating copy to clipboard operation
typeshare copied to clipboard

Allow exported type file to have code that won't be overwritten

Open praveenperera opened this issue 1 year ago • 1 comments

This is a great tool but I put some of the types that aren't separated into a helper file.

And then I manually import them into the file.

I also import files that are generated from another package.

// also generated by typeshare
import { AttachDirection, RawElement, RawElementId, RawTimelineId } from "./opset_types";
// helper file
import { JsonFraction } from "./rust_type_helpers";
// ==================================== GENERATED ====================================

... generated code here ...

It would be great if typeshare kept the code above ==================================== GENERATED ====================================

And only replaced the code below it.

praveenperera avatar Apr 26 '23 21:04 praveenperera

Hello, and thank you for your suggestion. This isn't a high priority because the combination of generated and manually created code can be handled within a script/toolchain. That said, we'd welcome community contribution on this matter.

LuminaSapphira avatar May 02 '23 20:05 LuminaSapphira