Skip to content

Commit 7655e90

Browse files
committed
chore: sync v0.9.0 documents
Signed-off-by: peefy <[email protected]>
1 parent fdd2e27 commit 7655e90

File tree

46 files changed

+789
-140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+789
-140
lines changed

Diff for: blog/2024-07-05-kcl-0.9.0-release/index.md

+51-51
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The KCL team is pleased to announce that **KCL v0.9.0 is now available**! This r
2121

2222
**We would like to extend our heartfelt thanks to all 120 community contributors who participated in the iteration from version v0.8 to v0.9 over the past 120 days. The following list is in no particular order.**
2323

24-
*@Shashank Mittal, @MattHodge, @officialasishkumar, @Gmin2, @Akash Kumar, @sfshumaker, @sanzoghenzo, @MOHAMED FAWAS, @bradkwadsworth-mw, @excalq, @Daksh-10, @metacoma, @Wes McNamee, @Stéphane Este-Gracias, @octonawish-akcodes, @zong-zhe, @shashank-iitbhu, @NAVRockClimber, @AkashKumar7902, @Petrosz007, @patrycju, @Korada Vishal, @selfuryon, @tvandinther, @vtomilov, @Peefy, @taylormonacelli, @Tertium, @Stefano Borrelli, @Bishal, @kukacz, @borgius, @steeling, @jheyduk, @HStéphane Este-Gracias, @userxiaosi, @folliehiyuki, @kubernegit, @nizq, @Alexander Fuchs, @ihor-hrytskiv, @Mohamed Asif, @reedjosh, @Wck-iipi, @evensolberg, @aldoborrero@ron18219, @rodrigoalvamat, @mproffitt, @karlhepler, @shruti2522, @leon-andria, @prahaladramji, @Even Solberg, @utnim2, @warjiang, @Asish Kumar, @He1pa, @Emmanuel Alap, @d4v1d03, @Yvan da Silva, @Abhishek, @DavidChevallier, @zargor, @Kim Sondrup, @SamirMarin, @Hai Wu, @MatisseB, @beholdenkey, @nestoralonso, @HAkash Kumar, @olinux, @liangyuanpeng, @ngergs, @Penguin, @ealap, @markphillips100, @Henri Williams, @eshepelyuk, @CC007, @mintu, @M Slane, @zhuxw, @atelsier, @aleeriz, @LinYunling, @YvanDaSilva, @chai2010, @Sergey Ryabin, @vfarcic, @vemoo, @riven-blade, @ibishal, @empath-nirvana, @bozaro, @jgascon-nx, @reckless-huang, @Sergei Iakovlev, @Blarc, @JeevaRamanathan, @dennybaa, @PrettySolution, @east4ming, @nkabir, @sestegra, @XiaoK29, @ricochet1k, @yjsnly, @umaher, @SjuulJanssen, @wilsonwang371, @Lukáš Kubín, @samuel-deal-tisseo, @blakebarnett, @Uladzislau Maher, @ytsarev, @Vishalk91-4, @Stephen C, @Tom van Dinther, @MrGuoRanDuo, @dopesickjam*
24+
_@Shashank Mittal, @MattHodge, @officialasishkumar, @Gmin2, @Akash Kumar, @sfshumaker, @sanzoghenzo, @MOHAMED FAWAS, @bradkwadsworth-mw, @excalq, @Daksh-10, @metacoma, @Wes McNamee, @Stéphane Este-Gracias, @octonawish-akcodes, @zong-zhe, @shashank-iitbhu, @NAVRockClimber, @AkashKumar7902, @Petrosz007, @patrycju, @Korada Vishal, @selfuryon, @tvandinther, @vtomilov, @Peefy, @taylormonacelli, @Tertium, @Stefano Borrelli, @Bishal, @kukacz, @borgius, @steeling, @jheyduk, @HStéphane Este-Gracias, @userxiaosi, @folliehiyuki, @kubernegit, @nizq, @Alexander Fuchs, @ihor-hrytskiv, @Mohamed Asif, @reedjosh, @Wck-iipi, @evensolberg, @aldoborrero@ron18219, @rodrigoalvamat, @mproffitt, @karlhepler, @shruti2522, @leon-andria, @prahaladramji, @Even Solberg, @utnim2, @warjiang, @Asish Kumar, @He1pa, @Emmanuel Alap, @d4v1d03, @Yvan da Silva, @Abhishek, @DavidChevallier, @zargor, @Kim Sondrup, @SamirMarin, @Hai Wu, @MatisseB, @beholdenkey, @nestoralonso, @HAkash Kumar, @olinux, @liangyuanpeng, @ngergs, @Penguin, @ealap, @markphillips100, @Henri Williams, @eshepelyuk, @CC007, @mintu, @M Slane, @zhuxw, @atelsier, @aleeriz, @LinYunling, @YvanDaSilva, @chai2010, @Sergey Ryabin, @vfarcic, @vemoo, @riven-blade, @ibishal, @empath-nirvana, @bozaro, @jgascon-nx, @reckless-huang, @Sergei Iakovlev, @Blarc, @JeevaRamanathan, @dennybaa, @PrettySolution, @east4ming, @nkabir, @sestegra, @XiaoK29, @ricochet1k, @yjsnly, @umaher, @SjuulJanssen, @wilsonwang371, @Lukáš Kubín, @samuel-deal-tisseo, @blakebarnett, @Uladzislau Maher, @ytsarev, @Vishalk91-4, @Stephen C, @Tom van Dinther, @MrGuoRanDuo, @dopesickjam_
2525

2626
## 📚 Key Updates
2727

@@ -39,15 +39,15 @@ KCL IDE has further optimized incremental compilation and performance for semant
3939

4040
#### Language
4141

42-
+ String interpolation now supports escaping with `\${}` similar to Shell to cancel interpolation.
42+
- String interpolation now supports escaping with `\${}` similar to Shell to cancel interpolation.
4343

4444
```python
4545
world = "world"
4646
hello_world_0 = "hello ${world}" # hello world
4747
hello_world_1 = "hello \${world}" # hello ${world}
4848
```
4949

50-
+ Added schema type support to the `typeof` function for distinguishing schema types from instances.
50+
- Added schema type support to the `typeof` function for distinguishing schema types from instances.
5151

5252
```python
5353
schema Foo:
@@ -58,7 +58,7 @@ type_schema = typeof(foo) # schema
5858
type_type = typeof(Foo) # type
5959
```
6060

61-
+ Added a `full_pkg` keyword argument to the `instances()` method of Schema to read instances of the corresponding schema from all code.
61+
- Added a `full_pkg` keyword argument to the `instances()` method of Schema to read instances of the corresponding schema from all code.
6262

6363
```python
6464
schema Person:
@@ -68,43 +68,43 @@ alice = Person {name = "Alice"}
6868
all_persons = Person.instances(True)
6969
```
7070

71-
+ Removed implicit comparison between bool and int types `0 < True`.
72-
+ Removed comparison features for the list type `[0] < [1]`.
73-
+ Added type assertion failure functionality to the `as` keyword.
74-
+ Optimized closure variable capture logic of `lambda` functions and configuration code blocks `{}` in different scopes to be more intuitive.
71+
- Removed implicit comparison between bool and int types `0 < True`.
72+
- Removed comparison features for the list type `[0] < [1]`.
73+
- Added type assertion failure functionality to the `as` keyword.
74+
- Optimized closure variable capture logic of `lambda` functions and configuration code blocks `{}` in different scopes to be more intuitive.
7575

7676
#### Toolchain
7777

78-
+ `kcl run` now supports outputting configurations in TOML format with the `--format` toml option.
79-
+ `kcl mod add` now supports adding dependencies from private third-party OCI Registries and Git repositories with the `--oci` and `--git` options.
80-
+ `kcl import` now supports importing entire Go Packages as KCL Schemas.
81-
+ `kcl import` now supports importing files with YAML stream format (`---`).
82-
+ `kcl import` now supports importing TOML files as KCL configurations.
83-
+ `kcl clean` now supports cleaning external dependencies and compile caches.
84-
+ `kcl mod init` now supports setting the version of a new KCL module with the `--version` tag.
85-
+ Commands like `kcl run`, `kcl mod add`, and `kcl mod pull` now support accessing private repositories via local Git.
78+
- `kcl run` now supports outputting configurations in TOML format with the `--format` toml option.
79+
- `kcl mod add` now supports adding dependencies from private third-party OCI Registries and Git repositories with the `--oci` and `--git` options.
80+
- `kcl import` now supports importing entire Go Packages as KCL Schemas.
81+
- `kcl import` now supports importing files with YAML stream format (`---`).
82+
- `kcl import` now supports importing TOML files as KCL configurations.
83+
- `kcl clean` now supports cleaning external dependencies and compile caches.
84+
- `kcl mod init` now supports setting the version of a new KCL module with the `--version` tag.
85+
- Commands like `kcl run`, `kcl mod add`, and `kcl mod pull` now support accessing private repositories via local Git.
8686

8787
#### IDE
8888

89-
+ Supports multiple quick fix options.
90-
+ Syntax highlighting for `kcl.mod` and `kcl.mod.lock` files.
91-
+ Partial syntax hover highlighting in the IDE.
92-
+ `import` completion for external dependencies.
93-
+ Function symbol highlighting and Inlay Hints displaying default variable types.
89+
- Supports multiple quick fix options.
90+
- Syntax highlighting for `kcl.mod` and `kcl.mod.lock` files.
91+
- Partial syntax hover highlighting in the IDE.
92+
- `import` completion for external dependencies.
93+
- Function symbol highlighting and Inlay Hints displaying default variable types.
9494

9595
![inlayhint](/img/blog/2024-07-05-kcl-0.9.0-release/inlayhint.png)
9696

9797
#### API
9898

99-
+ The Override API now supports setting different attribute operators (`:`, `=`, and `+=`) for configuration overrides.
100-
+ Go API now supports prototext format and KCL schema output as KCL configurations.
101-
+ Go API now supports serializing any Go Type and Go Value to KCL Schema and configurations.
99+
- The Override API now supports setting different attribute operators (`:`, `=`, and `+=`) for configuration overrides.
100+
- Go API now supports prototext format and KCL schema output as KCL configurations.
101+
- Go API now supports serializing any Go Type and Go Value to KCL Schema and configurations.
102102

103103
### 📦️ Standard Libraries and Third-Party Libraries
104104

105105
#### Standard Libraries
106106

107-
+ Added the `file` standard library for file IO operations, such as reading configurations from YAML and performing configuration merges.
107+
- Added the `file` standard library for file IO operations, such as reading configurations from YAML and performing configuration merges.
108108

109109
```python
110110
import file
@@ -118,14 +118,14 @@ config = p.merge(yaml.decode(file.read("deployment.yaml")), {
118118

119119
For more functions in the `file` module, see: [https://www.kcl-lang.io/docs/reference/model/file](https://www.kcl-lang.io/docs/reference/model/file)
120120

121-
+ Added the `template` standard library for writing template configurations.
121+
- Added the `template` standard library for writing template configurations.
122122

123123
```python
124124
import template
125125

