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

Dev super command: Extract core logic to flowkit package #1634

Open
bartolomej opened this issue Jun 2, 2024 · 1 comment
Open

Dev super command: Extract core logic to flowkit package #1634

bartolomej opened this issue Jun 2, 2024 · 1 comment
Labels
Feature A new user feature or a new package API

Comments

@bartolomej
Copy link
Contributor

Issue To Be Solved

flow dev command logic (used by flow super command group) can't be (re)used by external packages at the moment, as it lives in the flow-cli/internal package.

Suggest A Solution

More core logic (from project.go and files.go) to a non-internal package (preferably to flowkit repo, as that's where other such logic already lives), so that other packages or projects can reuse it if needed (useful mostly for other devtools).

This is similar to how DeployProject function lives in flowkit, instead of internal/project package.

Context

This would be useful for Flowser, as we want to build a browser-based Flow playground, which would include an emulator and (a subset of) Flow CLI all running within the browser.

We also want to make setting up and running a project at least as easy as when doing local development in the shell. For that, it may be good to reuse the logic from flow dev, to be consistent with how the project development flow works locally.

To be fair, I'm not sure it's worth refactoring and extracting this, as flow dev logic depends on some functions/dependencies that won't work as desired js/wasm environment (e.g. os.Stat which doesn't do anything on the web) + it's not necessarily that complicated to re-implement at the moment (although I think we could all benefit from using and improving a single such library function). But that could be solved by depending on an interface (e.g. ReaderWriter and FileWatcher) instead on the concrete implementation.

For more context, see our grant proposal: onflow/developer-grants#260

@bartolomej bartolomej added the Feature A new user feature or a new package API label Jun 2, 2024
@bartolomej
Copy link
Contributor Author

Related to #1633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature A new user feature or a new package API
Projects
Status: No status
Development

No branches or pull requests

1 participant