feat: importTypesPath for gql-tag-operations-preset#8380
Open
ferm10n wants to merge 3 commits intodotansimha:masterfrom
Open
feat: importTypesPath for gql-tag-operations-preset#8380ferm10n wants to merge 3 commits intodotansimha:masterfrom
ferm10n wants to merge 3 commits intodotansimha:masterfrom
Conversation
🦋 Changeset detectedLatest commit: 5f71fe1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
I marked this as "needing documentation update" because it adds options. I added jsdoc annotations but I'm not sure if that's all that's required. |
af2fb87 to
be3f0e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.
Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of the pull request.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
This adds support for specifying an import
typesPathfor the gql-tag-operations-preset, just likeimport-types.Related #8379
Type of change
Please delete options that are not relevant.
Screenshots/Sandbox (if appropriate/relevant):
Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate
How Has This Been Tested?
I've added a test case to
gql-tag-operations.spec.ts, whenpresetConfig.importTypesPathis set, thetypescriptplugin is not included, an import to the types path is prepended, and and base type references use the imported types (Exactis coverted toTypes.Exact. It builds successfully, tests pass and I've used it successfully in the monorepo I described in #8379Checklist:
Further comments
This implementation seemed the simplest, but I'm wondering if it would make sense to try and refactor gql-tag-operations plugin to be more usable as a standalone plugin instead of it being blocked behind the preset, and remove the preset altogether. I don't feel confident enough with my understanding of the codebase yet to take that on that effort, but I'd be open to the idea if I got some encouragement on this direction from a maintainer :)