Skip to content

Adds command plugin - #20

Open
NeedleInAJayStack wants to merge 3 commits into
mainfrom
feat/command-plugin
Open

NeedleInAJayStack wants to merge 3 commits into
mainfrom
feat/command-plugin

Conversation

@NeedleInAJayStack

@NeedleInAJayStack NeedleInAJayStack commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

This adds a command plugin that can be run like:

swift package --allow-writing-to-package-directory generate-code-from-graphql

To support this, the existing build plugin was refactored to share as much code as possible. I took pretty heavy inspiration from swift-openapi-generator's plugin code when implementing this.

Closes #17

This is in preparation for adding a command plugin. Heavily inspired by swift-openapi-generator.
@NeedleInAJayStack

Copy link
Copy Markdown
Member Author

This work raises some additional configuration considerations. Off the top of my head:

  • We don't currently allow configuring access modifiers (public, private, etc) on the generated types. They are all generated as implicit internal.
  • The command plugin just puts files into the root of Sources. Should they be organized?

For reference here are the swift-openapi-generator configuration options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Command Plugin

1 participant