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

Add multi package support #220

Closed

Conversation

@danielkarso-pon
Copy link
Author

danielkarso-pon commented Mar 29, 2024

PR force updated after it failed previously because of prettier lint issues

@georgyangelov
Copy link
Collaborator

Thank you for this! Let me know after you have a chance to test the package as a dependency of some project that uses ESM.

@AGalabov could you take a look as well, also do you have somewhere we can test the CJS importing before a release?

package.json Outdated Show resolved Hide resolved
package.json Outdated
"import": "./dist/mjs/index.js",
"require": "./dist/cjs/index.js"
}
},
"types": "dist/index.d.ts",
Copy link
Collaborator

@AGalabov AGalabov Apr 1, 2024

Choose a reason for hiding this comment

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

Shouldn't the types be exported from a subfolder now as well?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, that looks like something new (to me) . I followed this guide as to support nodejs and typescript for older and newer versions; https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

@AGalabov
Copy link
Collaborator

AGalabov commented Apr 2, 2024

@danielkarso-pon did you manage to test this? I just tried setting up some test projects. From what I see the current setup would not fully work. One thing that I saw as a problem was that the compiled js files for ESM modules are lacking the file extension .js at the end => the internal imports that we use in our app are "wrong" and cannot be resolved 🤔

@AGalabov
Copy link
Collaborator

AGalabov commented Apr 2, 2024

@danielkarso-pon @georgyangelov - I opened an alternative PR using Rollup as a small module bundler to work around the inconveniences of transpiling the files and imports by combining them into a single file. I am open for reviews and comments. I managed to test in a small project + the project mentioned here

@AGalabov
Copy link
Collaborator

AGalabov commented Apr 5, 2024

@danielkarso-pon thank you once again for the contribution, ideas and the review. I will go ahead with the other PR as we agreed

@AGalabov AGalabov closed this Apr 5, 2024
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.

None yet

3 participants