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

Added test case to show issue with export default #602

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmcclell
Copy link

@jmcclell jmcclell commented Feb 6, 2024

Some pacakges such as pixi.js re-export 3rd party libraries under their own namespace, e.g. @pixi/util does the following:

export { default as EventEmitter } from 'eventemitter3'

in order to provide the EventEmitter module from eventemitter3 under the @pixi/util namespace.

The converter appears to ignore exports of this form and no module is created. This breaks libraries that rely on this behavior such as Pixi.

NOTE: This test doesn't show any import failures or warnings, but the issue is that the module isn't generated in the output code as expected.

@steinybot
Copy link
Contributor

You need to add the tests to org.scalablytyped.converter.internal.importer.ImporterTest

@jmcclell jmcclell closed this Jul 30, 2024
@jmcclell jmcclell reopened this Jul 30, 2024
Some pacakges such as pixi.js re-export 3rd party libraries under their
own namespace, e.g. @pixi/util does the following:

export { default as EventEmitter } from 'eventemitter3'

in order to provide the EventEmitter module from eventemitter3 under the
@pixi/util namespace.

The converter appears to ignore exports of this form and no module is
created. This breaks libraries that rely on this behavior such as Pixi.
Copy link
Contributor

@steinybot steinybot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is related to #638.

@@ -0,0 +1 @@
export { default as Foo } from "foo";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would this find foo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to commit these? I'd probably keep a subset of the the real code for pixi-utils rather than creating a ficticious export-default package.

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