Skip to content

Conversation

@HeerthanaThiruAcen
Copy link

No description provided.

@bfaulk96
Copy link
Collaborator

bfaulk96 commented May 9, 2024

typeconv v2 uses ESM, which this repo does not support yet, and I don't have the bandwidth to look into updating it to. If you're able to figure that out, I'm happy to upgrade typeconv

@HeerthanaThiruAcen
Copy link
Author

Yeah, After upgrading to typeconv v2, it became apparent that the package no longer supports the 'require' syntax, necessitating the use of 'import' statements instead.

Within the 'dist > ServerlessAutoSwagger.js' file, the original code block:
const typeconv_1 = require(typeconv); const packagePath = (0, path_1.dirname)(require.resolve('serverless-auto-swagger/package.json'));

Was replaced with the following code:

`
let typeconv_1 = null; import('typeconv') .then((typeconv) => { typeconv_1 = typeconv; }) .catch((error) => { console.error('Error during dynamic import: ', error); });

const packagePath = (0, path_1.dirname)(require.resolve('serverless-auto-swagger-update-typeconv/package.json'));
`

The adjustments proved effective, allowing seamless integration. Following the modifications, we proceeded to publish the updated version on our npm account, enabling its utilization to meet our project requirements. For further details, please refer to serverless-auto-swagger-updated-typeconv-esm

@bfaulk96
Copy link
Collaborator

If you're willing to update this PR with the necessary steps to convert this library to ESM, I'd be happy to release it as v4.0.0

I unfortunately just don't have the time to update this repository anymore

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