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

feat!: Full ESM #1922

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

feat!: Full ESM #1922

wants to merge 12 commits into from

Conversation

AaronDewes
Copy link
Member

@AaronDewes AaronDewes commented Nov 16, 2023

These are the changes needed to make Probot fully ESM. This is mostly for testing purposes, requiring ESM would probably have a large impact.

src/bin/probot.ts Outdated Show resolved Hide resolved
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require("../lib/bin/probot-receive");
import "../lib/bin/probot-receive.js";
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if we just do

Suggested change
import "../lib/bin/probot-receive.js";
import("../lib/bin/probot-receive.js");

In the bin files and already apply them into beta?

Shouldnt be breaking and reducing the esm switch effort.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good, I'll apply this on the other branch later.

@Uzlopak
Copy link
Collaborator

Uzlopak commented Nov 17, 2023

I think esm only would be too hard for now.

So we most code changes are __dirname substitutions. Maybe we can reduce the use of __dirname in beta.

Also what do you think of a cjs esm dual mode. Like it is done in helmet?

@AaronDewes
Copy link
Member Author

Also what do you think of a cjs esm dual mode. Like it is done in helmet?

Not sure how easy we can implement this (For example __dirname), but I'll experiment a bit. Full ESM would give us the benefit of being able to keep latest dependencies, which are starting to require ESM.

Base automatically changed from esm-ready to beta November 20, 2023 05:28
Base automatically changed from beta to master January 25, 2024 21:03
This makes Probot entirely esm-only.
This updates pkg-conf at runtime, and get-port and execa in development
@Uzlopak
Copy link
Collaborator

Uzlopak commented Jan 26, 2024

I guess full esm should be the next step. Yes.

@AaronDewes AaronDewes added this to the v14.0.0 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants