fix: stubs shell y tui usan tipos nativos en firmas en vez de Result/Option de core
Result[T] y Option[T] de core no son accesibles desde otros paquetes sin import. Cambiado a (T, error) y (T, bool) siguiendo la regla de tipos nativos en firmas. Añadidas dependencias bubbletea/bubbles/lipgloss al go.mod raíz para que tui compile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package shell
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/shell
|
||||
|
||||
// Run ejecuta un comando del sistema con timeout de 30 segundos y devuelve el resultado.
|
||||
func Run(name string, args ...string) Result[CmdResult] {
|
||||
func Run(name string, args ...string) (CmdResult, error) {
|
||||
// stub — implementation in devfactory/shell
|
||||
return Result[CmdResult]{}
|
||||
return CmdResult{}, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package shell
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/shell
|
||||
|
||||
// RunWithTimeout ejecuta un comando del sistema con timeout configurable.
|
||||
func RunWithTimeout(name string, timeout time.Duration, args ...string) Result[CmdResult] {
|
||||
func RunWithTimeout(name string, timeout time.Duration, args ...string) (CmdResult, error) {
|
||||
// stub — implementation in devfactory/shell
|
||||
return Result[CmdResult]{}
|
||||
return CmdResult{}, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package shell
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/shell
|
||||
|
||||
// RunPipe encadena multiples comandos con pipe y devuelve el resultado final.
|
||||
func RunPipe(commands ...string) Result[CmdResult] {
|
||||
func RunPipe(commands ...string) (CmdResult, error) {
|
||||
// stub — implementation in devfactory/shell
|
||||
return Result[CmdResult]{}
|
||||
return CmdResult{}, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package shell
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/shell
|
||||
|
||||
// RunShell ejecuta un comando shell interpretado por /bin/sh.
|
||||
func RunShell(command string) Result[CmdResult] {
|
||||
func RunShell(command string) (CmdResult, error) {
|
||||
// stub — implementation in devfactory/shell
|
||||
return Result[CmdResult]{}
|
||||
return CmdResult{}, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package shell
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/shell
|
||||
|
||||
// RunShellTimeout ejecuta un comando shell con timeout configurable.
|
||||
func RunShellTimeout(command string, timeout time.Duration) Result[CmdResult] {
|
||||
func RunShellTimeout(command string, timeout time.Duration) (CmdResult, error) {
|
||||
// stub — implementation in devfactory/shell
|
||||
return Result[CmdResult]{}
|
||||
return CmdResult{}, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package shell
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/shell
|
||||
|
||||
// Which busca la ruta de un ejecutable en el PATH del sistema. Devuelve None si no existe.
|
||||
func Which(name string) Option[string] {
|
||||
// Which busca la ruta de un ejecutable en el PATH del sistema. Devuelve ("", false) si no existe.
|
||||
func Which(name string) (string, bool) {
|
||||
// stub — implementation in devfactory/shell
|
||||
return Option[string]{}
|
||||
return "", false
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package tui
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
import "fmt"
|
||||
|
||||
// Confirm muestra un dialogo de confirmacion Si/No en terminal y devuelve la eleccion del usuario.
|
||||
func Confirm(prompt string) Result[bool] {
|
||||
// Confirm muestra un prompt de confirmacion si/no en la terminal.
|
||||
func Confirm(prompt string) (bool, error) {
|
||||
// stub — implementation in devfactory/tui
|
||||
return Result[bool]{Value: false}
|
||||
return false, fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package tui
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
import tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
import "github.com/charmbracelet/bubbletea"
|
||||
|
||||
// RunFullscreen ejecuta un modelo Bubble Tea en modo fullscreen.
|
||||
func RunFullscreen[T tea.Model](model T) Result[T] {
|
||||
// RunFullscreen ejecuta un modelo Bubbletea en modo fullscreen.
|
||||
func RunFullscreen[T tea.Model](model T) (T, error) {
|
||||
// stub — implementation in devfactory/tui
|
||||
var zero T
|
||||
return Result[T]{Value: zero}
|
||||
return zero, nil
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package tui
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
import tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
import "github.com/charmbracelet/bubbletea"
|
||||
|
||||
// RunModel ejecuta un modelo Bubble Tea y devuelve el modelo final o error.
|
||||
func RunModel[T tea.Model](model T) Result[T] {
|
||||
// RunModel ejecuta un modelo Bubbletea y devuelve el modelo final.
|
||||
func RunModel[T tea.Model](model T) (T, error) {
|
||||
// stub — implementation in devfactory/tui
|
||||
var zero T
|
||||
return Result[T]{Value: zero}
|
||||
return zero, nil
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package tui
|
||||
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
import tea "github.com/charmbracelet/bubbletea"
|
||||
|
||||
import "github.com/charmbracelet/bubbletea"
|
||||
|
||||
// RunWithMouseSupport ejecuta un modelo Bubble Tea con soporte de raton habilitado.
|
||||
func RunWithMouseSupport[T tea.Model](model T) Result[T] {
|
||||
// RunWithMouseSupport ejecuta un modelo Bubbletea con soporte de mouse.
|
||||
func RunWithMouseSupport[T tea.Model](model T) (T, error) {
|
||||
// stub — implementation in devfactory/tui
|
||||
var zero T
|
||||
return Result[T]{Value: zero}
|
||||
return zero, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user