New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: using relative import for provider, fixes problems with intellisense in vscode #712
fix: using relative import for provider, fixes problems with intellisense in vscode #712
Conversation
@@ -28,24 +28,24 @@ export class PactProviderConfigOptionsService | |||
this.animalRepository.clear(); | |||
token = '1234'; | |||
|
|||
return 'Animals removed to the db'; | |||
return { description: 'Animals removed to the db' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests were failing due to the need of having JsonMap as a return type. Also showing that imports didn't resolve correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't break with the change, though - because nestjs-pact only uses the v2 options type, which hasn't changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really these tests shouldn't be returning anything at all, though - because I don't think it's valid in V2. @mefellows, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I actually think it's completely misleading, so would prefer to remove altogether.
@TimothyJones is our stance still OK with sticking with relative imports? I recall having a chat but can't see where. |
Yep! I think the absolute imports are currently a mistake on my part (although my vscode handles them fine) |
@TimothyJones for me in the |
Thanks for the fix! We'll merge it as soon as we've worked out what's going on with that provider test (I think that test is disabled anyway, because it's not compatible with the next release, see pact-foundation/nestjs-pact#7 ). As an aside, do you know how to get a typescript module to flatten the types? At the moment, intellisense is happy to deep link into |
@TimothyJones Add It should only use the exports from index.js From: |
You're amazing! Thank you for doing the legwork!
…On Tue, 20 Jul 2021 at 20:16, Ivo Velthoven ***@***.***> wrote:
@TimothyJones <https://github.com/TimothyJones> Add @internal to the
exports you want to hide. add stripInternal: true to tsconfig.json.
[image: image]
<https://user-images.githubusercontent.com/23296032/126306919-51d8870b-36b4-425f-b661-921cb47bdbfc.png>
[image: image]
<https://user-images.githubusercontent.com/23296032/126307133-a23cb832-76bb-4bbf-b6a2-5744801619d0.png>
[image: image]
<https://user-images.githubusercontent.com/23296032/126307181-bc333fec-146e-4c94-bc73-aa402652581b.png>
It should only use the exports from index.js
From:
https://stackoverflow.com/questions/59122428/typescript-library-hide-internal-exports
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#712 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG7HQOINISMIOCZDMKGWF3TYVEHHANCNFSM5ATG7L5Q>
.
|
Aha! I finally had a moment to look at this - the problem was indeed a bug that this fix exposed.
^ |
Thanks again for the PR! Apologies for taking so long on this one. We'll release it this weekend. |
Fixes vscode intellisense by using a relative import instead of an absolute one.