-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat: add support for ESM presets #537
feat: add support for ESM presets #537
Conversation
37e290a
to
d88beb8
Compare
d88beb8
to
5f6ac30
Compare
Looks like the tests are broken on Windows. I'll investigate and come back to you when I have fixed the issue. Thanks for the follow-up and enthusiasm on this! 🎉 |
9ee34c4
to
3d51397
Compare
The dynamic Both PRs have been rebased against |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a bunch for working through these and for your patience for me to get a chance to review
happy to contribute! |
🎉 This PR is included in version 11.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
if you'd like to help us out on a more official basis, i'd be happy to invite you to the org and grant you triage rights to start with. let me know if that is something you'd be interested in, but no pressure if you arent interested |
Sure, I'll give it my best shot, thank you for the invite! |
@sheerlox @travi I just pulled this change into my project and am facing an issue in my Windows Jenkins environment while running "npm run semantic-release":
I wasn't expecting a breaking change, is there something that needs to be done in my project to handle this? |
Hello @mcmiddle592, I'm sorry you're encountering an error because of that PR. Could you please open an issue and share more details about the configuration you're using so I can better understand where the issue is coming from? Note: I would expect |
That's definitely an issue with |
@mcmiddle592 the fix has been released, please run |
Since semantic-release/semantic-release#3037 was also released on Friday, I'm curious if that change is involved as well. |
Yeah, that's definitely possible since |
Yes, it could be related, sorry - I do not have Windows to test this myself either. Would the fix to prepend Then again - the only code paths that were changed were when the |
That should solve the issue but feels a bit hackier than directly using
I'm not sure I understand what you mean, but the issue seems to arise because the user specifies an absolute path in its "extends" configuration/CLI option. EDIT: JSON modules support released in |
@sheerlox @travi thanks for all the help here and the quick responses. I pinned my Semantic-Release in the short term to 22.0.6 to workaround this issue. I won't be able to get to testing this until next week, but when I do I plan to ensure I am using the latest version of import-from-esm (instead of import-from) and see if my issue on Windows is resolved. If there is anything else I need to check then let me know. |
Sorry, I might not be following things in full - I responded because there was a change in |
We think it might be both yes. As of now, the issue in Since I added JSON module support yesterday, I just tried fixing the issue in Unfortunately, I won't be available in the next few days so I won't be able to work on that issue. Maybe it would be worth prepending |
sorry for the slow response from me. the last couple days have been pretty busy for me. thank you for keeping the conversation moving forward. since it sounds like any issue here is likely resolved, lets move the conversation about extending a config back to the other issue. @mcmiddle592 we appreciate you remaining engaged and are interested in the results of your test with the import-from-esm update. as you can tell from the conversation, we suspect that there is also an update needed in core semantic-release for the other recent change related to esm loading. still interested in your results, but don't be surprised if you still encounter a problem until we make the other update. |
@dominykas I'm on Windows. What needs doing? :) |
@sheerlox @travi @dominykas just wanted to confirm that I did test replacing "import-from" with "import-from-esm" in my projects package-lock.json (by reinstalling my semantic release dependencies). This however did not resolve the issue (which I believe was expected), I still have the same problem:
|
Thanks for confirming the issue @mcmiddle592, we're now tracking this in semantic-release/semantic-release#3037. We'll let you know when the issue is resolved. |
@travi - hey this was a breaking change for me, because I was using |
Hi @kerasing, as you can see on this line of the PR diff, the function signature of The package was converted to ESM in v10 on June 2nd, 2023. Is there something I'm missing about my PR changes that caused you to run into an issue? |
This PR adds support for loading pure ESM presets. This was not previously possible because
import-from
usescreateRequire
under the hood.In order to replace it, I've created an ESM module loader that abstracts the preset loading logic for
semantic-release
repos (first tries to hitnode_modules
, then if not found tries to hit the relative path from the current working directory).I've tested these changes locally on the https://github.com/insurgent-lab/conventional-changelog-preset repo (which is a preset but also uses its current version for releasing with
semantic-release
), both with the current latest version and the ESM version (which you can find in therefactor/esm
branch since it's probably the only conventional-changelog ESM preset at this time).Related
cc @travi 😉