From f4e4b52f4959fc1d0549f037574f6462ef1faa59 Mon Sep 17 00:00:00 2001 From: peefy Date: Mon, 5 Aug 2024 21:04:07 +0800 Subject: [PATCH] chore: bump lib version to v0.10.0-alpha.2 Signed-off-by: peefy --- bench_test.go | 4 +- docs/api.md | 139 ++++++++++++++++------------- example_test.go | 2 +- go.mod | 2 +- go.sum | 4 +- kclvm.go => kcl.go | 6 +- kclvm_test.go => kcl_test.go | 4 +- kclvm_version.go => kcl_version.go | 2 +- pkg/service/testmain_test.go | 2 +- scripts/kclvm.go | 45 +++++----- 10 files changed, 112 insertions(+), 98 deletions(-) rename kclvm.go => kcl.go (99%) rename kclvm_test.go => kcl_test.go (99%) rename kclvm_version.go => kcl_version.go (93%) diff --git a/bench_test.go b/bench_test.go index baa7f361..b1dd96de 100644 --- a/bench_test.go +++ b/bench_test.go @@ -1,8 +1,8 @@ // Copyright The KCL Authors. All rights reserved. -package kclvm +package kcl -// KCLVM_GO_API_TEST_NUM_CPU=1 go test -bench=. +// KCL_GO_API_TEST_NUM_CPU=1 go test -bench=. import ( "os" diff --git a/docs/api.md b/docs/api.md index 1baa39bb..4022c857 100644 --- a/docs/api.md +++ b/docs/api.md @@ -6,7 +6,7 @@ import "kcl-lang.io/kcl-go" ``` -Package kclvm +Package kcl KCL Go SDK @@ -94,68 +94,81 @@ x1 = Person { ## Index -- [Constants](<#constants>) -- [func FormatCode\(code interface\{\}\) \(\[\]byte, error\)](<#FormatCode>) -- [func FormatPath\(path string\) \(changedPaths \[\]string, err error\)](<#FormatPath>) -- [func GetSchemaTypeMapping\(filename string, src any, schemaName string\) \(map\[string\]\*KclType, error\)](<#GetSchemaTypeMapping>) -- [func InitKclvmPath\(kclvmRoot string\)](<#InitKclvmPath>) -- [func InitKclvmRuntime\(n int\)](<#InitKclvmRuntime>) -- [func LintPath\(paths \[\]string\) \(results \[\]string, err error\)](<#LintPath>) -- [func ListDepFiles\(workDir string, opt \*ListDepFilesOption\) \(files \[\]string, err error\)](<#ListDepFiles>) -- [func ListDownStreamFiles\(workDir string, opt \*ListDepsOptions\) \(\[\]string, error\)](<#ListDownStreamFiles>) -- [func ListUpStreamFiles\(workDir string, opt \*ListDepsOptions\) \(deps \[\]string, err error\)](<#ListUpStreamFiles>) -- [func OverrideFile\(file string, specs, importPaths \[\]string\) \(bool, error\)](<#OverrideFile>) -- [func Validate\(dataFile, schemaFile string, opts \*ValidateOptions\) \(ok bool, err error\)](<#Validate>) -- [func ValidateCode\(data, code string, opts \*ValidateOptions\) \(ok bool, err error\)](<#ValidateCode>) -- [type KCLResult](<#KCLResult>) -- [type KCLResultList](<#KCLResultList>) - - [func MustRun\(path string, opts ...Option\) \*KCLResultList](<#MustRun>) - - [func Run\(path string, opts ...Option\) \(\*KCLResultList, error\)](<#Run>) - - [func RunFiles\(paths \[\]string, opts ...Option\) \(\*KCLResultList, error\)](<#RunFiles>) -- [type KclType](<#KclType>) - - [func GetSchemaType\(filename string, src any, schemaName string\) \(\[\]\*KclType, error\)](<#GetSchemaType>) -- [type ListDepFilesOption](<#ListDepFilesOption>) -- [type ListDepsOptions](<#ListDepsOptions>) -- [type ListOptionsArgs](<#ListOptionsArgs>) -- [type ListOptionsResult](<#ListOptionsResult>) - - [func ListOptions\(args \*ListOptionsArgs\) \(\*ListOptionsResult, error\)](<#ListOptions>) -- [type ListVariablesArgs](<#ListVariablesArgs>) -- [type ListVariablesResult](<#ListVariablesResult>) - - [func ListVariables\(args \*ListVariablesArgs\) \(\*ListVariablesResult, error\)](<#ListVariables>) -- [type LoadPackageArgs](<#LoadPackageArgs>) -- [type LoadPackageResult](<#LoadPackageResult>) - - [func LoadPackage\(args \*LoadPackageArgs\) \(\*LoadPackageResult, error\)](<#LoadPackage>) -- [type Option](<#Option>) - - [func NewOption\(\) \*Option](<#NewOption>) - - [func WithCode\(codes ...string\) Option](<#WithCode>) - - [func WithDisableNone\(disableNone bool\) Option](<#WithDisableNone>) - - [func WithExternalPkgAndPath\(name, path string\) Option](<#WithExternalPkgAndPath>) - - [func WithExternalPkgs\(externalPkgs ...string\) Option](<#WithExternalPkgs>) - - [func WithFullTypePath\(fullTypePath bool\) Option](<#WithFullTypePath>) - - [func WithIncludeSchemaTypePath\(includeSchemaTypePath bool\) Option](<#WithIncludeSchemaTypePath>) - - [func WithKFilenames\(filenames ...string\) Option](<#WithKFilenames>) - - [func WithLogger\(l io.Writer\) Option](<#WithLogger>) - - [func WithOptions\(key\_value\_list ...string\) Option](<#WithOptions>) - - [func WithOverrides\(override\_list ...string\) Option](<#WithOverrides>) - - [func WithPrintOverridesAST\(printOverridesAST bool\) Option](<#WithPrintOverridesAST>) - - [func WithSelectors\(selectors ...string\) Option](<#WithSelectors>) - - [func WithSettings\(filename string\) Option](<#WithSettings>) - - [func WithShowHidden\(showHidden bool\) Option](<#WithShowHidden>) - - [func WithSortKeys\(sortKeys bool\) Option](<#WithSortKeys>) - - [func WithWorkDir\(workDir string\) Option](<#WithWorkDir>) -- [type ParseProgramArgs](<#ParseProgramArgs>) -- [type ParseProgramResult](<#ParseProgramResult>) - - [func ParseProgram\(args \*ParseProgramArgs\) \(\*ParseProgramResult, error\)](<#ParseProgram>) -- [type TestCaseInfo](<#TestCaseInfo>) -- [type TestOptions](<#TestOptions>) -- [type TestResult](<#TestResult>) - - [func Test\(testOpts \*TestOptions, opts ...Option\) \(TestResult, error\)](<#Test>) -- [type UpdateDependenciesArgs](<#UpdateDependenciesArgs>) -- [type UpdateDependenciesResult](<#UpdateDependenciesResult>) - - [func UpdateDependencies\(args \*UpdateDependenciesArgs\) \(\*UpdateDependenciesResult, error\)](<#UpdateDependencies>) -- [type ValidateOptions](<#ValidateOptions>) -- [type VersionResult](<#VersionResult>) - - [func GetVersion\(\) \(\*VersionResult, error\)](<#GetVersion>) +- [kclvm](#kclvm) + - [Index](#index) + - [Constants](#constants) + - [func FormatCode](#func-formatcode) + - [Output](#output) + - [func FormatPath](#func-formatpath) + - [func GetSchemaTypeMapping](#func-getschematypemapping) + - [func InitKclvmPath](#func-initkclvmpath) + - [func InitKclvmRuntime](#func-initkclvmruntime) + - [func LintPath](#func-lintpath) + - [Output](#output-1) + - [func ListDepFiles](#func-listdepfiles) + - [func ListDownStreamFiles](#func-listdownstreamfiles) + - [func ListUpStreamFiles](#func-listupstreamfiles) + - [func OverrideFile](#func-overridefile) + - [func Validate](#func-validate) + - [func ValidateCode](#func-validatecode) + - [type KCLResult](#type-kclresult) + - [Output](#output-2) + - [Output](#output-3) + - [type KCLResultList](#type-kclresultlist) + - [func MustRun](#func-mustrun) + - [Output](#output-4) + - [Output](#output-5) + - [Output](#output-6) + - [func Run](#func-run) + - [func RunFiles](#func-runfiles) + - [type KclType](#type-kcltype) + - [func GetSchemaType](#func-getschematype) + - [type ListDepFilesOption](#type-listdepfilesoption) + - [type ListDepsOptions](#type-listdepsoptions) + - [type ListOptionsArgs](#type-listoptionsargs) + - [type ListOptionsResult](#type-listoptionsresult) + - [func ListOptions](#func-listoptions) + - [Output](#output-7) + - [type ListVariablesArgs](#type-listvariablesargs) + - [type ListVariablesResult](#type-listvariablesresult) + - [func ListVariables](#func-listvariables) + - [Output](#output-8) + - [type LoadPackageArgs](#type-loadpackageargs) + - [type LoadPackageResult](#type-loadpackageresult) + - [func LoadPackage](#func-loadpackage) + - [type Option](#type-option) + - [func NewOption](#func-newoption) + - [func WithCode](#func-withcode) + - [func WithDisableNone](#func-withdisablenone) + - [func WithExternalPkgAndPath](#func-withexternalpkgandpath) + - [func WithExternalPkgs](#func-withexternalpkgs) + - [func WithFullTypePath](#func-withfulltypepath) + - [func WithIncludeSchemaTypePath](#func-withincludeschematypepath) + - [func WithKFilenames](#func-withkfilenames) + - [func WithLogger](#func-withlogger) + - [func WithOptions](#func-withoptions) + - [Output](#output-9) + - [func WithOverrides](#func-withoverrides) + - [func WithPrintOverridesAST](#func-withprintoverridesast) + - [func WithSelectors](#func-withselectors) + - [func WithSettings](#func-withsettings) + - [func WithShowHidden](#func-withshowhidden) + - [func WithSortKeys](#func-withsortkeys) + - [func WithWorkDir](#func-withworkdir) + - [type ParseProgramArgs](#type-parseprogramargs) + - [type ParseProgramResult](#type-parseprogramresult) + - [func ParseProgram](#func-parseprogram) + - [type TestCaseInfo](#type-testcaseinfo) + - [type TestOptions](#type-testoptions) + - [type TestResult](#type-testresult) + - [func Test](#func-test) + - [type UpdateDependenciesArgs](#type-updatedependenciesargs) + - [type UpdateDependenciesResult](#type-updatedependenciesresult) + - [func UpdateDependencies](#func-updatedependencies) + - [Output](#output-10) + - [type ValidateOptions](#type-validateoptions) + - [type VersionResult](#type-versionresult) + - [func GetVersion](#func-getversion) ## Constants diff --git a/example_test.go b/example_test.go index 02ae5b1c..7b186088 100644 --- a/example_test.go +++ b/example_test.go @@ -1,6 +1,6 @@ // Copyright The KCL Authors. All rights reserved. -package kclvm_test +package kcl_test import ( "fmt" diff --git a/go.mod b/go.mod index f9fd9e29..a30e0633 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( google.golang.org/grpc v1.65.0 google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v3 v3.0.1 - kcl-lang.io/lib v0.10.0-alpha.1 + kcl-lang.io/lib v0.10.0-alpha.2 ) require ( diff --git a/go.sum b/go.sum index b7558571..55e88e6f 100644 --- a/go.sum +++ b/go.sum @@ -115,5 +115,5 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -kcl-lang.io/lib v0.10.0-alpha.1 h1:GMVB75Pc1W29gcl1WlVgdgUscH6h+d9No0fzBH0rNYg= -kcl-lang.io/lib v0.10.0-alpha.1/go.mod h1:tu+tzwGgHLzYZSIxUG/ntipStrxZd6OvutWYPTxS7cs= +kcl-lang.io/lib v0.10.0-alpha.2 h1:WWZYNbN/jpgexe4KZHFUEvKWY7LQPdN53WCFBOFKqSs= +kcl-lang.io/lib v0.10.0-alpha.2/go.mod h1:tu+tzwGgHLzYZSIxUG/ntipStrxZd6OvutWYPTxS7cs= diff --git a/kclvm.go b/kcl.go similarity index 99% rename from kclvm.go rename to kcl.go index e3a4da80..56349dbb 100644 --- a/kclvm.go +++ b/kcl.go @@ -1,6 +1,6 @@ -// Copyright 2023 The KCL Authors. All rights reserved. +// Copyright The KCL Authors. All rights reserved. -// Package kclvm +// Package kcl /* KCL Go SDK @@ -28,7 +28,7 @@ KCL Go SDK │WithDisableNone │ │ │ │ │ └─────────────────┘ └─────────────────┘ └─────────────────┘ */ -package kclvm +package kcl import ( "io" diff --git a/kclvm_test.go b/kcl_test.go similarity index 99% rename from kclvm_test.go rename to kcl_test.go index beb5d96d..6afa803c 100644 --- a/kclvm_test.go +++ b/kcl_test.go @@ -1,6 +1,6 @@ // Copyright The KCL Authors. All rights reserved. -package kclvm_test +package kcl_test import ( "bytes" @@ -21,7 +21,7 @@ import ( "kcl-lang.io/kcl-go/pkg/spec/gpyrpc" ) -const tEnvNumCpu = "KCLVM_GO_API_TEST_NUM_CPU" +const tEnvNumCpu = "KCL_GO_API_TEST_NUM_CPU" func TestMain(m *testing.M) { flag.Parse() diff --git a/kclvm_version.go b/kcl_version.go similarity index 93% rename from kclvm_version.go rename to kcl_version.go index 542c17b0..6e5e86bb 100644 --- a/kclvm_version.go +++ b/kcl_version.go @@ -1,6 +1,6 @@ // Copyright The KCL Authors. All rights reserved. -package kclvm +package kcl import "kcl-lang.io/kcl-go/scripts" diff --git a/pkg/service/testmain_test.go b/pkg/service/testmain_test.go index 9b8c61aa..62cbf301 100644 --- a/pkg/service/testmain_test.go +++ b/pkg/service/testmain_test.go @@ -14,7 +14,7 @@ import ( "kcl-lang.io/kcl-go/pkg/runtime" ) -const tEnvNumCpu = "KCLVM_GO_API_TEST_NUM_CPU" +const tEnvNumCpu = "KCL_GO_API_TEST_NUM_CPU" const tRestServerAddr = "127.0.0.1:7001" func TestMain(m *testing.M) { diff --git a/scripts/kclvm.go b/scripts/kclvm.go index bfabf58c..d7b9bead 100644 --- a/scripts/kclvm.go +++ b/scripts/kclvm.go @@ -17,27 +17,28 @@ const ( ) const ( - KclvmAbiVersion KclvmVersionType = KclvmVersionType_v0_9_0 - KclvmVersionType_latest = KclvmVersionType_v0_9_0 + KclvmAbiVersion KclvmVersionType = KclvmVersionType_v0_10_0 + KclvmVersionType_latest = KclvmVersionType_v0_10_0 - KclvmVersionType_v0_9_0 KclvmVersionType = "v0.9.0" - KclvmVersionType_v0_8_0 KclvmVersionType = "v0.8.0" - KclvmVersionType_v0_7_5 KclvmVersionType = "v0.7.5" - KclvmVersionType_v0_7_4 KclvmVersionType = "v0.7.4" - KclvmVersionType_v0_7_3 KclvmVersionType = "v0.7.3" - KclvmVersionType_v0_7_2 KclvmVersionType = "v0.7.2" - KclvmVersionType_v0_7_1 KclvmVersionType = "v0.7.1" - KclvmVersionType_v0_7_0 KclvmVersionType = "v0.7.0" - KclvmVersionType_v0_6_0 KclvmVersionType = "v0.6.0" - KclvmVersionType_v0_5_6 KclvmVersionType = "v0.5.6" - KclvmVersionType_v0_5_5 KclvmVersionType = "v0.5.5" - KclvmVersionType_v0_5_4 KclvmVersionType = "v0.5.4" - KclvmVersionType_v0_5_3 KclvmVersionType = "v0.5.3" - KclvmVersionType_v0_5_2 KclvmVersionType = "v0.5.2" - KclvmVersionType_v0_5_1 KclvmVersionType = "v0.5.1" - KclvmVersionType_v0_5_0 KclvmVersionType = "v0.5.0" - KclvmVersionType_v0_4_6 KclvmVersionType = "v0.4.6" - KclvmVersionType_v0_4_5 KclvmVersionType = "v0.4.5" - KclvmVersionType_v0_4_4 KclvmVersionType = "v0.4.4" - KclvmVersionType_v0_4_3 KclvmVersionType = "v0.4.3" + KclvmVersionType_v0_10_0 KclvmVersionType = "v0.10.0" + KclvmVersionType_v0_9_0 KclvmVersionType = "v0.9.0" + KclvmVersionType_v0_8_0 KclvmVersionType = "v0.8.0" + KclvmVersionType_v0_7_5 KclvmVersionType = "v0.7.5" + KclvmVersionType_v0_7_4 KclvmVersionType = "v0.7.4" + KclvmVersionType_v0_7_3 KclvmVersionType = "v0.7.3" + KclvmVersionType_v0_7_2 KclvmVersionType = "v0.7.2" + KclvmVersionType_v0_7_1 KclvmVersionType = "v0.7.1" + KclvmVersionType_v0_7_0 KclvmVersionType = "v0.7.0" + KclvmVersionType_v0_6_0 KclvmVersionType = "v0.6.0" + KclvmVersionType_v0_5_6 KclvmVersionType = "v0.5.6" + KclvmVersionType_v0_5_5 KclvmVersionType = "v0.5.5" + KclvmVersionType_v0_5_4 KclvmVersionType = "v0.5.4" + KclvmVersionType_v0_5_3 KclvmVersionType = "v0.5.3" + KclvmVersionType_v0_5_2 KclvmVersionType = "v0.5.2" + KclvmVersionType_v0_5_1 KclvmVersionType = "v0.5.1" + KclvmVersionType_v0_5_0 KclvmVersionType = "v0.5.0" + KclvmVersionType_v0_4_6 KclvmVersionType = "v0.4.6" + KclvmVersionType_v0_4_5 KclvmVersionType = "v0.4.5" + KclvmVersionType_v0_4_4 KclvmVersionType = "v0.4.4" + KclvmVersionType_v0_4_3 KclvmVersionType = "v0.4.3" )