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

Restructure market-cap repo to avoid index.ts conflict #182

Open
longngn opened this issue Nov 25, 2023 · 5 comments
Open

Restructure market-cap repo to avoid index.ts conflict #182

longngn opened this issue Nov 25, 2023 · 5 comments

Comments

@longngn
Copy link
Member

longngn commented Nov 25, 2023

Currently index.ts get conflicted a lot if we don't merge PRs for a while because everyone is updating it
Maybe we can refactor to like cardano-token-registry where each token is a file with its policyId + assetName be the file name, and the file will export default the fetcher

WDYT @MuesliSwapTeam @TheTapHouse @shadowkora

@MuesliSwapTeam
Copy link
Contributor

We were noticing the same, not sure how smooth JS can handle integration of a "loose bunch" of JS files :) We do also rely on some way to easily assess all tracked tokens, i.e. if a map is generated on the fly that holds as keys all the tokens that are tracked thats perfect for us.

@longngn
Copy link
Member Author

longngn commented Nov 28, 2023

We were noticing the same, not sure how smooth JS can handle integration of a "loose bunch" of JS files :) We do also rely on some way to easily assess all tracked tokens, i.e. if a map is generated on the fly that holds as keys all the tokens that are tracked thats perfect for us.

Currently we don't use npm library anymore, we just pull the latest commit and run internal/main.ts
If we do 1 fetcher = 1 file, then the script we can iterate through all files and dynamically require/import that module and run it

if you still want npm package, I can extend the build process to generate index.ts and build it

@MuesliSwapTeam
Copy link
Contributor

An autogenerated ´index.ts´ sounds good - after all the structure of the file is really straightforward.

@mezuny
Copy link
Contributor

mezuny commented Dec 15, 2023

If the structure is being changed as is, why not change token entries in /src/tokens/ to be .json files with a set structure to make it more accessible (and less prone to errors) for projects to modify these files? Feels like a import all .json files on the tokens folder would do the job, with a simple structure that takes care of all variables.

@longngn
Copy link
Member Author

longngn commented Dec 17, 2023

If the structure is being changed as is, why not change token entries in /src/tokens/ to be .json files with a set structure to make it more accessible (and less prone to errors) for projects to modify these files? Feels like a import all .json files on the tokens folder would do the job, with a simple structure that takes care of all variables.

yeah I'm also thinking about that but afraid that we can't accomodate to all projects' need, maybe a project has an adhoc formula

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

No branches or pull requests

3 participants