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

Switch init to an interactive setup #1616

Merged
merged 118 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
b11cb5f
Move and refactor scaffold logic
chasefleming Apr 4, 2024
813d1a6
Refactor init config function to be separate from command
chasefleming Apr 5, 2024
fe4b4e2
Create init in setup
chasefleming Apr 8, 2024
d094f92
Create test
chasefleming Apr 8, 2024
10c549a
Add name prompt
chasefleming Apr 8, 2024
c9380a4
Refactor to take directory as arg
chasefleming Apr 8, 2024
4843b15
Change to fit new definition
chasefleming Apr 9, 2024
591ecbb
Fix test
chasefleming Apr 9, 2024
47e5d19
Ignore arg
chasefleming Apr 9, 2024
6c0ff39
Fix test path
chasefleming Apr 9, 2024
5bf6499
Fix generate custom directory logic
chasefleming Apr 9, 2024
4f46a92
Remove prints
chasefleming Apr 9, 2024
e50fea5
Generate files for structure
chasefleming Apr 9, 2024
360c4d5
Fix imports
chasefleming Apr 9, 2024
f8d08b2
Merge branch 'master' into chasefleming/1481
chasefleming Apr 10, 2024
eac9436
Merge pull request #1504 from onflow/chasefleming/1481
chasefleming Apr 10, 2024
b219e11
Setup should prompt to add core contracts as dependencies and install…
chasefleming Apr 15, 2024
c7e7767
Move to prompt pkg
chasefleming Apr 16, 2024
86dc574
Rename as SelectOptions
chasefleming Apr 16, 2024
1c22663
Move prompt to its own file
chasefleming Apr 16, 2024
7b0c201
Run go imports fix
chasefleming Apr 16, 2024
1b8d2be
Merge pull request #1521 from onflow/chasefleming/prompt-pkg
chasefleming Apr 16, 2024
e7a2f49
Create text input
chasefleming Apr 17, 2024
10ba978
Replace existing prompt
chasefleming Apr 17, 2024
95ff190
Add Run methods to each prompt
chasefleming Apr 17, 2024
4d4773c
Make models private
chasefleming Apr 17, 2024
274a698
Fix imports
chasefleming Apr 17, 2024
6fe0278
Add header
chasefleming Apr 17, 2024
56d0d3e
Merge pull request #1527 from onflow/chasefleming/update-text-input
chasefleming Apr 17, 2024
f0a09d4
Merge master into feature branch (#1534)
chasefleming Apr 22, 2024
c38bc1f
Merge branch 'master' into cf/merge-master-4-24
chasefleming Apr 24, 2024
b7f4cd6
Merge pull request #1537 from onflow/cf/merge-master-4-24
chasefleming Apr 24, 2024
5692e5f
Merge branch 'master' into cf/merge-master-5-1
chasefleming May 1, 2024
4d70ea1
Merge pull request #1552 from onflow/cf/merge-master-5-1
chasefleming May 1, 2024
8f00ed8
Create project in temp directory then move to target directory if suc…
chasefleming May 1, 2024
3d435c1
Move scaffold logic to its own function
chasefleming May 1, 2024
f007474
Move interactive setup to its own function
chasefleming May 1, 2024
45022d1
Update internal/super/setup.go
chasefleming May 1, 2024
854a60c
Update internal/super/setup.go
chasefleming May 1, 2024
0ce2016
Update internal/super/setup.go
chasefleming May 1, 2024
7cddd11
Update internal/super/setup.go
chasefleming May 1, 2024
be7805a
Update internal/super/setup.go
chasefleming May 1, 2024
3d1b54e
nil fix
jribbink May 1, 2024
efd1eea
Remove print
chasefleming May 1, 2024
5a49978
Merge branch 'chasefleming/1531' of https://github.com/onflow/flow-cl…
chasefleming May 1, 2024
d356ca2
Merge pull request #1553 from onflow/chasefleming/1531
chasefleming May 1, 2024
9f44b3f
Merge branch 'master' into cf/update-feature-branch-5-2
chasefleming May 2, 2024
e4dfbc8
Merge pull request #1563 from onflow/cf/update-feature-branch-5-2
chasefleming May 2, 2024
2b2d1a0
Disable logs and refactor to Generator
chasefleming May 2, 2024
4b1adb0
Move templates to create as arg
chasefleming May 3, 2024
7aa20ef
Change generator to options
chasefleming May 3, 2024
4784f5f
Disable logs
chasefleming May 3, 2024
25e987a
Move to util
chasefleming May 3, 2024
82b8917
Remove check
chasefleming May 3, 2024
76d43f3
Run goimport fix
chasefleming May 3, 2024
792f973
Add cadence dir constant
chasefleming May 3, 2024
6542844
Use constants for types
chasefleming May 3, 2024
b4b68bd
Move contract update to seperate method
chasefleming May 3, 2024
599b2bd
Run imports fix
chasefleming May 3, 2024
cb630fd
Change constructor
chasefleming May 3, 2024
11d22ae
Change template types to be categorized
chasefleming May 3, 2024
857a483
Make private
chasefleming May 3, 2024
5a7a078
Merge pull request #1566 from onflow/chasefleming/1554
chasefleming May 3, 2024
d17f617
Change contract state to relative path
chasefleming May 3, 2024
9fce84b
Merge pull request #1568 from onflow/chasefleming/1532
chasefleming May 3, 2024
73d1f46
Misc messaging improvements
chasefleming May 6, 2024
c12bb77
Go imports fix
chasefleming May 6, 2024
3bb81b0
Merge pull request #1572 from onflow/cf/message-improvements
chasefleming May 6, 2024
c8402c3
Fix blocking command error
chasefleming May 6, 2024
95bee6c
Run goimports fix
chasefleming May 6, 2024
7a79071
Update internal/super/setup.go
chasefleming May 6, 2024
a0d92b3
Fix error
chasefleming May 6, 2024
d74cf45
Merge pull request #1573 from onflow/chasefleming/fix-command-err
chasefleming May 6, 2024
fdece34
Generate contract in account if given
chasefleming May 6, 2024
0220f8b
Merge pull request #1576 from onflow/chasefleming/gen-contract-in-acc…
chasefleming May 6, 2024
42e4c2a
Don't require flag to start emulator with `flow dev`
chasefleming May 6, 2024
1fdb27b
Change to disable flag
chasefleming May 6, 2024
ca6fce3
Merge branch 'master' into cf/merge-master-5-6
chasefleming May 6, 2024
07d288b
Merge pull request #1580 from onflow/chasefleming/1579
chasefleming May 6, 2024
3a4f939
Merge pull request #1581 from onflow/cf/merge-master-5-6
chasefleming May 6, 2024
303b468
Change emulator key to saving in target dir
chasefleming May 7, 2024
5556267
Make generator saving state optional
chasefleming May 7, 2024
b2c896b
Change setup to init
chasefleming May 7, 2024
d2b8a6e
Change messaging
chasefleming May 7, 2024
4b39f41
Remove example account
chasefleming May 7, 2024
6e4b5d7
Update message
chasefleming May 7, 2024
867ebbf
Undo comment out
chasefleming May 9, 2024
34f4516
Remove
chasefleming May 9, 2024
a6cdb6a
Remove old code
chasefleming May 9, 2024
801bf6c
Run goimports fix
chasefleming May 9, 2024
eb7ed3a
Fix test
chasefleming May 9, 2024
40dd865
Fix test
chasefleming May 9, 2024
008cf31
Merge pull request #1584 from onflow/cf/demo
chasefleming May 15, 2024
a208fdd
Merge branch 'master' into cf/update-branch-5-15
chasefleming May 15, 2024
805009b
Fix lint
chasefleming May 15, 2024
7e71c5e
Remove
chasefleming May 15, 2024
d1cd5d8
Merge branch 'master' into cf/update-branch-5-15
chasefleming May 16, 2024
87750b5
Run goimports fix
chasefleming May 16, 2024
d1bd91b
Fix tests
chasefleming May 16, 2024
e0103f6
Merge pull request #1601 from onflow/cf/update-branch-5-15
chasefleming May 16, 2024
5c5b9c1
Prompt if they'd like to install core contracts
chasefleming May 16, 2024
8fec985
Run goimports fix
chasefleming May 16, 2024
ef02c1e
Merge pull request #1604 from onflow/chasefleming/1586
chasefleming May 16, 2024
1f68ca8
Fix emulator key gen target dir
chasefleming May 17, 2024
247ac54
Merge pull request #1605 from onflow/cf/minor-fixes
chasefleming May 17, 2024
67fd36b
Add config only flag
chasefleming May 17, 2024
885bc37
Merge pull request #1606 from onflow/chasefleming/config-only-flag
chasefleming May 17, 2024
2e88c4e
Setup alternative template options for generation
chasefleming May 20, 2024
56aca93
Change how data is handled in templates
chasefleming May 20, 2024
eab6b33
Remove
chasefleming May 20, 2024
65e46a2
Merge pull request #1610 from onflow/chasefleming/generate-with-options
chasefleming May 20, 2024
95a9bf5
Revert messaging
chasefleming May 21, 2024
7ec7d08
Merge pull request #1612 from onflow/cf/revert-messagin
chasefleming May 22, 2024
1c96866
Merge branch 'refs/heads/master' into cf/update-master-5-21
chasefleming May 22, 2024
18790b9
Continue merge
chasefleming May 22, 2024
1741481
Merge pull request #1614 from onflow/cf/update-master-5-21
chasefleming May 22, 2024
b15c32b
Remove comments
chasefleming May 23, 2024
862c7e3
Merge pull request #1617 from onflow/cf/remove-comments
chasefleming May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/flow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func main() {
}

// quick commands
quick.InitCommand.AddToParent(cmd)
quick.DeployCommand.AddToParent(cmd)
quick.RunCommand.AddToParent(cmd)

Expand Down
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module github.com/onflow/flow-cli
go 1.20

require (
github.com/charmbracelet/bubbles v0.18.0
github.com/charmbracelet/bubbletea v0.25.0
github.com/dukex/mixpanel v1.0.1
github.com/getsentry/sentry-go v0.27.0
github.com/go-git/go-git/v5 v5.11.0
Expand Down Expand Up @@ -49,6 +51,8 @@ require (
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect
Expand All @@ -57,6 +61,7 @@ require (
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charmbracelet/lipgloss v0.9.1 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
Expand All @@ -66,6 +71,7 @@ require (
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
Expand Down Expand Up @@ -158,16 +164,22 @@ require (
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/lmars/go-slip10 v0.0.0-20190606092855-400ba44fee12 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-tty v0.0.4 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.12.2 // indirect
Expand Down Expand Up @@ -248,6 +260,7 @@ require (
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.17.0 // indirect
Expand Down
27 changes: 27 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
Expand All @@ -136,6 +138,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4 h1:rdovz3rEu
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.0 h1:HWsM0YQWX76V6MOp07YuTYacm8k7h69ObJuw7Nck+og=
github.com/aws/aws-sdk-go-v2/service/s3 v1.15.0 h1:nPLfLPfglacc29Y949sDxpr3X/blaY40s3B85WT2yZU=
github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
Expand Down Expand Up @@ -177,6 +181,12 @@ github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0=
github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw=
github.com/charmbracelet/bubbletea v0.25.0 h1:bAfwk7jRz7FKFl9RzlIULPkStffg5k6pNt5dywy4TcM=
github.com/charmbracelet/bubbletea v0.25.0/go.mod h1:EN3QDR1T5ZdWmdfDzYcqOCAps45+QIJbLOBxmVNWNNg=
github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg=
github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I=
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
Expand Down Expand Up @@ -215,6 +225,8 @@ github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH
github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M=
github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY=
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY=
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
Expand Down Expand Up @@ -764,6 +776,8 @@ github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczG
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/logrusorgru/aurora/v4 v4.0.0 h1:sRjfPpun/63iADiSvGGjgA1cAYegEWMPCJdUpJYn9JA=
github.com/logrusorgru/aurora/v4 v4.0.0/go.mod h1:lP0iIa2nrnT/qoFXcOZSrZQpJ1o6n2CUf/hyHi2Q4ZQ=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
Expand Down Expand Up @@ -795,12 +809,15 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
Expand Down Expand Up @@ -847,6 +864,14 @@ github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVq
github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34=
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA=
github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE=
github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI=
Expand Down Expand Up @@ -1052,6 +1077,7 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down Expand Up @@ -1565,6 +1591,7 @@ golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
4 changes: 2 additions & 2 deletions internal/accounts/contract-add.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"context"
"fmt"

"github.com/onflow/flow-cli/internal/util"
"github.com/onflow/flow-cli/internal/prompt"

"github.com/onflow/cadence"
flowsdk "github.com/onflow/flow-go-sdk"
Expand Down Expand Up @@ -88,7 +88,7 @@ func deployContract(update bool, flags *deployContractFlags) command.RunWithStat

deployFunc := flowkit.UpdateExistingContract(update)
if updateContractFlags.ShowDiff {
deployFunc = util.ShowContractDiffPrompt(logger)
deployFunc = prompt.ShowContractDiffPrompt(logger)
}

txID, _, err := flow.AddContract(
Expand Down
6 changes: 3 additions & 3 deletions internal/accounts/contract-remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"context"
"fmt"

"github.com/spf13/cobra"
"github.com/onflow/flow-cli/internal/prompt"

"github.com/onflow/flow-cli/internal/util"
"github.com/spf13/cobra"

"github.com/onflow/flowkit"
"github.com/onflow/flowkit/output"
Expand Down Expand Up @@ -70,7 +70,7 @@ func removeContract(
return nil, err
}

removeFromState := util.RemoveContractFromFlowJSONPrompt(contractName)
removeFromState := prompt.RemoveContractFromFlowJSONPrompt(contractName)

if removeFromState {
// If a network flag is provided, remove from that networks deployments
Expand Down
6 changes: 4 additions & 2 deletions internal/accounts/create-interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"strings"
"time"

"github.com/onflow/flow-cli/internal/prompt"

flowsdk "github.com/onflow/flow-go-sdk"
"github.com/onflow/flow-go-sdk/crypto"
"google.golang.org/grpc/codes"
Expand All @@ -50,8 +52,8 @@ import (
// and it then uses account creation APIs to automatically create the account on the network as well as save it.
func createInteractive(state *flowkit.State) (*accountResult, error) {
log := output.NewStdoutLogger(output.InfoLog)
name := util.AccountNamePrompt(state.Accounts().Names())
networkName, selectedNetwork := util.CreateAccountNetworkPrompt()
name := prompt.AccountNamePrompt(state.Accounts().Names())
networkName, selectedNetwork := prompt.CreateAccountNetworkPrompt()
privateFile := accounts.PrivateKeyFile(name, "")

// create new gateway based on chosen network
Expand Down
4 changes: 3 additions & 1 deletion internal/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (
"sync"
"time"

"github.com/onflow/flow-cli/internal/prompt"

"github.com/dukex/mixpanel"
"github.com/getsentry/sentry-go"
"github.com/spf13/afero"
Expand Down Expand Up @@ -326,7 +328,7 @@ func initCrashReporting() {
// ask for crash report permission
fmt.Printf("\n%s Crash detected! %s\n\n", output.ErrorEmoji(), event.Message)

if util.ReportCrash() {
if prompt.ReportCrash() {
return event
} else {
fmt.Printf("\nPlease help us improve the Flow CLI by opening an issue on https://github.com/onflow/flow-cli/issues, \nand pasting the output as well as a description of the actions you took that resulted in this crash.\n\n")
Expand Down
9 changes: 5 additions & 4 deletions internal/config/add-account.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"fmt"
"strconv"

"github.com/onflow/flow-cli/internal/prompt"

"github.com/onflow/flowkit/accounts"

"github.com/onflow/flow-go-sdk"
Expand All @@ -33,7 +35,6 @@ import (
"github.com/onflow/flowkit/output"

"github.com/onflow/flow-cli/internal/command"
"github.com/onflow/flow-cli/internal/util"
)

type flagsAddAccount struct {
Expand Down Expand Up @@ -71,7 +72,7 @@ func addAccount(
}

if !flagsProvided {
raw = util.NewAccountPrompt()
raw = prompt.NewAccountPrompt()
}

key, err := parseKey(raw.Key, raw.SigAlgo)
Expand Down Expand Up @@ -140,7 +141,7 @@ func parseKeyIndex(value string) (int, error) {
return v, nil
}

func flagsToAccountData(flags flagsAddAccount) (*util.AccountData, bool, error) {
func flagsToAccountData(flags flagsAddAccount) (*prompt.AccountData, bool, error) {
if flags.Name == "" && flags.Address == "" && flags.Key == "" {
return nil, false, nil
}
Expand All @@ -157,7 +158,7 @@ func flagsToAccountData(flags flagsAddAccount) (*util.AccountData, bool, error)
return nil, true, fmt.Errorf("invalid address")
}

return &util.AccountData{
return &prompt.AccountData{
Name: flags.Name,
Address: flags.Address,
SigAlgo: flags.SigAlgo,
Expand Down
9 changes: 5 additions & 4 deletions internal/config/add-contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ package config
import (
"fmt"

"github.com/onflow/flow-cli/internal/prompt"

"github.com/onflow/flow-go-sdk"
"github.com/spf13/cobra"

Expand All @@ -29,7 +31,6 @@ import (
"github.com/onflow/flowkit/output"

"github.com/onflow/flow-cli/internal/command"
"github.com/onflow/flow-cli/internal/util"
)

type flagsAddContract struct {
Expand Down Expand Up @@ -66,7 +67,7 @@ func addContract(
}

if !flagsProvided {
raw = util.NewContractPrompt()
raw = prompt.NewContractPrompt()
}

contract := config.Contract{
Expand Down Expand Up @@ -107,7 +108,7 @@ func addContract(
}, nil
}

func flagsToContractData(flags flagsAddContract) (*util.ContractData, bool, error) {
func flagsToContractData(flags flagsAddContract) (*prompt.ContractData, bool, error) {
if flags.Name == "" && flags.Filename == "" {
return nil, false, nil
}
Expand Down Expand Up @@ -136,7 +137,7 @@ func flagsToContractData(flags flagsAddContract) (*util.ContractData, bool, erro
return nil, true, fmt.Errorf("invalid mainnnet alias address")
}

return &util.ContractData{
return &prompt.ContractData{
Name: flags.Name,
Source: flags.Filename,
Emulator: flags.EmulatorAlias,
Expand Down
9 changes: 5 additions & 4 deletions internal/config/add-deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ package config
import (
"fmt"

"github.com/onflow/flow-cli/internal/prompt"

"github.com/spf13/cobra"

"github.com/onflow/flowkit"
"github.com/onflow/flowkit/config"
"github.com/onflow/flowkit/output"

"github.com/onflow/flow-cli/internal/command"
"github.com/onflow/flow-cli/internal/util"
)

type flagsAddDeployment struct {
Expand Down Expand Up @@ -63,7 +64,7 @@ func addDeployment(
}

if !flagsProvided {
raw = util.NewDeploymentPrompt(*state.Networks(), state.Config().Accounts, *state.Contracts())
raw = prompt.NewDeploymentPrompt(*state.Networks(), state.Config().Accounts, *state.Contracts())
}

deployment := state.Deployments().ByAccountAndNetwork(raw.Account, raw.Network)
Expand All @@ -90,7 +91,7 @@ func addDeployment(
}, nil
}

func flagsToDeploymentData(flags flagsAddDeployment) (*util.DeploymentData, bool, error) {
func flagsToDeploymentData(flags flagsAddDeployment) (*prompt.DeploymentData, bool, error) {
if flags.Network == "" && flags.Account == "" && len(flags.Contracts) == 0 {
return nil, false, nil
}
Expand All @@ -103,7 +104,7 @@ func flagsToDeploymentData(flags flagsAddDeployment) (*util.DeploymentData, bool
return nil, true, fmt.Errorf("at least one contract name must be provided")
}

return &util.DeploymentData{
return &prompt.DeploymentData{
Network: flags.Network,
Account: flags.Account,
Contracts: flags.Contracts,
Expand Down
4 changes: 3 additions & 1 deletion internal/config/add-network.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"fmt"
"net/url"

"github.com/onflow/flow-cli/internal/prompt"

"github.com/spf13/cobra"

"github.com/onflow/flowkit"
Expand Down Expand Up @@ -64,7 +66,7 @@ func addNetwork(
}

if !flagsProvided {
raw = util.NewNetworkPrompt()
raw = prompt.NewNetworkPrompt()
}

state.Networks().AddOrUpdate(config.Network{
Expand Down
Loading
Loading