diff --git a/internal/api/api.go b/internal/codespaces/api/api.go similarity index 100% rename from internal/api/api.go rename to internal/codespaces/api/api.go diff --git a/internal/api/api_test.go b/internal/codespaces/api/api_test.go similarity index 100% rename from internal/api/api_test.go rename to internal/codespaces/api/api_test.go diff --git a/internal/codespaces/codespaces.go b/internal/codespaces/codespaces.go index f127cb362..654504205 100644 --- a/internal/codespaces/codespaces.go +++ b/internal/codespaces/codespaces.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - "github.com/cli/cli/v2/internal/api" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/internal/codespaces/api" + "github.com/cli/cli/v2/pkg/liveshare" ) type logger interface { diff --git a/internal/codespaces/states.go b/internal/codespaces/states.go index 7bd53b5e0..b9d12a796 100644 --- a/internal/codespaces/states.go +++ b/internal/codespaces/states.go @@ -9,8 +9,8 @@ import ( "strings" "time" - "github.com/cli/cli/v2/internal/api" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/internal/codespaces/api" + "github.com/cli/cli/v2/pkg/liveshare" ) // PostCreateStateStatus is a string value representing the different statuses a state can have. diff --git a/pkg/cmd/codespace/common.go b/pkg/cmd/codespace/common.go index 62ec99a20..da40c2b86 100644 --- a/pkg/cmd/codespace/common.go +++ b/pkg/cmd/codespace/common.go @@ -12,7 +12,7 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/AlecAivazis/survey/v2/terminal" - "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/codespaces/api" "github.com/cli/cli/v2/pkg/cmd/codespace/output" "github.com/spf13/cobra" "golang.org/x/term" diff --git a/pkg/cmd/codespace/create.go b/pkg/cmd/codespace/create.go index 74b4fc696..68f6d5a86 100644 --- a/pkg/cmd/codespace/create.go +++ b/pkg/cmd/codespace/create.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" - "github.com/cli/cli/v2/internal/api" "github.com/cli/cli/v2/internal/codespaces" + "github.com/cli/cli/v2/internal/codespaces/api" "github.com/cli/cli/v2/pkg/cmd/codespace/output" "github.com/fatih/camelcase" "github.com/spf13/cobra" diff --git a/pkg/cmd/codespace/delete.go b/pkg/cmd/codespace/delete.go index 228ed99ba..c0292f357 100644 --- a/pkg/cmd/codespace/delete.go +++ b/pkg/cmd/codespace/delete.go @@ -8,7 +8,7 @@ import ( "time" "github.com/AlecAivazis/survey/v2" - "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/codespaces/api" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" ) diff --git a/pkg/cmd/codespace/delete_test.go b/pkg/cmd/codespace/delete_test.go index 84a0ba472..35e37fae8 100644 --- a/pkg/cmd/codespace/delete_test.go +++ b/pkg/cmd/codespace/delete_test.go @@ -11,7 +11,7 @@ import ( "time" "github.com/MakeNowJust/heredoc" - "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/codespaces/api" "github.com/cli/cli/v2/pkg/cmd/codespace/output" ) diff --git a/pkg/cmd/codespace/list.go b/pkg/cmd/codespace/list.go index 2689fd376..1f87f1ba1 100644 --- a/pkg/cmd/codespace/list.go +++ b/pkg/cmd/codespace/list.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/codespaces/api" "github.com/cli/cli/v2/pkg/cmd/codespace/output" "github.com/spf13/cobra" ) diff --git a/pkg/cmd/codespace/logs.go b/pkg/cmd/codespace/logs.go index 24d017e58..0e5a7704d 100644 --- a/pkg/cmd/codespace/logs.go +++ b/pkg/cmd/codespace/logs.go @@ -6,7 +6,7 @@ import ( "net" "github.com/cli/cli/v2/internal/codespaces" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/pkg/liveshare" "github.com/spf13/cobra" ) diff --git a/pkg/cmd/codespace/mock_api.go b/pkg/cmd/codespace/mock_api.go index f9733e9bc..268a6552e 100644 --- a/pkg/cmd/codespace/mock_api.go +++ b/pkg/cmd/codespace/mock_api.go @@ -7,7 +7,7 @@ import ( "context" "sync" - "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/codespaces/api" ) // apiClientMock is a mock implementation of apiClient. diff --git a/pkg/cmd/codespace/ports.go b/pkg/cmd/codespace/ports.go index 86705cc7d..dee726bc4 100644 --- a/pkg/cmd/codespace/ports.go +++ b/pkg/cmd/codespace/ports.go @@ -11,10 +11,10 @@ import ( "strconv" "strings" - "github.com/cli/cli/v2/internal/api" "github.com/cli/cli/v2/internal/codespaces" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/internal/codespaces/api" "github.com/cli/cli/v2/pkg/cmd/codespace/output" + "github.com/cli/cli/v2/pkg/liveshare" "github.com/muhammadmuzzammil1998/jsonc" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" diff --git a/pkg/cmd/codespace/ssh.go b/pkg/cmd/codespace/ssh.go index 5627952b6..1a3d48335 100644 --- a/pkg/cmd/codespace/ssh.go +++ b/pkg/cmd/codespace/ssh.go @@ -6,7 +6,7 @@ import ( "net" "github.com/cli/cli/v2/internal/codespaces" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/pkg/liveshare" "github.com/spf13/cobra" ) diff --git a/pkg/cmd/root/root.go b/pkg/cmd/root/root.go index de9e40296..f96922f9f 100644 --- a/pkg/cmd/root/root.go +++ b/pkg/cmd/root/root.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/MakeNowJust/heredoc" - ghcsApi "github.com/cli/cli/v2/internal/api" + codespacesAPI "github.com/cli/cli/v2/internal/codespaces/api" actionsCmd "github.com/cli/cli/v2/pkg/cmd/actions" aliasCmd "github.com/cli/cli/v2/pkg/cmd/alias" apiCmd "github.com/cli/cli/v2/pkg/cmd/api" @@ -130,7 +130,7 @@ func bareHTTPClient(f *cmdutil.Factory, version string) func() (*http.Client, er func newCodespaceCmd(f *cmdutil.Factory) *cobra.Command { cmd := codespaceCmd.NewRootCmd(codespaceCmd.NewApp( output.NewLogger(f.IOStreams.Out, f.IOStreams.ErrOut, !f.IOStreams.IsStdoutTTY()), - ghcsApi.New("", &lazyLoadedHTTPClient{factory: f}), + codespacesAPI.New("", &lazyLoadedHTTPClient{factory: f}), )) cmd.Use = "codespace" cmd.Aliases = []string{"cs"} diff --git a/internal/liveshare/client.go b/pkg/liveshare/client.go similarity index 100% rename from internal/liveshare/client.go rename to pkg/liveshare/client.go diff --git a/internal/liveshare/client_test.go b/pkg/liveshare/client_test.go similarity index 96% rename from internal/liveshare/client_test.go rename to pkg/liveshare/client_test.go index 9db20ed1c..46807a22e 100644 --- a/internal/liveshare/client_test.go +++ b/pkg/liveshare/client_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - livesharetest "github.com/cli/cli/v2/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/pkg/liveshare/test" "github.com/sourcegraph/jsonrpc2" ) diff --git a/internal/liveshare/options_test.go b/pkg/liveshare/options_test.go similarity index 100% rename from internal/liveshare/options_test.go rename to pkg/liveshare/options_test.go diff --git a/internal/liveshare/port_forwarder.go b/pkg/liveshare/port_forwarder.go similarity index 100% rename from internal/liveshare/port_forwarder.go rename to pkg/liveshare/port_forwarder.go diff --git a/internal/liveshare/port_forwarder_test.go b/pkg/liveshare/port_forwarder_test.go similarity index 97% rename from internal/liveshare/port_forwarder_test.go rename to pkg/liveshare/port_forwarder_test.go index eda7262c6..624428dda 100644 --- a/internal/liveshare/port_forwarder_test.go +++ b/pkg/liveshare/port_forwarder_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - livesharetest "github.com/cli/cli/v2/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/pkg/liveshare/test" "github.com/sourcegraph/jsonrpc2" ) diff --git a/internal/liveshare/rpc.go b/pkg/liveshare/rpc.go similarity index 100% rename from internal/liveshare/rpc.go rename to pkg/liveshare/rpc.go diff --git a/internal/liveshare/session.go b/pkg/liveshare/session.go similarity index 100% rename from internal/liveshare/session.go rename to pkg/liveshare/session.go diff --git a/internal/liveshare/session_test.go b/pkg/liveshare/session_test.go similarity index 99% rename from internal/liveshare/session_test.go rename to pkg/liveshare/session_test.go index 1064e490b..7f0b573b5 100644 --- a/internal/liveshare/session_test.go +++ b/pkg/liveshare/session_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - livesharetest "github.com/cli/cli/v2/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/pkg/liveshare/test" "github.com/sourcegraph/jsonrpc2" ) diff --git a/internal/liveshare/socket.go b/pkg/liveshare/socket.go similarity index 100% rename from internal/liveshare/socket.go rename to pkg/liveshare/socket.go diff --git a/internal/liveshare/ssh.go b/pkg/liveshare/ssh.go similarity index 100% rename from internal/liveshare/ssh.go rename to pkg/liveshare/ssh.go diff --git a/internal/liveshare/test/server.go b/pkg/liveshare/test/server.go similarity index 100% rename from internal/liveshare/test/server.go rename to pkg/liveshare/test/server.go diff --git a/internal/liveshare/test/socket.go b/pkg/liveshare/test/socket.go similarity index 100% rename from internal/liveshare/test/socket.go rename to pkg/liveshare/test/socket.go