Jelajahi Sumber

build: replace rivo/tview with ayn2op/tview

ayn2op 11 bulan lalu
induk
melakukan
06068a1c0f

+ 2 - 2
cmd/application.go

@@ -6,8 +6,8 @@ import (
 	"github.com/ayn2op/discordo/internal/config"
 	"github.com/ayn2op/discordo/internal/consts"
 	"github.com/ayn2op/discordo/internal/login"
+	"github.com/ayn2op/tview"
 	"github.com/gdamore/tcell/v2"
-	"github.com/rivo/tview"
 	"github.com/zalando/go-keyring"
 )
 
@@ -104,7 +104,7 @@ func (app *application) onInputCapture(event *tcell.EventKey) *tcell.EventKey {
 
 		app.Stop()
 	case "Ctrl+C":
-		// https://github.com/rivo/tview/blob/a64fc48d7654432f71922c8b908280cdb525805c/application.go#L153
+		// https://github.com/ayn2op/tview/blob/a64fc48d7654432f71922c8b908280cdb525805c/application.go#L153
 		return tcell.NewEventKey(tcell.KeyCtrlC, 0, tcell.ModNone)
 	}
 

+ 1 - 1
cmd/guilds_tree.go

@@ -9,10 +9,10 @@ import (
 	"github.com/atotto/clipboard"
 	"github.com/ayn2op/discordo/internal/config"
 	"github.com/ayn2op/discordo/internal/ui"
+	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/discord"
 	"github.com/diamondburned/arikawa/v3/gateway"
 	"github.com/gdamore/tcell/v2"
-	"github.com/rivo/tview"
 )
 
 type guildsTree struct {

+ 1 - 1
cmd/message_input.go

@@ -10,11 +10,11 @@ import (
 	"github.com/ayn2op/discordo/internal/config"
 	"github.com/ayn2op/discordo/internal/consts"
 	"github.com/ayn2op/discordo/internal/ui"
+	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/api"
 	"github.com/diamondburned/arikawa/v3/discord"
 	"github.com/diamondburned/arikawa/v3/utils/json/option"
 	"github.com/gdamore/tcell/v2"
-	"github.com/rivo/tview"
 )
 
 const tmpFilePattern = consts.Name + "_*.md"

+ 2 - 2
cmd/messages_text.go

@@ -14,11 +14,11 @@ import (
 	"github.com/ayn2op/discordo/internal/config"
 	"github.com/ayn2op/discordo/internal/markdown"
 	"github.com/ayn2op/discordo/internal/ui"
+	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/discord"
 	"github.com/diamondburned/arikawa/v3/gateway"
 	"github.com/diamondburned/ningen/v3/discordmd"
 	"github.com/gdamore/tcell/v2"
-	"github.com/rivo/tview"
 	"github.com/skratchdot/open-golang/open"
 	"github.com/yuin/goldmark/ast"
 	"github.com/yuin/goldmark/parser"
@@ -99,7 +99,7 @@ func (mt *messagesText) reset() {
 }
 
 // Region tags are square brackets that contain a region ID in double quotes
-// https://pkg.go.dev/github.com/rivo/tview#hdr-Regions_and_Highlights
+// https://pkg.go.dev/github.com/ayn2op/tview#hdr-Regions_and_Highlights
 func (mt *messagesText) startRegion(msgID discord.MessageID) {
 	fmt.Fprintf(mt, `["%s"]`, msgID)
 }

+ 1 - 1
cmd/root.go

@@ -7,9 +7,9 @@ import (
 	"github.com/ayn2op/discordo/internal/config"
 	"github.com/ayn2op/discordo/internal/consts"
 	"github.com/ayn2op/discordo/internal/logger"
+	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/utils/ws"
 	"github.com/gdamore/tcell/v2"
-	"github.com/rivo/tview"
 	"github.com/zalando/go-keyring"
 )
 

+ 1 - 1
cmd/state.go

@@ -6,13 +6,13 @@ import (
 	"runtime"
 
 	"github.com/ayn2op/discordo/internal/notifications"
+	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/api"
 	"github.com/diamondburned/arikawa/v3/gateway"
 	"github.com/diamondburned/arikawa/v3/utils/httputil/httpdriver"
 	"github.com/diamondburned/arikawa/v3/utils/ws"
 	"github.com/diamondburned/ningen/v3"
 	"github.com/gdamore/tcell/v2"
-	"github.com/rivo/tview"
 )
 
 type state struct {

+ 2 - 2
go.mod

@@ -1,16 +1,16 @@
 module github.com/ayn2op/discordo
 
-go 1.24.0
+go 1.24.3
 
 require (
 	github.com/BurntSushi/toml v1.5.0
 	github.com/atotto/clipboard v0.1.4
+	github.com/ayn2op/tview v0.0.0-20250603171947-ff81ec6ed099
 	github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb
 	github.com/diamondburned/arikawa/v3 v3.5.0
 	github.com/diamondburned/ningen/v3 v3.0.1-0.20240808103805-f1a24c0da3d8
 	github.com/gdamore/tcell/v2 v2.8.1
 	github.com/gen2brain/beeep v0.0.0-20240516210008-9c006672e7f4
-	github.com/rivo/tview v0.0.0-20250501113434-0c592cd31026
 	github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
 	github.com/yuin/goldmark v1.7.11
 	github.com/zalando/go-keyring v0.2.6

+ 2 - 2
go.sum

@@ -23,6 +23,8 @@ github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
 github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
+github.com/ayn2op/tview v0.0.0-20250603171947-ff81ec6ed099 h1:9i8wZAiqlpnGZufIBy95i3Da2Qar2dBeox6NtINe/FQ=
+github.com/ayn2op/tview v0.0.0-20250603171947-ff81ec6ed099/go.mod h1:PuMMP3J7SfW0jgAc1fdABOHJkoGbQIw3jejRAkl0API=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
@@ -107,8 +109,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/rivo/tview v0.0.0-20250501113434-0c592cd31026 h1:ij8h8B3psk3LdMlqkfPTKIzeGzTaZLOiyplILMlxPAM=
-github.com/rivo/tview v0.0.0-20250501113434-0c592cd31026/go.mod h1:02iFIz7K/A9jGCvrizLPvoqr4cEIx7q54RH5Qudkrss=
 github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=

+ 1 - 1
internal/config/border.go

@@ -1,6 +1,6 @@
 package config
 
-import "github.com/rivo/tview"
+import "github.com/ayn2op/tview"
 
 type BorderPreset struct {
 	Horizontal  rune

+ 1 - 1
internal/config/theme.go

@@ -1,7 +1,7 @@
 package config
 
 import (
-	"github.com/rivo/tview"
+	"github.com/ayn2op/tview"
 )
 
 type TitleAlign int

+ 1 - 1
internal/login/form.go

@@ -7,8 +7,8 @@ import (
 	"github.com/ayn2op/discordo/internal/config"
 	"github.com/ayn2op/discordo/internal/consts"
 	"github.com/ayn2op/discordo/internal/ui"
+	"github.com/ayn2op/tview"
 	"github.com/diamondburned/arikawa/v3/api"
-	"github.com/rivo/tview"
 	"github.com/zalando/go-keyring"
 )
 

+ 1 - 1
internal/ui/util.go

@@ -2,8 +2,8 @@ package ui
 
 import (
 	"github.com/ayn2op/discordo/internal/config"
+	"github.com/ayn2op/tview"
 	"github.com/gdamore/tcell/v2"
-	"github.com/rivo/tview"
 )
 
 func NewConfiguredBox(box *tview.Box, cfg *config.Theme) *tview.Box {