diff --git a/packages/oslo-extractor-uml-ea/lib/MdbReaderWrapper.ts b/packages/oslo-extractor-uml-ea/lib/MdbReaderWrapper.ts index d26c255..a198e7d 100644 --- a/packages/oslo-extractor-uml-ea/lib/MdbReaderWrapper.ts +++ b/packages/oslo-extractor-uml-ea/lib/MdbReaderWrapper.ts @@ -8,12 +8,13 @@ import * as MDBReaderOriginal from 'mdb-reader'; // 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. -// This fix was implemented to fix the encoding problem that arose with using the mdb-reader library: +// This fix waks implemented to fix the encoding problem that arose with using the mdb-reader library: // https://github.com/andipaetzold/mdb-reader/issues/172 // This was also something that our editors noticed and we had to fix it in order to use the library: // https://github.com/Informatievlaanderen/OSLO-UML-Transformer/issues/36 -const MDBReader = MDBReaderOriginal.default.default; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const MDBReader = (MDBReaderOriginal.default).default; export default MDBReader; \ No newline at end of file diff --git a/scripts/esmtocjs.js b/scripts/esmtocjs.js index 1979c16..b64974e 100644 --- a/scripts/esmtocjs.js +++ b/scripts/esmtocjs.js @@ -1,21 +1,21 @@ const esbuild = require('esbuild'); const glob = require('glob'); -const fs = require('fs').promises; +const fs = require('fs'); const path = require('path'); -async function transpileNodeModules() { +const transpileNodeModules = async () => { // Get package.json file of mdb-reader module const packageJsonPath = 'packages/oslo-extractor-uml-ea/node_modules/mdb-reader/package.json'; try { - const json = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8')); + const json = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); // Skip unless the type of the package is ESM if (!json.name || json.type !== 'module') { return; } - console.log(`🦀 Transpiling ${json.name}...`); + console.log(`🦀 Transpiling ${json?.name}...`); const dir = path.dirname(packageJsonPath); @@ -45,11 +45,10 @@ async function transpileNodeModules() { // Change the type of the package to commonjs json.type = 'commonjs'; - await fs.writeFile(packageJsonPath, JSON.stringify(json, null, 2)); + fs.writeFileSync(packageJsonPath, JSON.stringify(json, null, 2)); } catch (e) { console.log('Error: Wasnt able to run postinstall script. Make sure the packages inside oslo-extractor-uml-ea are installed.') console.error(e); } } - transpileNodeModules(); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 7e8b8a0..df01a3a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "removeComments": false, "preserveConstEnums": true, + "skipLibCheck": true, "sourceMap": true, "inlineSources": true, "declaration": true,