fix(types): fix imports for type definitions#364
Closed
bjohansebas wants to merge 2 commits intomasterfrom
Closed
Conversation
Pull Request Test Coverage Report for Build 20556771105Details
💛 - Coveralls |
|
@bjohansebas I've confirmed namespace import succeeds 👍🏽 % git diff
diff --git a/iconv-lite-not-found/package-lock.json b/iconv-lite-not-found/package-lock.json
index e259866..1cb8f73 100644
--- a/iconv-lite-not-found/package-lock.json
+++ b/iconv-lite-not-found/package-lock.json
@@ -6,7 +6,7 @@
"": {
"name": "iconv-lite-not-found",
"dependencies": {
- "iconv-lite": "0.7.1",
+ "iconv-lite": "github:pillarjs/iconv-lite#aa3107a",
"typescript": "5.9.3"
},
"devDependencies": {
@@ -25,8 +25,7 @@
},
"node_modules/iconv-lite": {
"version": "0.7.1",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.1.tgz",
- "integrity": "sha512-2Tth85cXwGFHfvRgZWszZSvdo+0Xsqmw8k8ZwxScfcBneNUraK+dxRxRm24nszx80Y0TVio8kKLt5sLE7ZCLlw==",
+ "resolved": "git+ssh://git@github.com/pillarjs/iconv-lite.git#aa3107a192781ff899f83768a4939f7389bf0687",
"license": "MIT",
"dependencies": {
% npm run build
> build
> tsc |
|
I confirm it fixes the issue :-) |
|
Thanks! I tested this under ESM. The default import works as expected (with import * as iconv from "iconv-lite";
// (similarly: import { encode } from "iconv-lite";)
iconv.encode(input, encoding);I’m not totally sure, but this might be a TypeScript/Node CJS↔ESM interop quirk (I’ve seen similar issues elsewhere). In any case, the default import working is enough for me for now. Thanks again! |
|
I noticed after commenting that the namespace import behaves the same way on v0.7.0 as well. |
Member
Author
|
Closed in favor of #366 . Please review that PR and check that the changes there work as expected. |
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.
I’ve been doing some tests, and I think this is how the types will work correctly
fixed #363
cc @prigaux @takayukioda @kyota-fujikura could you review these changes and test them to verify that they work, please?
cc @clicktodev for the typescript wg