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

Refactor and modularise #46

Merged
merged 11 commits into from
Feb 19, 2024
Merged

Refactor and modularise #46

merged 11 commits into from
Feb 19, 2024

Conversation

mrfelton
Copy link
Member

@mrfelton mrfelton commented Feb 19, 2024

Refactoring to consolidate organic growth of the codebase into a more concise implementation that will be easier to maintain moving forwards.

This pull request introduces multiple changes to the codebase to improve the functionality and structure of the project. The most important changes include the addition of a data provider manager, the implementation of a logger, the creation of utility functions, and the restructuring of the project's components.

Here are the top five most important changes:

  1. Addition of a Data Provider Manager:
    A new class DataProviderManager was added in src/lib/DataProviderManager.ts. This class manages data providers, allowing the registration of new providers and fetching data from the cache or providers. It also includes methods to fetch and sort data points, merge fee estimates, and more.

  2. Implementation of a Logger:
    A new logger was implemented in src/lib/logger.ts. This logger creates a new logger with a specified log level using the pino library. It also handles the creation of a logger with pretty-printing enabled, if possible.

  3. Creation of Utility Functions:
    Several utility functions were added in src/lib/util.ts, such as fetchWithTimeout and fetchData. These functions help fetch resources from URLs with a timeout and fetch data from specific URLs with a specified response type and timeout, respectively.

  4. Restructuring of Components:
    The project's components were restructured, with new components added and existing components modified. Some of the significant changes include:

  5. Addition of Providers:
    New providers were added to fetch data from different sources.

Finally, the prettier package was added to the package.json file [1] and the src/logger.ts file was removed [2].

@mrfelton mrfelton added the type:refactor Indicates a refactor of existing code label Feb 19, 2024
@mrfelton mrfelton self-assigned this Feb 19, 2024
@mrfelton mrfelton merged commit f771823 into master Feb 19, 2024
1 check passed
@mrfelton mrfelton deleted the refactor branch February 19, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:refactor Indicates a refactor of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant