ent icon indicating copy to clipboard operation
ent copied to clipboard

Circular dependencies with generated builder files

Open Swahvay opened this issue 8 months ago • 3 comments

This is maybe a little fringe, but I'm hoping it's also an easy fix.

When my core library is packaged and used externally, the generated files' references that go through index.ts, will sometimes cause circular dependencies. Specifically, the builders. I've figured out that simple referencing the files directly prevents the loop. I think this stems from a builder being imported through index.ts, so when it also tries to load ents through the same file it won't wait for all of the imports to finish, causing ents to try to load before their bases.

The only fix that needs to happen is to just reference the ents directly. I make these changes manually in my builders and everything works. It's just annoying to have to revert changes in git every time I run codegen for the builders (unless they have meaningful changes, which means I make this change manually again).

src/ent/generated/vaulting_entry/actions/vaulting_entry_builder.ts image

Swahvay avatar Jun 07 '24 02:06 Swahvay