-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Migrate to ESM format #117
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mocking modules requires to use an unstable api and need to enable experimental flag on node for jest to use esm. https://jestjs.io/docs/ecmascript-modules
tempy uses ESM Node options --experimental-vm-modules Needed to run tests with ESM
14, 16, 18
Node 14 ships with npm 6 which does not support npm workspaces - so install 7 globally. List the packages in build order, git-mob depends on git-mob-core.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modernising Git Mob by moving over to the natively supported ESM modules in NodeJS.
Support newer versions of Git Mob dependencies as they move over to ESM modules.
This does mean you need to run on Node 16+
Helpful information
Mocking modules require to use of an unstable API and need to enable an experimental flag on the node for jest to use esm.
https://jestjs.io/docs/ecmascript-modules
Also need to run node argument
NODE_OPTIONS=--experimental-vm-modules
All imports need to have their file extension
.js
else it won't find the module and you will get an import errror.Pull request checklist
npm run build
) was run locally and any changes were pushednpm run checks
) has passed locally and any fixes were made for failuresPlease check the type of change your PR introduces:
Does this introduce a breaking change?
Other information