Skip to content

Commit

Permalink
feat: use bubbles/v2 and bubbletea/v2 in examples and tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Sep 18, 2024
1 parent 14cb6b5 commit 1678d85
Show file tree
Hide file tree
Showing 64 changed files with 129 additions and 173 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import (
"fmt"
"os"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)
```

Expand Down
2 changes: 1 addition & 1 deletion examples/altscreen-toggle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
8 changes: 4 additions & 4 deletions examples/autocomplete/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"log"
"net/http"

"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/help"
"github.com/charmbracelet/bubbles/v2/key"
"github.com/charmbracelet/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/capability/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"log"

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea/v2"
)

type model struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/cellbuffer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/harmonica"
)

Expand Down
8 changes: 4 additions & 4 deletions examples/chat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"os"
"strings"

"github.com/charmbracelet/bubbles/cursor"
"github.com/charmbracelet/bubbles/textarea"
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/cursor"
"github.com/charmbracelet/bubbles/v2/textarea"
"github.com/charmbracelet/bubbles/v2/viewport"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
6 changes: 3 additions & 3 deletions examples/composable-views/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"log"
"time"

"github.com/charmbracelet/bubbles/spinner"
"github.com/charmbracelet/bubbles/timer"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/spinner"
"github.com/charmbracelet/bubbles/v2/timer"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/credit-card-form/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strconv"
"strings"

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/debounce/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"os"
"time"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)

const debounceDuration = time.Second
Expand Down
2 changes: 1 addition & 1 deletion examples/exec/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"os/exec"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)

type editorFinishedMsg struct{ err error }
Expand Down
4 changes: 2 additions & 2 deletions examples/file-picker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"time"

"github.com/charmbracelet/bubbles/filepicker"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/filepicker"
tea "github.com/charmbracelet/bubbletea/v2"
)

type model struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/focus-blur/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package main
import (
"log"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/fullscreen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"log"
"time"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)

type model int
Expand Down
4 changes: 2 additions & 2 deletions examples/glamour/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/viewport"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/glamour"
"github.com/charmbracelet/lipgloss"
)
Expand Down
10 changes: 5 additions & 5 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ go 1.21
toolchain go1.22.5

require (
github.com/charmbracelet/bubbles v0.20.1-0.20240910180436-8972b56c9dde
github.com/charmbracelet/bubbletea v1.1.2-0.20240911170800-098540620292
github.com/charmbracelet/bubbles/v2 v2.0.0-20240918181255-a2602f85093b
github.com/charmbracelet/bubbletea/v2 v2.0.0-20240918180721-14cb6b5de1d2
github.com/charmbracelet/glamour v0.8.0
github.com/charmbracelet/harmonica v0.2.0
github.com/charmbracelet/lipgloss v0.13.0
github.com/charmbracelet/x/exp/teatest v0.0.0-20240912153648-d6041061ead9
github.com/charmbracelet/x/exp/teatest/v2 v2.0.0-20240918160051-227168dc0568
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776
github.com/lucasb-eyer/go-colorful v1.2.0
github.com/mattn/go-isatty v0.0.20
Expand All @@ -22,7 +22,7 @@ require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymanbagabas/go-udiff v0.2.0 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/charmbracelet/x/ansi v0.3.1 // indirect
github.com/charmbracelet/x/ansi v0.3.2 // indirect
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b // indirect
github.com/charmbracelet/x/term v0.2.0 // indirect
github.com/charmbracelet/x/windows v0.2.0 // indirect
Expand All @@ -46,4 +46,4 @@ require (
golang.org/x/term v0.22.0 // indirect
)

replace github.com/charmbracelet/bubbletea => ../
replace github.com/charmbracelet/bubbletea/v2 => ../
12 changes: 6 additions & 6 deletions examples/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWp
github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/charmbracelet/bubbles v0.20.1-0.20240910180436-8972b56c9dde h1:/u+F3xZsfJYhEQ3MjKvqiXb2Y6LV8/4YHAMICxjGVhY=
github.com/charmbracelet/bubbles v0.20.1-0.20240910180436-8972b56c9dde/go.mod h1:M5Z4yZGaxq8TZoEY2rs529UxFTeZLnAhmAzqd2wd48M=
github.com/charmbracelet/bubbles/v2 v2.0.0-20240918181255-a2602f85093b h1:HhlZVQiYb1ckEdKcjnRQ/6qEORD20rFMoyemyhI/QKQ=
github.com/charmbracelet/bubbles/v2 v2.0.0-20240918181255-a2602f85093b/go.mod h1:tpX2o5sLWCF5tbBWZaJGx3mbjFIrupeAEbfWEiZXy+A=
github.com/charmbracelet/glamour v0.8.0 h1:tPrjL3aRcQbn++7t18wOpgLyl8wrOHUEDS7IZ68QtZs=
github.com/charmbracelet/glamour v0.8.0/go.mod h1:ViRgmKkf3u5S7uakt2czJ272WSg2ZenlYEZXT2x7Bjw=
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw=
github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY=
github.com/charmbracelet/x/ansi v0.3.1 h1:CRO6lc/6HCx2/D6S/GZ87jDvRvk6GtPyFP+IljkNtqI=
github.com/charmbracelet/x/ansi v0.3.1/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
github.com/charmbracelet/x/ansi v0.3.2 h1:wsEwgAN+C9U06l9dCVMX0/L3x7ptvY1qmjMwyfE6USY=
github.com/charmbracelet/x/ansi v0.3.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q=
github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
github.com/charmbracelet/x/exp/teatest v0.0.0-20240912153648-d6041061ead9 h1:2q41wBBupsw4GATbF/C3NZ3JtccZ/iYu7cL3doHOnuo=
github.com/charmbracelet/x/exp/teatest v0.0.0-20240912153648-d6041061ead9/go.mod h1:WPIoTqLbtPGmiv83mabqvIYOrwa1vUZMdp3urF4gQrk=
github.com/charmbracelet/x/exp/teatest/v2 v2.0.0-20240918160051-227168dc0568 h1:AetludS3JErnyz60TL6F2wKtbS+1CZMz1dRjOiRbtNM=
github.com/charmbracelet/x/exp/teatest/v2 v2.0.0-20240918160051-227168dc0568/go.mod h1:GjX2v3oH9MpfcsHPu8uYdYfsq34S04hY5PaIP8Gl52A=
github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0=
github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0=
github.com/charmbracelet/x/windows v0.2.0 h1:ilXA1GJjTNkgOm94CLPeSz7rar54jtFatdmoiONPuEw=
Expand Down
6 changes: 3 additions & 3 deletions examples/help/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"strings"

"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/help"
"github.com/charmbracelet/bubbles/v2/key"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"time"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)

const url = "https://charm.sh/"
Expand Down
4 changes: 2 additions & 2 deletions examples/list-default/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/list"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
6 changes: 3 additions & 3 deletions examples/list-fancy/delegate.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/key"
"github.com/charmbracelet/bubbles/v2/list"
tea "github.com/charmbracelet/bubbletea/v2"
)

func newItemDelegate(keys *delegateKeyMap) list.DefaultDelegate {
Expand Down
6 changes: 3 additions & 3 deletions examples/list-fancy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"os"
"time"

"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/key"
"github.com/charmbracelet/bubbles/v2/list"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/list-simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"strings"

"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/list"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/mouse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package main
import (
"log"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions examples/package-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
"time"

"github.com/charmbracelet/bubbles/progress"
"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/progress"
"github.com/charmbracelet/bubbles/v2/spinner"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/pager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os"
"strings"

"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/viewport"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/paginator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"log"
"strings"

"github.com/charmbracelet/bubbles/paginator"
"github.com/charmbracelet/bubbles/v2/paginator"
"github.com/charmbracelet/lipgloss"

tea "github.com/charmbracelet/bubbletea"
tea "github.com/charmbracelet/bubbletea/v2"
)

func newModel() model {
Expand Down
44 changes: 0 additions & 44 deletions examples/panic/main.go

This file was deleted.

4 changes: 2 additions & 2 deletions examples/pipe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"os"
"strings"

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/textinput"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
8 changes: 4 additions & 4 deletions examples/prevent-quit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"fmt"
"log"

"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/textarea"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbles/v2/help"
"github.com/charmbracelet/bubbles/v2/key"
"github.com/charmbracelet/bubbles/v2/textarea"
tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/lipgloss"
)

Expand Down
Loading

0 comments on commit 1678d85

Please sign in to comment.