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

refactor: migration to ESM #201

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gian1200
Copy link

@gian1200 gian1200 commented Oct 23, 2024

DO NOT MERGE: Tests pending

Summary

  • Quick migration to ESM
  • Added some workarounds to path handling (in defaults.mjs)
  • Modified Script to explicitly use node (npm run release doesn't work)
  • Reorder imports in the following order:
    • Node native packages
    • Dependency packages
    • Project modules

BREAKING CHANGE: migration to ESM
Split changes into 2 commits to keep history changes on git

BREAKING CHANGE: migration to ESM
@gian1200 gian1200 marked this pull request as draft October 23, 2024 05:45
@gian1200 gian1200 changed the title DRAFT: Feat/migration to esm Feat/migration to esm Oct 23, 2024
@gian1200 gian1200 changed the title Feat/migration to esm refactor: migration to ESM Oct 23, 2024
@@ -13,7 +13,7 @@
"test": "jest",
"test:unit": "jest --testPathIgnorePatterns test/git.integration-test.js",
"test:git-integration": "jest --testPathPattern test/git.integration-test.js",
"release": "bin/cli.js"
Copy link
Member

Choose a reason for hiding this comment

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

I hadn't noticed this - but we don't actually use this script to release any more - it could be removed.

(commit-and-tag-version is actually released with release please - very convenient for github projects, if your use-case is covered and you don't run into the many bugs it has)

Copy link
Author

Choose a reason for hiding this comment

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

Sure. No problem. I can remove it when I return to this PR (hopefully this weekend)

For convenience I actually use it to debug the changes

@gian1200
Copy link
Author

Migration to ESM is almost complete. However I'm facing an issue.

Looks like Jest does not have an stable version compatible with ESM. It currently only provides an experimental support. However not all commit-and-tag-version tests run correctly in this mode.

I've read that some suggest to migrate to Vitest while others to Mocha. I've not used Vitest, but I do have some experience with Mocha. Migration looks doable on any of them.

@TimothyJones do you have any opinion or suggestion regarding this?

@TimothyJones
Copy link
Member

I feel like the community is moving towards vitest, and it's supposed to be jest compatible these days - shall we try that?

@TimothyJones
Copy link
Member

And, thanks again for all your hard work on this - so so much appreciated!!

@gian1200
Copy link
Author

No problem. To be fair, I'm partially motivated by the fix that is available in the last version 😅.

Regarding Vitest, it's something I've never used, but will try to implement it (in a separate PR).

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.

2 participants