Skip to content

restore types package export#14

Merged
lahmatiy merged 1 commit intodiscoveryjs:masterfrom
andyjy:restore-types-export
Oct 24, 2024
Merged

restore types package export#14
lahmatiy merged 1 commit intodiscoveryjs:masterfrom
andyjy:restore-types-export

Conversation

@andyjy
Copy link
Copy Markdown
Contributor

@andyjy andyjy commented Oct 24, 2024

This reverts the recent removal of the "types" package export in 05c261f#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L31

Fixes typescript error

error TS7016: Could not find a declaration file for module '@discoveryjs/json-ext'. '.../node_modules/@discoveryjs/json-ext/src/index.js' implicitly has an 'any' type.
There are types at '.../node_modules/@discoveryjs/json-ext/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@discoveryjs/json-ext' library may need to update its package.json or typings.

Removed in discoveryjs@05c261f#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L31

Fixes typescript error
> error TS7016: Could not find a declaration file for module '@discoveryjs/json-ext'. '.../node_modules/@discoveryjs/json-ext/src/index.js' implicitly has an 'any' type.
>  There are types at '.../node_modules/@discoveryjs/json-ext/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@discoveryjs/json-ext' library may need to update its package.json or typings.
@lahmatiy lahmatiy merged commit f6a6a87 into discoveryjs:master Oct 24, 2024
@lahmatiy
Copy link
Copy Markdown
Member

Thank you!

@lahmatiy
Copy link
Copy Markdown
Member

I remembered why I removed this line – the updated esbuild started giving a warning.
image
I tried removing the line, and everything continued to work in my setup. After merging your changes, I moved the types before import/require. I hope this doesn't bring back the issue you mentioned.

@andyjy
Copy link
Copy Markdown
Contributor Author

andyjy commented Oct 25, 2024

makes sense. resolved - thanks!

and yes good point to put the "types" key first.. it appears previous typescript version docs used to mandate it being first, although seemingly recent versions have been tolerating "types" in any position

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.

2 participants