From 4de478add23100ade579d4323771e842e3c0d9fd Mon Sep 17 00:00:00 2001 From: phlx <234970933+phlx0@users.noreply.github.com> Date: Tue, 21 Apr 2026 22:43:24 +0200 Subject: [PATCH] fix(examples): replace go.mod replace directive with go.work The replace directive in examples/go.mod prevented users from running examples remotely via `go run charm.land/bubbletea/examples/...@latest`. Replace it with a go.work.example template that contributors can copy to go.work locally. go.work and go.work.sum are now gitignored. Fixes #1681 --- .gitignore | 2 ++ examples/go.mod | 2 -- examples/go.sum | 2 ++ go.work.example | 13 +++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 go.work.example diff --git a/.gitignore b/.gitignore index abd7c0612b..60a54c41ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .DS_Store .envrc +go.work +go.work.sum examples/fullscreen/fullscreen examples/help/help diff --git a/examples/go.mod b/examples/go.mod index 66ddae855c..999aa493db 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -2,8 +2,6 @@ module examples go 1.25.8 -replace charm.land/bubbletea/v2 => ../ - require ( charm.land/bubbles/v2 v2.1.0 charm.land/bubbletea/v2 v2.0.2 diff --git a/examples/go.sum b/examples/go.sum index a665504be6..24b82d4d92 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -1,5 +1,7 @@ charm.land/bubbles/v2 v2.1.0 h1:YSnNh5cPYlYjPxRrzs5VEn3vwhtEn3jVGRBT3M7/I0g= charm.land/bubbles/v2 v2.1.0/go.mod h1:l97h4hym2hvWBVfmJDtrEHHCtkIKeTEb3TTJ4ZOB3wY= +charm.land/bubbletea/v2 v2.0.2 h1:4CRtRnuZOdFDTWSff9r8QFt/9+z6Emubz3aDMnf/dx0= +charm.land/bubbletea/v2 v2.0.2/go.mod h1:3LRff2U4WIYXy7MTxfbAQ+AdfM3D8Xuvz2wbsOD9OHQ= charm.land/glamour/v2 v2.0.0 h1:IDBoqLEy7Hdpb9VOXN+khLP/XSxtJy1VsHuW/yF87+U= charm.land/glamour/v2 v2.0.0/go.mod h1:kjq9WB0s8vuUYZNYey2jp4Lgd9f4cKdzAw88FZtpj/w= charm.land/lipgloss/v2 v2.0.3 h1:yM2zJ4Cf5Y51b7RHIwioil4ApI/aypFXXVHSwlM6RzU= diff --git a/go.work.example b/go.work.example new file mode 100644 index 0000000000..f8b902ad86 --- /dev/null +++ b/go.work.example @@ -0,0 +1,13 @@ +// Copy this file to go.work to develop against the local bubbletea source. +// go.work and go.work.sum are gitignored. +// +// Usage: +// cp go.work.example go.work +// go run ./examples/simple + +go 1.25.8 + +use ( + . + ./examples +)