Skip to content
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

recreate error with only ipfs-utils, not ipfs-core #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gobengo
Copy link
Owner

@gobengo gobengo commented Apr 11, 2022

No description provided.

@gobengo gobengo changed the title add ipfs-core recreate error with only ipfs-utils, not ipfs-core Apr 11, 2022
@gobengo
Copy link
Owner Author

gobengo commented Apr 11, 2022

I believe it was caused because unintended typescript declarations were genrated for glob-source that said it returned an AsyncIterator({ content: fs.ReadStream }), even though the authored js includes in the jsdoc @yields { content: AsyncIterator<Buffer> }, but that tsc doesn't understand @yields, only @return microsoft/TypeScript#23857

achingbrain pushed a commit to ipfs/js-ipfs-utils that referenced this pull request Apr 19, 2022
Motivation:
* Fix ipfs/js-ipfs#4080
* tl;dr
  * fix `import globSourceImport from 'ipfs-utils/src/files/glob-source.js'` from typescript
  * fix importing ipfs-core from typescript

Context:
* microsoft/TypeScript#23857

Strategy
* Use jsdoc `@return` instead of `@yields` because tsc doesn't understand that `@yields` implies a `@return` type

Test Case
* gobengo/ipfs-core-esm-test#3
* I tested locally with `npm link` and this seemed to fix it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant