-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some context to the dirty fix of the wrapper
- Loading branch information
1 parent
47995bb
commit b0bd8d5
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as MDBReaderOriginal from 'mdb-reader'; | ||
|
||
// This is a very dirty fix to a problem with one of the external libraries we use being mdb-reader. | ||
// As of version 2.x the library is written in ESM and does not | ||
// support CommonJS: https://github.com/andipaetzold/mdb-reader/releases/tag/v2.0.0-next.7 | ||
// This means that we cannot use it in our project as it is and we either need to fork it | ||
// and fix it ourselves or use a dirty workaround | ||
// The workaround is to use the default import of the library and then access the default property | ||
// of the default import, which will throw some errors in the editor, but will work as expected. | ||
|
||
|
||
const MDBReader = MDBReaderOriginal.default.default; | ||
Check failure on line 12 in packages/oslo-extractor-uml-ea/lib/MdbReaderWrapper.ts GitHub Actions / test (ubuntu-latest, 16.x)
Check failure on line 12 in packages/oslo-extractor-uml-ea/lib/MdbReaderWrapper.ts GitHub Actions / test (ubuntu-latest, 18.x)
Check failure on line 12 in packages/oslo-extractor-uml-ea/lib/MdbReaderWrapper.ts GitHub Actions / build (ubuntu-latest, 16.x)
|
||
|
||
export default MDBReader; |