126126
_data = {
127-
name = "handlebars",
128-
v = [ { a = 1 }, { a = 2 } ],
127+
name = "handlebars",
128+
v = [ { a = 1 }, { a = 2 } ],
129129
c = { d = 5 },
130130
g = { b = [ { aa = { bb = 55} }, { aa = { bb = 66} } ] },
131131
people = [ "Yehuda Katz", "Alan Johnson", "Charles Jolley" ]
@@ -147,7 +147,7 @@ Hello world from {{name}}
147147
""", _data)
148148
```
149149

150-
+ Added the `runtime` standard library for capturing runtime exceptions, useful for `kcl test` tool to test exception cases.
150+
- Added the `runtime` standard library for capturing runtime exceptions, useful for `kcl test` tool to test exception cases.
151151

152152
```python
153153
import runtime
@@ -170,24 +170,24 @@ test_person_check_error = lambda {
170170

171171
The number of KCL models has increased to **313**, including major updates as follows:
172172

173-
+ `k8s` released version 1.30
174-
+ `argo-cd` released version 0.1.1
175-
+ `argo-workflow` released version 0.0.3
176-
+ `istio` released version 1.21.2
177-
+ `victoria-metrics-operator` released version 0.45.1
178-
+ `cert-manager` released version 0.1.2
179-
+ `cilium` released version 0.1.1
180-
+ `Longhorn` released version 0.0.1
181-
+ `jsonpatch` released version 0.0.5, supporting rfc6901Decode
182-
+ Added a new third-party library `difflib` for comparing configuration differences
183-
+ Added `argo-cd-order` for sorting argocd sync operation resource order
184-
+ Added models for `cluster-api`, including `cluster-api`, `cluster-api-provider-metal3`, `cluster-api-provider-gcp`, `cluster-api-addon-provider-helm`, `cluster-api-addon-provider-aws`, `cluster-api-provider-azure`, and more
173+
- `k8s` released version 1.30
174+
- `argo-cd` released version 0.1.1
175+
- `argo-workflow` released version 0.0.3
176+
- `istio` released version 1.21.2
177+
- `victoria-metrics-operator` released version 0.45.1
178+
- `cert-manager` released version 0.1.2
179+
- `cilium` released version 0.1.1
180+
- `Longhorn` released version 0.0.1
181+
- `jsonpatch` released version 0.0.5, supporting rfc6901Decode
182+
- Added a new third-party library `difflib` for comparing configuration differences
183+
- Added `argo-cd-order` for sorting argocd sync operation resource order
184+
- Added models for `cluster-api`, including `cluster-api`, `cluster-api-provider-metal3`, `cluster-api-provider-gcp`, `cluster-api-addon-provider-helm`, `cluster-api-addon-provider-aws`, `cluster-api-provider-azure`, and more
185185

186186
### ☸️ Ecosystem Integration
187187

188-
+ Fixed concurrency issue in Argo KCL plugin causing Sync errors.
189-
+ Releasing Flux KCL Controller [https://github.com/kcl-lang/flux-kcl-controller](https://github.com/kcl-lang/flux-kcl-controller), currently supporting GitOps with OCI and Git configurations.
190-
+ KCL officially integrated into Crossplane Functions Marketplace, releasing v0.9.0 [https://github.com/crossplane-contrib/function-kcl](https://github.com/crossplane-contrib/function-kcl).
188+
- Fixed concurrency issue in Argo KCL plugin causing Sync errors.
189+
- Releasing Flux KCL Controller [https://github.com/kcl-lang/flux-kcl-controller](https://github.com/kcl-lang/flux-kcl-controller), currently supporting GitOps with OCI and Git configurations.
190+
- KCL officially integrated into Crossplane Functions Marketplace, releasing v0.9.0 [https://github.com/crossplane-contrib/function-kcl](https://github.com/crossplane-contrib/function-kcl).
191191

192192
```yaml
193193
apiVersion: apiextensions.crossplane.io/v1
@@ -231,18 +231,18 @@ spec:
231231
232232
Additionally, you can find more real use cases of KCL with other ecosystem projects here:
233233
234-
+ [https://github.com/mindwm/mindwm-gitops](https://github.com/mindwm/mindwm-gitops)
235-
+ [https://github.com/vfarcic/crossplane-kubernetes](https://github.com/vfarcic/crossplane-kubernetes)
236-
+ [https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml](https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml)
237-
+ [https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml](https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml)
234+
- [https://github.com/mindwm/mindwm-gitops](https://github.com/mindwm/mindwm-gitops)
235+
- [https://github.com/vfarcic/crossplane-kubernetes](https://github.com/vfarcic/crossplane-kubernetes)
236+
- [https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml](https://github.com/giantswarm/crossplane-gs-apis/blob/main/crossplane.giantswarm.io/xnetworks/package/compositions/peered-vpc-network.yaml)
237+
- [https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml](https://github.com/upbound/configuration-aws-eks/blob/main/apis/composition-kcl.yaml)
238238
239239
### 🧩 Multi-Language SDKs and Plugins
240240
241241
#### Multi-Language SDKs
242242
243243
The number of KCL multi-language SDKs has increased to **7**, currently supporting Rust, Go, Java, .NET, Python, Node.js, and WASM. These can be used without installing additional KCL command-line tools, optimizing the installation size to **90%** of previous versions and removing the need for complex system dependencies. Furthermore, each SDK provides the same APIs for code execution, code analysis, type parsing, and adding external dependencies. Here are some examples with the Java and C# SDKs:
244244
245-
+ Java
245+
- Java
246246
247247
```java
248248
import com.kcl.api.API;
@@ -259,7 +259,7 @@ public class ExecProgramTest {
259259
}
260260
```
261261

262-
+ C#
262+
- C#
263263

264264
```csharp
265265
namespace KclLib.Tests;
@@ -336,7 +336,7 @@ For more examples of using other multi-language plugins, see [https://www.kcl-la
336336

337337
Additionally, you can find more real use cases of KCL multi-language plugins here:
338338

339-
+ [https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go](https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go)
339+
- [https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go](https://github.com/cakehappens/kcfoil/blob/main/cmd/kcf/template.go)
340340

341341
## 🌐 Other Resources
342342

Diff for: docs/tools/cli/package-management/command-reference/1.init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Examples:
5656
kcl mod init <command> [arguments]...
5757
# Init one kcl module with the current folder name
5858
kcl mod init
59-
59+
6060
# Init one kcl module with the name
6161
kcl mod init package-name
6262

Diff for: docs/tools/cli/package-management/command-reference/11.update.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Usage:
4545
Examples:
4646
# Update the current module
4747
kcl mod update
48-
48+
4949
# Update the module with the specified path
5050
kcl mod update path/to/package
5151

Diff for: docs/tools/cli/package-management/command-reference/3.pkg.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Usage:
4343
Examples:
4444
# Package the current module
4545
kcl mod pkg
46-
46+
4747
# Package the current module in the vendor mode
4848
kcl mod pkg --vendor
4949

Diff for: docs/tools/cli/package-management/command-reference/4.metadata.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Usage:
5151
Examples:
5252
# Output the resolved dependencies the current module
5353
kcl mod metadata
54-
54+
5555
# Output the resolved dependencies the current module in the vendor mode
5656
kcl mod metadata --vendor
5757

Diff for: docs/tools/cli/package-management/command-reference/8.push.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Usage:
5656
Examples:
5757
# Push the current module to the registry
5858
kcl mod push
59-
59+
6060
# Push the current module to the registry in the vendor mode
6161
kcl mod push --vendor
6262

Diff for: docs/user_docs/getting-started/kcl-quick-start.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,25 @@ kcl server.k
7575
title: KCL Example
7676
owner:
7777
name: The KCL Authors
78-
data: '2020-01-02T03:04:05'
78+
data: "2020-01-02T03:04:05"
7979
database:
8080
enabled: true
8181
ports:
82-
- 8000
83-
- 8001
84-
- 8002
82+
- 8000
83+
- 8001
84+
- 8002
8585
data:
86-
- - delta
87-
- phi
88-
- - 3.14
86+
- - delta
87+
- phi
88+
- - 3.14
8989
temp_targets:
9090
cpu: 79.5
9191
case: 72.0
9292
servers:
93-
- ip: 10.0.0.1
94-
role: frontend
95-
- ip: 10.0.0.2
96-
role: backend
93+
- ip: 10.0.0.1
94+
role: frontend
95+
- ip: 10.0.0.2
96+
role: backend
9797
```
9898

9999
## 3. Define the structure of the configuration using KCL schema

0 commit comments

Comments
 (0)