veramo
veramo copied to clipboard
feat: migrate Veramo from CommonJS to ESM
What is being changed
- All Veramo packages now produce ESM instead of CommonJS. This is determined by
type: "module"
in each package'spackage.json
file. - The majority of changes in this PR relate to how packages are imported and exported. When referencing local files within a Veramo package, the
.js
file extension must be specified. Plugin Schemas (plugin.schema.json
) are now located within a package'ssrc' folder and exported in package's
package.json exports` field - minimum node version is now 16.x
-
docsconfig.json
changed todocsconfig.js
- jest code coverage now uses
coverageReporter v8
(support for import assertions) - importing
json
or other non-[js/ts] files requires import assertions -
jest
must be imported, cannot be accessed as a global -
test-react-app
ejected from Create React App to upgrade to ESM (modifications needed to webpack, build/start/test scripts)
Quality
Check all that apply:
- [X] I want these changes to be integrated
- [X] I successfully ran
yarn
,yarn build
,yarn test
,yarn test:browser
locally. - [X] I allow my PR to be updated by the reviewers (to speed up the review process).
- [ ] I added unit tests.
- [ ] I added integration tests.
- [X] I did not add automated tests because this PR simply refactors to ESM and does not add any new functionality
Codecov Report
Merging #1004 (b9391ef) into next (7b6d195) will increase coverage by
3.15%
. The diff coverage is67.95%
.
Additional details and impacted files
@@ Coverage Diff @@
## next #1004 +/- ##
==========================================
+ Coverage 80.57% 83.73% +3.15%
==========================================
Files 118 131 +13
Lines 4140 12932 +8792
Branches 919 1223 +304
==========================================
+ Hits 3336 10828 +7492
- Misses 801 2104 +1303
+ Partials 3 0 -3
closed in favor of #1103