Massive UX rewrite

- Ditch multiple libraries for progressbar, spinner, colors and replace
  with pterm
- Detect when running on terminal and disable automatically spinner
- Add support for multiple progress bars
- Huge rewrite of the configuration part. No more crazy stuff with viper
  CLI commands now correctly overrides default config file as expected
- Limit banner to be displayed on relevant parts

Fixes #211
Fixes #105
Fixes #247
Fixes #233
This commit is contained in:
Ettore Di Giacinto
2021-10-19 22:26:23 +02:00
parent d4edaa9de8
commit fe14d56afe
45 changed files with 730 additions and 463 deletions

View File

@@ -18,8 +18,7 @@ package backend_test
import (
"testing"
. "github.com/mudler/luet/cmd"
config "github.com/mudler/luet/pkg/config"
. "github.com/mudler/luet/cmd/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -27,6 +26,6 @@ import (
func TestSolver(t *testing.T) {
RegisterFailHandler(Fail)
LoadConfig(config.LuetCfg)
LoadConfig()
RunSpecs(t, "Backend Suite")
}

View File

@@ -53,7 +53,7 @@ func runCommand(cmd *exec.Cmd) error {
cmd.Stderr = writer
if buffered {
Spinner(22)
Spinner(32)
defer SpinnerStop()
}

View File

@@ -29,7 +29,6 @@ import (
"sync"
"time"
"github.com/imdario/mergo"
artifact "github.com/mudler/luet/pkg/api/core/types/artifact"
bus "github.com/mudler/luet/pkg/bus"
"github.com/mudler/luet/pkg/compiler/backend"
@@ -40,6 +39,8 @@ import (
. "github.com/mudler/luet/pkg/logger"
pkg "github.com/mudler/luet/pkg/package"
"github.com/mudler/luet/pkg/solver"
"github.com/imdario/mergo"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"helm.sh/helm/v3/pkg/chart"
@@ -486,7 +487,7 @@ func (cs *LuetCompiler) waitForImages(images []string) {
available, _ := oneOfImagesAvailable(images, cs.Backend)
if !available {
Info(fmt.Sprintf("Waiting for image %s to be available... :zzz:", images))
Spinner(22)
Spinner(32)
defer SpinnerStop()
for !available {
available, _ = oneOfImagesAvailable(images, cs.Backend)

View File

@@ -18,8 +18,7 @@ package compiler_test
import (
"testing"
. "github.com/mudler/luet/cmd"
config "github.com/mudler/luet/pkg/config"
. "github.com/mudler/luet/cmd/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -27,6 +26,6 @@ import (
func TestSolver(t *testing.T) {
RegisterFailHandler(Fail)
LoadConfig(config.LuetCfg)
LoadConfig()
RunSpecs(t, "Compiler Suite")
}

View File

@@ -18,8 +18,7 @@ package compilerspec_test
import (
"testing"
. "github.com/mudler/luet/cmd"
config "github.com/mudler/luet/pkg/config"
. "github.com/mudler/luet/cmd/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
@@ -27,6 +26,6 @@ import (
func TestSpec(t *testing.T) {
RegisterFailHandler(Fail)
LoadConfig(config.LuetCfg)
LoadConfig()
RunSpecs(t, "Spec Suite")
}