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

All the TypeScript, Better Docs, More Flexibility, and Fewer Vulnerabilities #7

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

Conversation

GodBleak
Copy link

@GodBleak GodBleak commented Nov 13, 2023

Hey there! This PR tackles the improvements I suggested in issue #6. Here's a breakdown of what's been done:

  1. Switched to TypeScript: The entire codebase is now in TypeScript, offering better type checks and a smoother experience for developers. I noticed the library uses TravisCI, which I'm not too familiar with, so I haven't included anything for compiling TypeScript. However, I'm more than willing to help set this up if needed.

  2. Added JSDoc Comments: No more switching between code and documentation. Now, all the documentation is right in the editor.

  3. No More CommonJS: The codebase has been updated to use modern ECMAScript syntax, making it more streamlined and up-to-date.

  4. New src Directory: I've reorganized the source files into a src folder for better structure and clarity.

  5. New HTTP Client Interface: I've introduced a Client interface for HTTP operations. Any class implementing this interface can be used as the HTTP client. Two implementations are provided: one based on Node's HTTPS module and another on the fetch API. These can be imported from telegra.ph/clients. The HTTPS client is the default if no other client is specified in options.client. This change also means dropping isomorphic-fetch, addressing its security vulnerabilities.

  6. Included LICENSE and readme.md in Package: It's standard practice to include these files in the package distribution, ensuring that users have access to full documentation and licensing information right off the bat.

  7. Updated README: The README now showcases ECMAScript syntax and includes an example for injecting an HTTP client.

I've thoroughly tested these changes, and everything seems to be in top shape. This update should significantly enhance the library's robustness, security, and usability. Eager to hear your thoughts! Resolves #6.

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.

General Improvements
1 participant