Skip to content

Commit f5cb5b5

Browse files
committed
chore: bump kclvm to kcl
1 parent 0c6b610 commit f5cb5b5

File tree

14 files changed

+89
-89
lines changed

14 files changed

+89
-89
lines changed

docs/reference/xlang-api/go-api.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_position: 3
55
# Go API
66

77
```go
8-
import "kcl-lang.io/kcl-go"
8+
import kcl "kcl-lang.io/kcl-go"
99
```
1010

1111
## KCL Go SDK
@@ -57,12 +57,12 @@ x1 = Person {
5757
}
5858
`
5959

60-
yaml := kclvm.MustRun("testdata/main.k", kclvm.WithCode(k_code)).First().YAMLString()
60+
yaml := kcl.MustRun("testdata/main.k", kcl.WithCode(k_code)).First().YAMLString()
6161
fmt.Println(yaml)
6262

6363
fmt.Println("----")
6464

65-
result := kclvm.MustRun("./testdata/main.k").First()
65+
result := kcl.MustRun("./testdata/main.k").First()
6666
fmt.Println(result.JSONString())
6767

6868
fmt.Println("----")
@@ -141,7 +141,7 @@ FormatCode returns the formatted code.
141141

142142
```go
143143
{
144-
out, err := kclvm.FormatCode(`a = 1+2`)
144+
out, err := kcl.FormatCode(`a = 1+2`)
145145
if err != nil {
146146
log.Fatal(err)
147147
}
@@ -174,7 +174,7 @@ the returned changedPaths are the changed file paths \(relative path\)
174174

175175
```go
176176
{
177-
changedPaths, err := kclvm.FormatPath("testdata/fmt")
177+
changedPaths, err := kcl.FormatPath("testdata/fmt")
178178
if err != nil {
179179
log.Fatal(err)
180180
}
@@ -215,7 +215,7 @@ LintPath lint files from the given path
215215
```go
216216
{
217217

218-
results, err := kclvm.LintPath([]string{"testdata/lint/import.k"})
218+
results, err := kcl.LintPath([]string{"testdata/lint/import.k"})
219219
if err != nil {
220220
log.Fatal(err)
221221
}
@@ -308,7 +308,7 @@ x0 = Person {name = "kcl-go"}
308308
x1 = Person {age = 101}
309309
`
310310

311-
result := kclvm.MustRun("testdata/main.k", kclvm.WithCode(k_code)).First()
311+
result := kcl.MustRun("testdata/main.k", kcl.WithCode(k_code)).First()
312312

313313
fmt.Println("x0.name:", result.Get("x0.name"))
314314
fmt.Println("x1.age:", result.Get("x1.age"))
@@ -343,7 +343,7 @@ x = {
343343
}
344344
`
345345

346-
result := kclvm.MustRun("testdata/main.k", kclvm.WithCode(k_code)).First()
346+
result := kcl.MustRun("testdata/main.k", kcl.WithCode(k_code)).First()
347347

348348
var person struct {
349349
Name string
@@ -384,7 +384,7 @@ MustRun is like Run but panics if return any error.
384384

385385
```go
386386
{
387-
yaml := kclvm.MustRun("testdata/main.k", kclvm.WithCode(`name = "kcl"`)).First().YAMLString()
387+
yaml := kcl.MustRun("testdata/main.k", kcl.WithCode(`name = "kcl"`)).First().YAMLString()
388388
fmt.Println(yaml)
389389

390390
}
@@ -408,10 +408,10 @@ name: kcl
408408
b = 1
409409
a = 2
410410
`
411-
yaml := kclvm.MustRun("testdata/main.k", kclvm.WithCode(code)).GetRawYamlResult()
411+
yaml := kcl.MustRun("testdata/main.k", kcl.WithCode(code)).GetRawYamlResult()
412412
fmt.Println(yaml)
413413

414-
yaml_sorted := kclvm.MustRun("testdata/main.k", kclvm.WithCode(code), kclvm.WithSortKeys(true)).GetRawYamlResult()
414+
yaml_sorted := kcl.MustRun("testdata/main.k", kcl.WithCode(code), kcl.WithSortKeys(true)).GetRawYamlResult()
415415
fmt.Println(yaml_sorted)
416416

417417
}
@@ -440,7 +440,7 @@ schema Person:
440440
441441
x = Person()
442442
`
443-
json := kclvm.MustRun("testdata/main.k", kclvm.WithCode(code)).First().JSONString()
443+
json := kcl.MustRun("testdata/main.k", kcl.WithCode(code)).First().JSONString()
444444
fmt.Println(json)
445445

446446
}
@@ -464,7 +464,7 @@ x = Person()
464464

465465
```go
466466
{
467-
yaml := kclvm.MustRun("./testdata/app0/kcl.yaml").First().YAMLString()
467+
yaml := kcl.MustRun("./testdata/app0/kcl.yaml").First().YAMLString()
468468
fmt.Println(yaml)
469469
}
470470
```
@@ -486,7 +486,7 @@ Run evaluates the KCL program with path and opts, then returns the object list.
486486
```go
487487
{
488488

489-
x, err := kclvm.Run("./testdata/app0/kcl.yaml")
489+
x, err := kcl.Run("./testdata/app0/kcl.yaml")
490490
assert(err == nil, err)
491491

492492
fmt.Println(x.First().Get("deploy_topology.1.zone"))
@@ -516,7 +516,7 @@ RunFiles evaluates the KCL program with multi file path and opts, then returns t
516516

517517
```go
518518
{
519-
result, _ := kclvm.RunFiles([]string{"./testdata/app0/kcl.yaml"})
519+
result, _ := kcl.RunFiles([]string{"./testdata/app0/kcl.yaml"})
520520
fmt.Println(result.First().YAMLString())
521521
}
522522
```
@@ -615,8 +615,8 @@ WithOptions returns a Option which hold a key=value pair list for option functio
615615
name = option("name")
616616
age = option("age")
617617
`
618-
x, err := kclvm.Run("hello.k", kclvm.WithCode(code),
619-
kclvm.WithOptions("name=kcl", "age=1"),
618+
x, err := kcl.Run("hello.k", kcl.WithCode(code),
619+
kcl.WithOptions("name=kcl", "age=1"),
620620
)
621621
if err != nil {
622622
log.Fatal(err)

i18n/zh-CN/docusaurus-plugin-content-blog/2023-04-14-kcl-0.4.6-release/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ spec:
318318

319319
### 多语言 SDK
320320

321-
在此次更新中,我们发布了全新的 kclvm-go SDKKCL 集成到您的 Go 应用程序中,并提供丰富的 APIKCL 进行交互。您可以在 [这里](https://kcl-lang.io/docs/next/reference/xlang-api/go-api) 查询详细的 API 文档。此外我们还更新了如下特性和错误修复:
321+
在此次更新中,我们发布了全新的 KCL Go SDKKCL 集成到您的 Go 应用程序中,并提供丰富的 APIKCL 进行交互。您可以在 [这里](https://kcl-lang.io/docs/next/reference/xlang-api/go-api) 查询详细的 API 文档。此外我们还更新了如下特性和错误修复:
322322

323-
+ 感谢 @jakezhu9 修复了 kclvm-go 未预期的 KCL 格式化 APICI Pipeline 中单元测试错误
323+
+ 感谢 @jakezhu9 修复了 kcl-go 未预期的 KCL 格式化 APICI Pipeline 中单元测试错误
324324
+ 感谢 @Ekko 贡献 Go struct 和 KCL schema 双向转换支持,详见:
325325
+ [Go struct -> KCL schema](https://github.com/kcl-lang/kcl-go/blob/main/pkg/tools/gen/genkcl.go#L23)
326326
+ [KCL schema -> Go struct](https://github.com/kcl-lang/kcl-go/blob/main/pkg/tools/gen/gengo.go#L23)

i18n/zh-CN/docusaurus-plugin-content-blog/2023-04-27-new-version-feature-interpretation-kclvm-go-feature-overview/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: KCL 新版本功能解读系列 - Go SDK 功能速览!
44
authors:
55
name: KCL Team
66
title: KCL Team
7-
tags: [KCL, kclvm-go]
7+
tags: [KCL, kcl-go]
88
---
99

1010
## KCL 是什么?

i18n/zh-CN/docusaurus-plugin-content-docs/current/community/contribute/git-guideline.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ node_modules/*
7070
e.g. 张三在分支 `zhangsan:fix-output-fmt-bug` 中创建的 commit。
7171
```
7272
73-
fix(kclvm-printer): fix an output format bug in kclvm-printer
73+
fix(kcl-printer): fix an output format bug in kcl-printer
7474
75-
There is an output format bug in kclvm-printer because ...,
75+
There is an output format bug in kcl-printer because ...,
7676
So, The calling of method "XXX" is replaced by "HHHH"...,
7777
...
7878
@@ -102,7 +102,7 @@ node_modules/*
102102

103103
e.g. 张三为分支`fix/zhangsan/fix_output_fmt_bug`创建的PR名称。
104104
```
105-
fix(kclvm-printer): fix an output format bug in kclvm-printer.
105+
fix(kcl-printer): fix an output format bug in kcl-printer.
106106
```
107107

108108
## 5. 目前 type 支持的类型

i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/xlang-api/go-api.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_position: 3
55
# Go API
66

77
```go
8-
import "kcl-lang.io/kcl-go"
8+
import kcl "kcl-lang.io/kcl-go"
99
```
1010

1111
## KCL Go SDK
@@ -57,12 +57,12 @@ x1 = Person {
5757
}
5858
`
5959

60-
yaml := kclvm.MustRun("testdata/main.k", kclvm.WithCode(k_code)).First().YAMLString()
60+
yaml := kcl.MustRun("testdata/main.k", kcl.WithCode(k_code)).First().YAMLString()
6161
fmt.Println(yaml)
6262

6363
fmt.Println("----")
6464

65-
result := kclvm.MustRun("./testdata/main.k").First()
65+
result := kcl.MustRun("./testdata/main.k").First()
6666
fmt.Println(result.JSONString())
6767

6868
fmt.Println("----")
@@ -141,7 +141,7 @@ FormatCode returns the formatted code.
141141

142142
```go
143143
{
144-
out, err := kclvm.FormatCode(`a = 1+2`)
144+
out, err := kcl.FormatCode(`a = 1+2`)
145145
if err != nil {
146146
log.Fatal(err)
147147
}
@@ -174,7 +174,7 @@ the returned changedPaths are the changed file paths \(relative path\)
174174

175175
```go
176176
{
177-
changedPaths, err := kclvm.FormatPath("testdata/fmt")
177+
changedPaths, err := kcl.FormatPath("testdata/fmt")
178178
if err != nil {
179179
log.Fatal(err)
180180
}
@@ -215,7 +215,7 @@ LintPath lint files from the given path
215215
```go
216216
{
217217

218-
results, err := kclvm.LintPath([]string{"testdata/lint/import.k"})
218+
results, err := kcl.LintPath([]string{"testdata/lint/import.k"})
219219
if err != nil {
220220
log.Fatal(err)
221221
}
@@ -308,7 +308,7 @@ x0 = Person {name = "kcl-go"}
308308
x1 = Person {age = 101}
309309
`
310310

311-
result := kclvm.MustRun("testdata/main.k", kclvm.WithCode(k_code)).First()
311+
result := kcl.MustRun("testdata/main.k", kcl.WithCode(k_code)).First()
312312

313313
fmt.Println("x0.name:", result.Get("x0.name"))
314314
fmt.Println("x1.age:", result.Get("x1.age"))
@@ -343,7 +343,7 @@ x = {
343343
}
344344
`
345345

346-
result := kclvm.MustRun("testdata/main.k", kclvm.WithCode(k_code)).First()
346+
result := kcl.MustRun("testdata/main.k", kcl.WithCode(k_code)).First()
347347

348348
var person struct {
349349
Name string
@@ -384,7 +384,7 @@ MustRun is like Run but panics if return any error.
384384

385385
```go
386386
{
387-
yaml := kclvm.MustRun("testdata/main.k", kclvm.WithCode(`name = "kcl"`)).First().YAMLString()
387+
yaml := kcl.MustRun("testdata/main.k", kcl.WithCode(`name = "kcl"`)).First().YAMLString()
388388
fmt.Println(yaml)
389389

390390
}
@@ -408,10 +408,10 @@ name: kcl
408408
b = 1
409409
a = 2
410410
`
411-
yaml := kclvm.MustRun("testdata/main.k", kclvm.WithCode(code)).GetRawYamlResult()
411+
yaml := kcl.MustRun("testdata/main.k", kcl.WithCode(code)).GetRawYamlResult()
412412
fmt.Println(yaml)
413413

414-
yaml_sorted := kclvm.MustRun("testdata/main.k", kclvm.WithCode(code), kclvm.WithSortKeys(true)).GetRawYamlResult()
414+
yaml_sorted := kcl.MustRun("testdata/main.k", kcl.WithCode(code), kcl.WithSortKeys(true)).GetRawYamlResult()
415415
fmt.Println(yaml_sorted)
416416

417417
}
@@ -440,7 +440,7 @@ schema Person:
440440
441441
x = Person()
442442
`
443-
json := kclvm.MustRun("testdata/main.k", kclvm.WithCode(code)).First().JSONString()
443+
json := kcl.MustRun("testdata/main.k", kcl.WithCode(code)).First().JSONString()
444444
fmt.Println(json)
445445

446446
}
@@ -464,7 +464,7 @@ x = Person()
464464

465465
```go
466466
{
467-
yaml := kclvm.MustRun("./testdata/app0/kcl.yaml").First().YAMLString()
467+
yaml := kcl.MustRun("./testdata/app0/kcl.yaml").First().YAMLString()
468468
fmt.Println(yaml)
469469
}
470470
```
@@ -486,7 +486,7 @@ Run evaluates the KCL program with path and opts, then returns the object list.
486486
```go
487487
{
488488

489-
x, err := kclvm.Run("./testdata/app0/kcl.yaml")
489+
x, err := kcl.Run("./testdata/app0/kcl.yaml")
490490
assert(err == nil, err)
491491

492492
fmt.Println(x.First().Get("deploy_topology.1.zone"))
@@ -516,7 +516,7 @@ RunFiles evaluates the KCL program with multi file path and opts, then returns t
516516

517517
```go
518518
{
519-
result, _ := kclvm.RunFiles([]string{"./testdata/app0/kcl.yaml"})
519+
result, _ := kcl.RunFiles([]string{"./testdata/app0/kcl.yaml"})
520520
fmt.Println(result.First().YAMLString())
521521
}
522522
```
@@ -615,8 +615,8 @@ WithOptions returns a Option which hold a key=value pair list for option functio
615615
name = option("name")
616616
age = option("age")
617617
`
618-
x, err := kclvm.Run("hello.k", kclvm.WithCode(code),
619-
kclvm.WithOptions("name=kcl", "age=1"),
618+
x, err := kcl.Run("hello.k", kcl.WithCode(code),
619+
kcl.WithOptions("name=kcl", "age=1"),
620620
)
621621
if err != nil {
622622
log.Fatal(err)

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.4.3/community/contribute/git-guideline.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ node_modules/*
7070
e.g. 张三在分支 `zhangsan:fix-output-fmt-bug` 中创建的 commit。
7171
```
7272
73-
fix(kclvm-printer): fix an output format bug in kclvm-printer
73+
fix(kcl-printer): fix an output format bug in kcl-printer
7474
75-
There is an output format bug in kclvm-printer because ...,
75+
There is an output format bug in kcl-printer because ...,
7676
So, The calling of method "XXX" is replaced by "HHHH"...,
7777
...
7878
@@ -102,7 +102,7 @@ node_modules/*
102102

103103
e.g. 张三为分支`fix/zhangsan/fix_output_fmt_bug`创建的PR名称。
104104
```
105-
fix(kclvm-printer): fix an output format bug in kclvm-printer.
105+
fix(kcl-printer): fix an output format bug in kcl-printer.
106106
```
107107

108108
## 5. 目前 type 支持的类型

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.5.0/community/contribute/git-guideline.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ node_modules/*
7070
e.g. 张三在分支 `zhangsan:fix-output-fmt-bug` 中创建的 commit。
7171
```
7272
73-
fix(kclvm-printer): fix an output format bug in kclvm-printer
73+
fix(kcl-printer): fix an output format bug in kcl-printer
7474
75-
There is an output format bug in kclvm-printer because ...,
75+
There is an output format bug in kcl-printer because ...,
7676
So, The calling of method "XXX" is replaced by "HHHH"...,
7777
...
7878
@@ -102,7 +102,7 @@ node_modules/*
102102

103103
e.g. 张三为分支`fix/zhangsan/fix_output_fmt_bug`创建的PR名称。
104104
```
105-
fix(kclvm-printer): fix an output format bug in kclvm-printer.
105+
fix(kcl-printer): fix an output format bug in kcl-printer.
106106
```
107107

108108
## 5. 目前 type 支持的类型

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.5.0/reference/lang/codelab/schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ nginx:
571571
例如,我们想要在现有 schema 中支持声明持久卷,作为可重用的 Kubernetes schema。在这种情况下,我们可以通过以下 `mixin` 和 `protocal` 进行包装:
572572

573573
```python
574-
import kusion_kubernetes.api.core.v1
574+
import k8spkg.api.core.v1
575575
576576
protocol PVCProtocol:
577577
pvc?: {str:}

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.5.0/reference/lang/tour.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,7 @@ kcl_cli_configs:
28522852
output: ./stdout.golden
28532853
kcl_options:
28542854
- key: image
2855-
value: docker.io/kusion:latest
2855+
value: docker.io/kcllang/kcl:latest
28562856
```
28572857
28582858
KCL CLI -Y 参数还支持多文件配置,并支持编译参数和顶级参数的单独写入与合并。
@@ -2880,7 +2880,7 @@ kcl_cli_configs:
28802880
```yaml
28812881
kcl_options:
28822882
- key: image
2883-
value: docker.io/kusion:latest
2883+
value: docker.io/kcllang/kcl:latest
28842884
```
28852885

28862886
我们可以使用以下指令获取每个参数的含义

0 commit comments

Comments
 (0)