diff --git a/build.go b/build.go index 594dba3..554e632 100644 --- a/build.go +++ b/build.go @@ -13,6 +13,8 @@ import ( "syscall" "github.com/grafana/k6build" + "github.com/grafana/k6build/pkg/client" + "github.com/grafana/k6build/pkg/local" "github.com/grafana/k6deps" ) @@ -84,7 +86,7 @@ func newLocalBuildService(ctx context.Context, opts *Options) (k6build.BuildServ return nil, err } - conf := k6build.LocalBuildServiceConfig{ + conf := local.BuildServiceConfig{ BuildEnv: map[string]string{"GOWORK": "off"}, Catalog: catfile, CopyGoEnv: true, @@ -92,11 +94,11 @@ func newLocalBuildService(ctx context.Context, opts *Options) (k6build.BuildServ Verbose: slog.Default().Enabled(ctx, slog.LevelDebug), } - return k6build.NewLocalBuildService(ctx, conf) + return local.NewBuildService(ctx, conf) } func newBuildServiceClient(opts *Options) (k6build.BuildService, error) { - return k6build.NewBuildServiceClient(k6build.BuildServiceClientConfig{ + return client.NewBuildServiceClient(client.BuildServiceClientConfig{ URL: opts.BuildServiceURL.String(), }) } diff --git a/build_internal_test.go b/build_internal_test.go index 020161f..87e242c 100644 --- a/build_internal_test.go +++ b/build_internal_test.go @@ -13,7 +13,8 @@ import ( "strings" "testing" - "github.com/grafana/k6build" + "github.com/grafana/k6build/pkg/client" + "github.com/grafana/k6deps" "github.com/stretchr/testify/require" ) @@ -59,8 +60,8 @@ func Test_newBuildService(t *testing.T) { svc, err := newBuildService(context.Background(), opts) require.NoError(t, err) - require.IsType(t, new(k6build.BuildClient), svc) - require.Equal(t, "*k6build.BuildClient", fmt.Sprintf("%T", svc)) + require.IsType(t, new(client.BuildClient), svc) + require.Equal(t, "*client.BuildClient", fmt.Sprintf("%T", svc)) srv := testWebServer(t) defer srv.Close() diff --git a/go.mod b/go.mod index 4d819e3..ccf0e6e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22.4 require ( github.com/adrg/xdg v0.5.0 github.com/grafana/clireadme v0.1.0 - github.com/grafana/k6build v0.2.3 + github.com/grafana/k6build v0.3.0 github.com/grafana/k6deps v0.1.4 github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 github.com/samber/slog-logrus/v2 v2.5.0 diff --git a/go.sum b/go.sum index 1f6273b..c078ec6 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/grafana/clireadme v0.1.0 h1:KYEYSnYdSzmHf3bufaK6fQZ5j4dzvM/T+G6Ba+qNnAM= github.com/grafana/clireadme v0.1.0/go.mod h1:Wy4KIG2ZBGMYAYyF9l7qAy+yoJVasqk/txsRgoRI3gc= -github.com/grafana/k6build v0.2.3 h1:nRNfOZbIABcoOgqOs+PWbzGVPbG6wWbwN8dACfF5mFo= -github.com/grafana/k6build v0.2.3/go.mod h1:LOlIAeWzZWR3Zff3Q6o4/spO2ROhvkLws8OgmEgGmVA= +github.com/grafana/k6build v0.3.0 h1:Td2GHtjqm8UhNBQnLEZvn/d9QOUvdrmWRNxj0QVy6/8= +github.com/grafana/k6build v0.3.0/go.mod h1:FPyo1ROpcST4zR4v0U+OcZQvairv+vIn4dKnHxHMCic= github.com/grafana/k6catalog v0.1.0 h1:jLmbmB3EUJ+zyQG3hWy6dWbtMjvTkvJNx1d4LX8it6I= github.com/grafana/k6catalog v0.1.0/go.mod h1:8R9eXAh2nb69+drkj0rZ4aemso0jcwCbPP6Q3E5LqCw= github.com/grafana/k6deps v0.1.4 h1:rFlp2IMTSNk2RuztIfy17X5MO6HbQ6EebgvKvVPg+Po=