Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Addition of a Data Provider Manager:
A new class
DataProviderManager
was added insrc/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.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 thepino
library. It also handles the creation of a logger with pretty-printing enabled, if possible.Creation of Utility Functions:
Several utility functions were added in
src/lib/util.ts
, such asfetchWithTimeout
andfetchData
. These functions help fetch resources from URLs with a timeout and fetch data from specific URLs with a specified response type and timeout, respectively.Restructuring of Components:
The project's components were restructured, with new components added and existing components modified. Some of the significant changes include:
src/components/Content.tsx
: A newContent
component was added, which includes the site layout and data presentation.src/components/Layout.tsx
: A newLayout
component was added, which includes the HTML structure of the site.src/components/index.ts
: The index file was updated to export the newContent
andLayout
components.Addition of Providers:
New providers were added to fetch data from different sources.
src/providers/bitcoind.ts
: A newBitcoindProvider
class was added to fetch data from a Bitcoind server.src/providers/esplora.ts
: A newEsploraProvider
class was added to fetch data from an Esplora server.Finally, the
prettier
package was added to thepackage.json
file [1] and thesrc/logger.ts
file was removed [2].