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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: esm only version #1825
feat: esm only version #1825
Conversation
switch update-dotenv back to npm package
sort imports run prettier
update jest to latest run esm compatible tests
Thanks for opening this pull request! A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved. |
Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details? |
make previously removed version check esm compatible
i'm curious if the test complications are simply related to jest having trouble within an esm context. related: jestjs/jest#9430 i've had a good experience moving projects from jest to vitest when converting to esm and it is api compatible with jest, so the test changes should be minimal. would a switch between test frameworks be a change that you'd be open to try as part of this effort, @pixelass? |
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 for your efforts with this @pixelass. i added a few minor comments based on a first-pass review, but looks like this is headed in a great direction.
@@ -1,3 +1,3 @@ | |||
#!/usr/bin/env node | |||
|
|||
require("../lib/bin/probot-receive"); | |||
import "../lib/bin/probot-recieve.js"; |
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.
import "../lib/bin/probot-recieve.js"; | |
import "../lib/bin/probot-receive.js"; |
i assume this change was accidental since the referenced file is still spelled the previous way, without the typo
pkg = require(path.join(process.cwd(), "package.json")); | ||
pkg = ( | ||
await import(path.join(process.cwd(), "package.json"), { | ||
assert: { type: "json" }, |
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.
import assertions are still considered experimental, even in v20, so i'm curious if we need a different approach with this. does typescript happen to handle this differently somehow?
|
||
const pkg = require("../../package"); | ||
const pkg = JSON.parse( | ||
fs.readFileSync(path.resolve(__dirname, "../../package.json"), { |
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.
this might be the safer option for loading the package file, but wherever we land, it would be best to be consistent
A1yBjz3q2nX+zthk+GLXrJQkYOnIk1ECIHfeFV8TWm5gej1LxZquBTA5pINoqDVq | ||
NKZSuZEHqGEFAiB6EDrxkovq8SYGhIQsJeqkTMO8n94xhMRZlFmIQDokEQIgAq5U | ||
r1UQNnUExRh7ZT0kFbMfO9jKYZVlQdCL9Dn93vo= | ||
MIIJKAIBAAKCAgEAu0E+tR6wfOAJZ4lASzRUmvorCgbI5nQyvZl3WLu6ko2pcEnq |
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.
can you clarify the goal of updating this key?
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.
The key is copied from the other PR because a new format was required. #1821
ah. got it. thanks for the link to that other PR. looks like i need to get up to speed with those details as well
Thanks for taking a look. I'll adjust based on your comments. The key is copied from the other PR because a new format was required. #1821 |
Hi @pixelass woud you be interested in rebasing this off the |
Hi, sorry for the silence. I've been very busy lately.
I can supoport with Jest, ESM and latest/best practices though and am happy to contribute. |
No need to move tests over to Jest is completely fine |
Closing in favour of #1922 |
This Pull Request attpempts to make probot esm compatible.
The current implementation creates a BREAKING CHANGE as it migrates probot to esm-only
The process is as follows
Local test output
closes: #1684