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

allow passing spkg.io from graph init #1641

Open
saihaj opened this issue Apr 24, 2024 · 4 comments
Open

allow passing spkg.io from graph init #1641

saihaj opened this issue Apr 24, 2024 · 4 comments
Assignees
Labels
area/cli enhancement New feature or request

Comments

@saihaj
Copy link
Member

saihaj commented Apr 24, 2024

Pull the substream package from spkg.io

image

@saihaj saihaj added enhancement New feature or request area/cli labels Apr 24, 2024
@joshuanazareth97
Copy link
Contributor

@saihaj can I pick this to work on next?

@saihaj
Copy link
Member Author

saihaj commented Apr 25, 2024

go for it @joshuanazareth97

@joshuanazareth97
Copy link
Contributor

@saihaj Notes on my understanding / the implementation I am planning:

  • As I understand it, there are 2 locations from which we could receive spkgPath: (1) flag (2) interactive prompt
  • The value received from either of these is passed into the same initSubgraphFromContract method, which then adds this to the manifest file under source
  • Currently, the file must exist in the path relative to the directory that graph init is called in

Approach:

  • Change the validation for the spkg file to also pass for the URL format above (spkg.io.../.../)
  • If we receive a URL, download the file into the current directory
  • In this case spkgPath becomes the name of the spkg file, since it is in the root of the current directory
  • Continue as before, passing spkgPath into the manifest, just like with local files

Bonus:

  • Potential UX improvement: If a URL is passed, we can further ask the user which directory they want to download the spkg file into, defaulting to the current dir. This would give more control to the user, but would require additional logic for creating non-existent folders etc.

Interested to know your thoughts around this approach.

@joshuanazareth97
Copy link
Contributor

Hey @saihaj, have implemented this using a slight variation of the approach above. have not yet implemented the bonus feature I mentioned, do let me know if there's anything you'd like me to change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants