onflow / onflow/flow-cli

Dependency Manager: Extract core logic to flowkit package

Open
#1,633 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Go
Stars
209
Forks
87
Avg merge
1d 17h
Merged PRs (30d)
3

Description

Issue To Be Solved

Dependency management logic (used by flow dependencies 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 (dependencyinstaller.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.

Since we can't just "import" the flow-cli/cmd and use it in the browser like so flowCli.RunCommand("flow dependencies add ...") (made up function for illustration), we'll need to re-implement a subset of Flow CLI commands (which would include contract management commands imo) from scratch and hopefully reuse as much of the underlying core logic as possible to ensure consistent behavior and more code reuse.

For more context, see our grant proposal: https://github.com/onflow/developer-grants/issues/260

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with dependencyinstaller.go and the flow dependencies command group, then compare the existing DeployProject placement in flowkit. Move the reusable dependency-management logic into a non-internal flowkit package while preserving the command behavior and making it importable by external projects such as Flowser.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.