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

chore: Migrate from CommonJS to ECMAScript Modules (ESM) #397

Closed
wants to merge 2 commits into from

Conversation

gaganbiswas
Copy link

@gaganbiswas gaganbiswas commented Jan 17, 2024

Changes

  • Resolved the issue documented in Replace the request package by something else (DEPRECATED) #343 effectively closing it.
  • Removed deprecated and unmaintained dependencies, specifically addressing security concerns related to Prototype Pollution and Server-Side Request Forgery vulnerabilities in request and request-promise. Introduced axios as a replacement for improved security.
  • Rectified a bug in the package.json scripts. Now, executing the cp-types script correctly creates a types directory inside the dist folder.

Migration to ECMAScript Modules (ESM)

  • Successfully migrated the entire codebase from CommonJS to ECMAScript Modules (ESM).
  • Updated import statements and module syntax throughout the project to align with ECMAScript Modules.
  • Replaced require with import and module.exports with export.
  • Adjusted the package.json configuration to indicate ESM usage, setting the "type" field to "module".
  • Transitioned from using nyc to c8 for generating coverage reports.

@gaganbiswas
Copy link
Author

gaganbiswas commented Jan 17, 2024

@1995navinkumar @ankitdas13

@gaganbiswas gaganbiswas changed the title Changed API to use axios instead of request-promise chore: Migrate from CommonJS to ECMAScript Modules (ESM) Jan 18, 2024
@jinalskothari
Copy link

@ankitdas13 is this work not useful?

@jinalskothari
Copy link

@gaganbiswas thanks for contributing man. Since you seem to be familiar with the codebase, would you be willing to maintain a sensible (hopefully temporary, see #407) fork of this lib? Me and my colleague @makwanahardik will be happy to help.

@gaganbiswas
Copy link
Author

gaganbiswas commented Apr 20, 2024

@gaganbiswas thanks for contributing man. Since you seem to be familiar with the codebase, would you be willing to maintain a sensible (hopefully temporary, see #407) fork of this lib? Me and my colleague @makwanahardik will be happy to help.

Honestly my hands are full right now, so I don't know how much time I can give. But I am willing to help in anyway possible since an updated lib is required for this.

@jinalskothari
Copy link

@gaganbiswas , alright, good.

Depending on whether razorpay responds soon, we might have to maintain a usable fork after all. Obviously all your work would be a great starting point.

Cheers

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