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

ES Modules #2133

Closed
7 tasks done
Tracked by #2
gr2m opened this issue Sep 17, 2021 · 18 comments
Closed
7 tasks done
Tracked by #2

ES Modules #2133

gr2m opened this issue Sep 17, 2021 · 18 comments

Comments

@gr2m
Copy link
Member

gr2m commented Sep 17, 2021

The plan

Migrate semantic-release and all the core plugins to native ES Modules.

The motivation

Node is moving to native ES Modules, so it's only a matter of time when we will be forced to do the same.

The 2nd reason is that a growing number of dependencies were or will soon be upgraded by ESM, and we are blocked from further updates, and have a ton of open pull requests which I'd love to get rid of.

semantic-release is in a good position to do the upgrade with comparably little friction, as it's often times run in it's own environment. It's not a production dependency.

Projects to update

I'll create dedicated issues for these shortly. We already started work on some of them.

@fgreinacher
Copy link

@travi @gr2m I can take care of migrating the gitlab plugin, how far away do you think we are from completing the migrations already started? Did you notice any roadblocks so far?

@travi
Copy link
Member

travi commented Apr 6, 2022

we have discovered a few roadblocks like semantic-release/commit-analyzer#297 (comment), which i haven't found the time to investigate very deeply yet.

our original plan was to update all the plugins consumed by core and core itself all at the same time so that they could be released together. at this point, i think i'm leaning toward updating core first since that will be the primary breaking change that will directly impact consumers. that way the plugins could be converted individually without much user impact since they are consumed by core that was already converted.

unfortunately, making progress on that has been blocked since getting a new M1 Macbook for myself since our test suite has some trouble running on that architecture. I've made some progress there that i still need to capture into an issue, but we may need some help from the community to remove that blocker.

once we get to the point where either core or core + the plugins that it directly consumes by default are converted, it would be great to get the gitlab plugin converted shortly after, so your help there is greatly appreciated.

@travi
Copy link
Member

travi commented Jul 14, 2022

for folks following this effort, it is worth noting that this effort has been greatly slowed by #2478. if you are hoping to see this effort move forward sooner and you are able to help with #2478, we would greatly appreciate the help.

@pierluigilenoci
Copy link

@travi considering the impact this has, inquiring about a possible ETA is not a crime.
Especially when progress seems quite stalled.
I am aware that it is a voluntary project but this cannot be a justification for everything.
If the resources are not enough, the constructive solution is to ask for help.

@its-dibo
Copy link

its-dibo commented Feb 11, 2023

really really waiting for this feature, I'm migrating all of my projects and packages into ESM, so I really need semantic-release to support ESM projects

great effort guys, keep going

@travi
Copy link
Member

travi commented Feb 12, 2023

@its-dibo is there something in particular about the current state of semantic-release that you find to be holding up your progress? the core package has been converted to ESM already, but since semantic-release is normally leveraged through its own executable, the module type of semantic-release should not need to be coordinated with the module type of consuming projects.

@its-dibo
Copy link

its-dibo commented Mar 28, 2023

I got this error @travi
v21
image

I removed all plugins and used the default config.
when removing the file release.config.js it worked

release.config.js

export default {};

info:
semantic-release: v21
node v18
package.type = "module"

@travi

This comment was marked as off-topic.

diogokiss added a commit to diogokiss/semantic-release-notes-preview that referenced this issue Jun 6, 2023
The semantic-release packages are throwing the following error when used by
semantic-release-notes-preview.

(The message below was redacted to fit in the commit message.)
```
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module @semantic-release/commit-analyzer/index.js
from dist/index.js not supported.
```

This is probably cause by the following issue.
semantic-release/semantic-release#2133

This commit attempts to fix the issue by setting the Rollup directive
'ignoreDynamicRequires' to its default value, False.
diogokiss added a commit to diogokiss/semantic-release-notes-preview that referenced this issue Jun 6, 2023
The semantic-release packages are throwing the following error when used by
semantic-release-notes-preview.

(The message below was redacted to fit in the commit message.)
```
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module @semantic-release/commit-analyzer/index.js
from dist/index.js not supported.
```

This is probably cause by the following issue.
semantic-release/semantic-release#2133

This commit attempts to fix the issue by setting the Rollup directive
'ignoreDynamicRequires' to its default value, False.
diogokiss added a commit to diogokiss/semantic-release-notes-preview that referenced this issue Jun 6, 2023
The semantic-release packages are throwing the following error when used by
semantic-release-notes-preview.

(The message below was redacted to fit in the commit message.)
```
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module @semantic-release/commit-analyzer/index.js
from dist/index.js not supported.
```

This is probably cause by the following issue.
semantic-release/semantic-release#2133

This commit attempts to fix the issue by setting the Rollup directive
'ignoreDynamicRequires' to its default value, False, and configuring the
directive 'dynamicRequireTargets' to allow for 'release.config.js' to be
dinamically required.
diogokiss added a commit to diogokiss/semantic-release-notes-preview that referenced this issue Jun 6, 2023
The semantic-release packages are throwing the following error when used by
semantic-release-notes-preview.

(The message below was redacted to fit in the commit message.)
```
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module @semantic-release/commit-analyzer/index.js
from dist/index.js not supported.
```

This is probably cause by the following issue.
semantic-release/semantic-release#2133

This commit attempts to fix the issue by setting the Rollup directive
'ignoreDynamicRequires' to its default value, False, and configuring the
directive 'dynamicRequireTargets' to allow for 'release.config.js' to be
dinamically required.
diogokiss added a commit to diogokiss/semantic-release-notes-preview that referenced this issue Jun 6, 2023
The semantic-release packages are throwing the following error when used by
semantic-release-notes-preview.

(The message below was redacted to fit in the commit message.)
```
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module @semantic-release/commit-analyzer/index.js
from dist/index.js not supported.
```

This is probably cause by the following issue.
semantic-release/semantic-release#2133
diogokiss added a commit to diogokiss/semantic-release-notes-preview that referenced this issue Jun 6, 2023
The semantic-release packages are throwing the following error when used by
semantic-release-notes-preview.

(The message below was redacted to fit in the commit message.)
```
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module @semantic-release/commit-analyzer/index.js
from dist/index.js not supported.
```

This is probably cause by the following issue.
semantic-release/semantic-release#2133
@travi
Copy link
Member

travi commented Jun 9, 2023

this effort is now complete for the core plugins (included as dependencies of the core package) 🎉

there are still official plugins beyond this list of core plugins that will still need to converted at some point, but they are beyond the scope of this initial effort. if folks would like to help us convert the remaining plugins, we would welcome that help.

@its-dibo

This comment was marked as off-topic.

@travi

This comment was marked as off-topic.

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

No branches or pull requests

5 participants