Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeconv updated #135

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

HeerthanaThiruAcen
Copy link

No description provided.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@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

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