This PR resolves a few minor UX issues I ran into while using the tool today. In particular, it:
Improves the error when running app publish with an unregistered app (closes #569)
Adds a new error when running app register without a config.yaml (closes #538)
Adds a new error when running whoami without a config.yaml
Changes one pre-existing error message to have a consistent style with other similar error messages
Feel free to nitpick this as much as you'd like; I haven't worked with the repo before, and I'm out of practice with Haskell, so it's likely I'm missing some idioms!
In particular, I suspect some of these error strings should be pulled into Fission.CLI.Error.Types. Then I could probably define a helper somewhere that translates the NotFound FilePath into a NotConfigured error that more nicely encapsulates this concern.
I avoided doing that to keep these changes small and avoid imposing too large of a review burden onto anyone, but I'm happy to make any adjustments!
Test plan (required)
app publish with an unregistered app:
[nix-shell:~/dev/fission]$ cat fission.yaml
ignore: []
url: does-not-exist.fission.app
build: ./assets
[nix-shell:~/dev/fission]$ stack run -- app publish
🕛🛫 App publish local preflight
🕑✈️ Pushing to remotePeer List...
🚫 The app has not yet been registered. Please delete your fission.yaml and run `fission app register --name some-name`
[nix-shell:~/dev/fission]$ rm fission.yaml
[nix-shell:~/dev/fission]$ stack run -- app register
👷 Choose build directory (.): assets
✅ App initialized as geriatric-yellow-centaur.fission.app
⏯️ Next run fission app publish [--open|--watch] to sync data
💁 It may take DNS time to propagate this initial setup globally. In this case, you can always view your app at https://ipfs.runfission.com/ipns/geriatric-yellow-centaur.fission.app
[nix-shell:~/dev/fission]$ stack run -- app publish
🕛🛫 App publish local preflight
🕒✈️ Pushing to remotePeer List...
🚀 Now live on the network
📝 DNS updated! Check out your site at:
🔗 geriatric-yellow-centaur.fission.app
app register and whoami without being logged in:
[nix-shell:~/dev/fission]$ cat ~/.config/fission/config.yaml
cat: /Users/quinn/.config/fission/config.yaml: No such file or directory
[nix-shell:~/dev/fission]$ stack run -- app register
🚫 Fission is installed, but you are not logged in. Please run `fission login`
[nix-shell:~/dev/fission]$ stack run -- whoami
🚫 Fission is installed, but you are not logged in. Please run `fission login`
[nix-shell:~/dev/fission]$ mv ~/.config/fission/config.yaml.old ~/.config/fission/config.yaml
[nix-shell:~/dev/fission]$ stack run -- app register
👷 Choose build directory (.): ^C
[nix-shell:~/dev/fission]$ stack run -- whoami
💻 Currently logged in as: quinn
Summary
This PR resolves a few minor UX issues I ran into while using the tool today. In particular, it:
app publish
with an unregistered app (closes #569)app register
without aconfig.yaml
(closes #538)whoami
without aconfig.yaml
Feel free to nitpick this as much as you'd like; I haven't worked with the repo before, and I'm out of practice with Haskell, so it's likely I'm missing some idioms!
In particular, I suspect some of these error strings should be pulled into
Fission.CLI.Error.Types
. Then I could probably define a helper somewhere that translates theNotFound FilePath
into aNotConfigured
error that more nicely encapsulates this concern.I avoided doing that to keep these changes small and avoid imposing too large of a review burden onto anyone, but I'm happy to make any adjustments!
Test plan (required)
app publish
with an unregistered app:app register
andwhoami
without being logged in: