From 12d169f48065e0402068e79cc8b939143ef6bf49 Mon Sep 17 00:00:00 2001 From: peefy Date: Wed, 18 Sep 2024 19:41:12 +0800 Subject: [PATCH] chore: bump kcl-go to latest client mode Signed-off-by: peefy --- VERSION | 2 +- cmd/kcl/commands/server.go | 6 ++---- cmd/kcl/commands/vet.go | 6 +++--- go.mod | 6 +++--- go.sum | 12 ++++++------ pkg/version/version.go | 3 ++- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/VERSION b/VERSION index 2774f85..71172b4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10.0 \ No newline at end of file +0.10.1 \ No newline at end of file diff --git a/cmd/kcl/commands/server.go b/cmd/kcl/commands/server.go index a49347a..958d077 100644 --- a/cmd/kcl/commands/server.go +++ b/cmd/kcl/commands/server.go @@ -4,8 +4,7 @@ package cmd import ( "github.com/spf13/cobra" - "kcl-lang.io/kcl-go/pkg/runtime" - "kcl-lang.io/kcl-go/pkg/service" + "kcl-lang.io/kcl-go/pkg/server" ) const ( @@ -37,8 +36,7 @@ func NewServerCmd() *cobra.Command { Long: serverDesc, Example: serverExample, RunE: func(_ *cobra.Command, args []string) error { - runtime.InitRuntime(processCount) - return service.RunRestServer(http) + return server.RunRestServer(http) }, SilenceUsage: true, } diff --git a/cmd/kcl/commands/vet.go b/cmd/kcl/commands/vet.go index 85ffdfa..d44b529 100644 --- a/cmd/kcl/commands/vet.go +++ b/cmd/kcl/commands/vet.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" "kcl-lang.io/cli/pkg/fs" - "kcl-lang.io/kcl-go/pkg/service" + "kcl-lang.io/kcl-go/pkg/kcl" "kcl-lang.io/kcl-go/pkg/spec/gpyrpc" "kcl-lang.io/kcl-go/pkg/tools/validate" ) @@ -95,8 +95,8 @@ func validateFile(dataFile, codeFile string, opts *validate.ValidateOptions) (ok if opts == nil { opts = &validate.ValidateOptions{} } - client := service.NewKclvmServiceClient() - resp, err := client.ValidateCode(&gpyrpc.ValidateCode_Args{ + svc := kcl.Service() + resp, err := svc.ValidateCode(&gpyrpc.ValidateCode_Args{ Datafile: dataFile, File: codeFile, Schema: opts.Schema, diff --git a/go.mod b/go.mod index 2b6fe88..5d48808 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/onsi/gomega v1.34.2 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 - kcl-lang.io/kcl-go v0.10.1 + kcl-lang.io/kcl-go v0.10.2-0.20240918105252-6fc919ce5b6d kcl-lang.io/kcl-openapi v0.9.0 kcl-lang.io/kcl-plugin v0.6.0 kcl-lang.io/kpm v0.10.0 @@ -34,6 +34,7 @@ require ( github.com/containers/storage v1.55.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/distribution/reference v0.6.0 // indirect + github.com/ebitengine/purego v0.7.1 // indirect github.com/elliotchance/orderedmap/v2 v2.4.0 // indirect github.com/emicklei/proto v1.13.2 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -73,7 +74,7 @@ require ( google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect - kcl-lang.io/lib v0.10.0 // indirect + kcl-lang.io/lib v0.10.1-rc.3 // indirect ) require ( @@ -158,7 +159,6 @@ require ( github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 - github.com/powerman/rpc-codec v1.2.2 // indirect github.com/prometheus/client_golang v1.20.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect diff --git a/go.sum b/go.sum index 2d692b1..08db989 100644 --- a/go.sum +++ b/go.sum @@ -366,6 +366,8 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/dominikbraun/graph v0.23.0 h1:TdZB4pPqCLFxYhdyMFb1TBdFxp8XLcJfTTBQucVPgCo= github.com/dominikbraun/graph v0.23.0/go.mod h1:yOjYyogZLY1LSG9E33JWZJiq5k83Qy2C6POAuiViluc= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/ebitengine/purego v0.7.1 h1:6/55d26lG3o9VCZX8lping+bZcmShseiqlh2bnUDiPA= +github.com/ebitengine/purego v0.7.1/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= @@ -816,8 +818,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/powerman/rpc-codec v1.2.2 h1:BK0JScZivljhwW/vLLhZLtUgqSxc/CD3sHEs8LiwwKw= -github.com/powerman/rpc-codec v1.2.2/go.mod h1:3Qr/y/+u3CwcSww9tfJMRn/95lB2qUdUeIQe7BYlLDo= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= @@ -1692,16 +1692,16 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -kcl-lang.io/kcl-go v0.10.1 h1:2YXQP5QcwNGVLnxdcTNLRoJkYn357gCgqbgU+8hVHxU= -kcl-lang.io/kcl-go v0.10.1/go.mod h1:AQIQplXxCpodSw1Kt+qiFvIB7tzBQ18djT2GytS33nM= +kcl-lang.io/kcl-go v0.10.2-0.20240918105252-6fc919ce5b6d h1:U9tTTQZTma/mKU3ALhJFhhYtLJnlS4SuUWZmMR3UjAM= +kcl-lang.io/kcl-go v0.10.2-0.20240918105252-6fc919ce5b6d/go.mod h1:nrKhkCm5VyfJ97dsNoVF600uY09y0qY6i1M66KucL+8= kcl-lang.io/kcl-openapi v0.9.0 h1:HUnc5pUGde83PI5CAe1ZvZhdbcxD9X2ABUp1tV+oYqw= kcl-lang.io/kcl-openapi v0.9.0/go.mod h1:kGCf0AZygrZyB+xpmMtiC3FYoiV/1rCLXuAq2QtuLf8= kcl-lang.io/kcl-plugin v0.6.0 h1:rBdoqKDPdOtojeOHCFnXoB/I7ltFjV61r0KkfOcL5sE= kcl-lang.io/kcl-plugin v0.6.0/go.mod h1:LoIouleHYRKAvFcdW30yUlhsMYH2W9zD5Ji1XHfbht4= kcl-lang.io/kpm v0.10.0 h1:VnsJ5IS8YSvgXYnItLdaJp/1tTrSSmThzmNCWmhm5Bg= kcl-lang.io/kpm v0.10.0/go.mod h1:MhQh9kewILcUlhuhVBksxWVZfgdwkpkX6xFj1pxF0QM= -kcl-lang.io/lib v0.10.0 h1:VLwZTMfRZyaGfIJc8qxLn7bKr24PSgZLc3SxMRxUaN4= -kcl-lang.io/lib v0.10.0/go.mod h1:tu+tzwGgHLzYZSIxUG/ntipStrxZd6OvutWYPTxS7cs= +kcl-lang.io/lib v0.10.1-rc.3 h1:+3sCOLV3ay9JHwvaZKOJgX9hwb2MO5OiGbAtsNLH5E4= +kcl-lang.io/lib v0.10.1-rc.3/go.mod h1:MfVEiCo3Yr6jZqwSo84WmjFZdqNRtXMbGtDwUM27kTY= oras.land/oras-go v1.2.6 h1:z8cmxQXBU8yZ4mkytWqXfo6tZcamPwjsuxYU81xJ8Lk= oras.land/oras-go v1.2.6/go.mod h1:OVPc1PegSEe/K8YiLfosrlqlqTN9PUyFvOw5Y9gwrT8= oras.land/oras-go/v2 v2.5.0 h1:o8Me9kLY74Vp5uw07QXPiitjsw7qNXi8Twd+19Zf02c= diff --git a/pkg/version/version.go b/pkg/version/version.go index 129d428..010fa45 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -32,8 +32,9 @@ func getVersion(version string) string { } const ( - VersionTypeLatest = Version_0_10_0 + VersionTypeLatest = Version_0_10_1 + Version_0_10_1 VersionType = "0.10.1" Version_0_10_0 VersionType = "0.10.0" Version_0_9_8 VersionType = "0.9.8"