swift-graphql icon indicating copy to clipboard operation
swift-graphql copied to clipboard

Refactor!/move code gen to separate package

Open CrownedPhoenix opened this issue 3 months ago • 1 comments

This is primarily beneficial because it removes dev related dependencies from the Swift package. This will make it play nicer as an import because it won't force consumers to clone and build all the non-product dependencies.

This is also pretty important for getting the package to work on linux since by separating the dev/code-gen dependencies from the production code we free up the opportunity to use non-linux dev/code-gen tools/dependencies (which is fine in my use case) while still maintaining the production code's ability to compile on linux.

There's still some stuff I haven't totally grokked about your CI/dev setup to effectuate this change fully so this will probably need from edits from your side.

See https://github.com/CrownedPhoenix/swift-graphql-code-gen/tree/experiment/separate-code-gen-package for an example of the separate package in action. Obviously, you ought to make a new repo under your namespace and transfer the code and fix it up.

CrownedPhoenix avatar Mar 08 '24 06:03 CrownedPhoenix

Current focus has been on v6 which resolves these and many other issues. The plan wasn't to make large scale changes to the existing library to minimise impact on those not ready to migrate when v6 releases.

I'll take a deeper look at this when I have some time, but I'm hesitant at a glance, purely since it doesn't align with current planned work and we have extremely limited time as it is.

shaps80 avatar Mar 08 '24 12:03 shaps80