Skip to content

Commit 0f38211

Browse files
committed
chore: bump package to module concept
Signed-off-by: peefy <[email protected]>
1 parent f47e864 commit 0f38211

File tree

2 files changed

+51
-51
lines changed

2 files changed

+51
-51
lines changed

README-zh.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<h1 align="center">KCL 集成 ArtifactHub</h1>
1+
<h1 align="center">KCL Modules</h1>
22

33
<p align="center">
44
<a href="./README.md">English</a> | <a href="./README-zh.md">简体中文</a>
55

6-
这个仓库负责保存已经发布的 KCL package,并且您可以在 [artifacthub.io (AH)](https://artifacthub.io/) 上找到这些包。
6+
这个仓库负责保存已经发布的 KCL 模块,并且您可以在 [artifacthub.io (AH)](https://artifacthub.io/) 上找到这些包。
77

88
## 快速开始
99

@@ -13,20 +13,20 @@
1313

1414
- 安装 [kpm](https://kcl-lang.io/zh-CN/docs/user_docs/guides/package-management/installation/)
1515
- 安装 [git](https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git)
16-
- [注册一个 Github 账户(可选,您需要有一个github的账户)](https://docs.github.com/zh/get-started/signing-up-for-github/signing-up-for-a-new-github-account)
16+
- [注册一个 Github 账户(可选)](https://docs.github.com/zh/get-started/signing-up-for-github/signing-up-for-a-new-github-account)
1717

1818
### 代码仓库
1919

20-
注意:如果您希望将您的 KCL 包发布到 kcl-lang 官方的 Registry 中,那么您的 KCL 包的源代码将以开源的形式保存在当前仓库中,您需要将您的包的源代码通过 PR 提交到这个仓库中。
20+
注意:如果您希望将您的 KCL 包发布到 `kcl-lang` 官方的 Registry 中,那么您的 KCL 包的源代码将以开源的形式保存在当前仓库中,您需要将您的包的源代码通过 PR 提交到这个仓库中。
2121

2222
### 准备您的 KCL 包
2323

24-
通过 `kpm init <package_name>` 命令, 您可以创建一个合法的 KCL 程序包
24+
通过 `kpm init <module_name>` 命令, 您可以创建一个合法的 KCL 程序模块
2525

2626
目前,仓库能够识别的合法的程序的目录结构如下:
2727

2828
```
29-
<package_name>
29+
<module_name>
3030
|- kcl.mod (必选的)
3131
|- kcl.mod.lock (可选的)
3232
|- artifacthub-pkg.yaml (可选的)
@@ -52,7 +52,7 @@ git clone https://github.com/kcl-lang/artifacthub --depth=1
5252

5353
#### 2. 为您的包创建一个分支
5454

55-
我们推荐您的分支名为:publish-pkg-<pkg_name>, <pkg_name> 为您包的名称。
55+
我们推荐您的分支名为:publish-pkg-<module_name>, <module_name> 为您包的名称。
5656

5757
以包 helloworld 为例
5858

@@ -76,7 +76,7 @@ kpm init helloworld
7676
您可以为 helloworld 包增加一个 README.md 文件保存在包的根目录下,用来展示在 AH 的首页中。
7777
```
7878
echo "## Introduction" >> helloworld/README.md
79-
echo "This is a kcl package named helloworld." >> helloworld/README.md
79+
echo "This is a kcl module named helloworld." >> helloworld/README.md
8080
```
8181

8282
#### 4. 提交您的包
@@ -89,32 +89,32 @@ echo "This is a kcl package named helloworld." >> helloworld/README.md
8989
git add .
9090
```
9191

92-
使用 `git commit -s` 命令提交您的包, 我们推荐您的 commit message 遵循 “publish package <pkg_name>” 的格式。
92+
使用 `git commit -s` 命令提交您的包, 我们推荐您的 commit message 遵循 “publish module <module_name>” 的格式。
9393
```
94-
git commit -m"publish package helloworld" -s
94+
git commit -m "publish module helloworld" -s
9595
```
9696

97-
使用 `git push` 命令将您的包提交到您的分支 publish-pkg-<pkg_name> 中
97+
使用 `git push` 命令将您的包提交到您的分支 publish-pkg-<module_name> 中
9898
```
9999
git push
100100
```
101101

102102
#### 5. 提交 PR
103103

104-
将您的分支 publish-pkg-<pkg_name> 向仓库的 main 分支提交 PR。
104+
将您的分支 publish-pkg-<module_name> 向仓库的 main 分支提交 PR。
105105

106106
- [如何创建 PR](https://docs.github.com/zh/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
107107

108108
### 通过 PR 升级您的包
109109
完成包的内容上传后,您可以通过 PR 升级您的包。
110110

111-
注意:**我们没有提供任何改变包的内容但是不改变版本号的升级策略。** 如果您想要升级您的包,并希望您升级后的包被展示在 AH 上,您需要修改您的包的版本号。即在 kcl.mod 文件的 package 章节中的 version 字段。
111+
注意:**我们没有提供任何改变包的内容但是不改变版本号的升级策略。** 如果您想要升级您的包,并希望您升级后的包被展示在 AH 上,您需要修改您的包的版本号。即在 kcl.mod 文件的 module 章节中的 version 字段。
112112
```
113113
[package]
114-
name = "my_package"
114+
name = "my_module"
115115
edition = "*"
116116
version = "0.1.0" # 改变这个字段来升级您的包
117-
description = "This is my package."
117+
description = "This is my module."
118118
```
119119

120120
同样,**您无法多次上传同一个版本号的 KCL 包**,一旦您的包的版本号已经被使用,您将无法再次使用这个版本号,再次上传这个包的方式就只有升级版本号。

README.md

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
<h1 align="center">KCL Integrations ArtifactHub</h1>
1+
<h1 align="center">KCL Modules</h1>
22

33
<p align="center">
44
<a href="./README.md">English</a> | <a href="./README-zh.md">简体中文</a>
55

6-
This repository is responsible for saving the published KCL packages, and you can find these packages on [artifacthub.io (AH)](https://artifacthub.io/).
6+
This repository is responsible for saving the published KCL modules, and you can find these modules on [artifacthub.io (AH)](https://artifacthub.io/).
77

88
## Quick Start
99

10-
In the next section, we will show you how to publish your package with a `helloworld` example.
10+
In the next section, we will show you how to publish your module with a `helloworld` example.
1111

1212
### Prerequisites
1313

1414
- Install [kpm](https://kcl-lang.io/docs/user_docs/guides/package-management/installation/)
1515
- Install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
16-
- [Register a Github account (optional, you need a github account)](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account)
16+
- [Register a GitHub account (optional)](https://docs.github.com/en/get-started/signing-up-for-github/signing-up-for-a-new-github-account)
1717

1818
### Code Repository
1919

20-
NOTE: If you want to publish your KCL package to the kcl-lang official registry, then the source code of your KCL package will be saved in this repo, you need to submit the source code of your package to this repository via PR.
20+
NOTE: If you want to publish your KCL module to the `kcl-lang` official registry, then the source code of your KCL module will be saved in this repo, you need to submit the source code of your module to this repository via PR.
2121

22-
### Prepare your KCL package
22+
### Prepare your KCL Module
2323

24-
By the `kpm init <package_name>` command, you can create a valid KCL package.
24+
By the `kpm init <module_name>` command, you can create a valid KCL module.
2525

26-
Currently, the directory structure of a valid kcl package that the repository can recognize is as follows:
26+
Currently, the directory structure of a valid KCL module that the repository can recognize is as follows:
2727

28-
```
29-
<package_name>
28+
```text
29+
<module_name>
3030
|- kcl.mod (required)
3131
|- kcl.mod.lock (optional)
3232
|- artifacthub-pkg.yaml (optional)
3333
|- README.md (optional)
3434
|- (*.k) kcl program files
3535
```
3636

37-
- kcl.mod : As the identification file of the KCL package, this file is **required**, and the directory containing the kcl.mod file will be identified as the root directory of the file.
37+
- kcl.mod : As the identification file of the KCL module, this file is **required**, and the directory containing the kcl.mod file will be identified as the root directory of the file.
3838

3939
- kcl.mod.lock : Automatically generated file to fix dependency versions, this file is **optional** and does not need to be manually modified.
4040

41-
- artifacthub-pkg.yaml : This file is **optional**, because our repository currently displays all packages through artifacthub.io, you can configure the information you want to show through artifacthub-pkg.yaml. Our strategy is that **if there is a configuration file named artifacthub-pkg.yaml in the directory where your package's kcl.mod file is located, then we will use the artifacthub-pkg.yaml you provided to display the information of your package, otherwise, we will use some default information to generate the corresponding artifacthub-pkg.yaml file.**
41+
- artifacthub-pkg.yaml : This file is **optional**, because our repository currently displays all modules through artifacthub.io, you can configure the information you want to show through artifacthub-pkg.yaml. Our strategy is that **if there is a configuration file named artifacthub-pkg.yaml in the directory where your module's kcl.mod file is located, then we will use the artifacthub-pkg.yaml you provided to display the information of your module, otherwise, we will use some default information to generate the corresponding artifacthub-pkg.yaml file.**
4242

43-
- README.md : A markdown file as the documentation for your package, this file is **optional**, **if you do not provide this file, it will not be displayed on artifacthub.io**.
43+
- README.md : A markdown file as the documentation for your module, this file is **optional**, **if you do not provide this file, it will not be displayed on artifacthub.io**.
4444

4545
- (*.k) kcl program files: The source code of your KCL program.
4646

47-
### Publish your package by PR
47+
### Publish your module by PR
4848

4949
#### 1. Clone the code repository
5050

@@ -54,76 +54,76 @@ First, you need to clone the repository
5454
git clone https://github.com/kcl-lang/artifacthub --depth=1
5555
```
5656

57-
#### 2. Create a branch for your package
57+
#### 2. Create a branch for your module
5858

59-
We recommend that your branch name be: `publish-pkg-<pkg_name>`, `<pkg_name>` is the name of your package.
59+
We recommend that your branch name be: `publish-pkg-<module_name>`, `<module_name>` is the name of your module.
6060

61-
Take the package `helloworld` as an example
61+
Take the module `helloworld` as an example
6262

6363
Enter the artifacthub directory you downloaded
6464
```
6565
cd artifacthub
6666
```
6767

68-
Create a branch `publish-pkg-helloworld` for the package `helloworld`
68+
Create a branch `publish-pkg-helloworld` for the module `helloworld`
6969
```
7070
git checkout -b publish-pkg-helloworld
7171
```
7272

73-
#### 3. Add your KCL package
73+
#### 3. Add your KCL module
7474

75-
You need to move your package to the current directory. In our example, we use the `kpm init` command to create the package `helloworld`
75+
You need to move your module to the current directory. In our example, we use the `kpm init` command to create the module `helloworld`
7676

7777
```
7878
kpm init helloworld
7979
```
8080

81-
You can add a `README.md` file to the root directory of the package to display on the homepage of AH.
81+
You can add a `README.md` file to the root directory of the module to display on the homepage of AH.
8282
```
8383
echo "## Introduction" >> helloworld/README.md
84-
echo "This is a kcl package named helloworld." >> helloworld/README.md
84+
echo "This is a kcl module named helloworld." >> helloworld/README.md
8585
```
8686

87-
#### 4. Commit your package
87+
#### 4. Commit your module
8888

89-
You can use the following command to commit your package
89+
You can use the following command to commit your module
9090

91-
Use `git add .` command to add your package to the staging area of git
91+
Use `git add .` command to add your module to the staging area of git
9292

9393
```
9494
git add .
9595
```
9696

97-
Use `git commit -s` command to commit your package, we recommend that your commit message follow the format "publish package <pkg_name>".
97+
Use `git commit -s` command to commit your module, we recommend that your commit message follow the format "publish module <module_name>".
9898
```
99-
git commit -m"publish package helloworld" -s
99+
git commit -m "publish module helloworld" -s
100100
```
101101

102-
Use `git push` command to submit your package to your branch `publish-pkg-<pkg_name>`
102+
Use `git push` command to submit your module to your branch `publish-pkg-<module_name>`
103103

104104
```
105105
git push
106106
```
107107

108108
#### 5. Submit a PR
109109

110-
Finally, you need to submit a PR to the main branch of the repository with your branch `publish-pkg-<pkg_name>`.
110+
Finally, you need to submit a PR to the main branch of the repository with your branch `publish-pkg-<module_name>`.
111111

112112
- [How to create PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
113113

114-
### Upgrade your package by PR
114+
### Upgrade your module by PR
115115

116-
After completing the upload of the package content, you can upgrade your package by PR.
116+
After completing the upload of the module content, you can upgrade your module by PR.
117117

118-
NOTE: **We do not provide any upgrade strategy that changes the content of the package but does not change the version number.** If you want to upgrade your package and want your upgraded package to be displayed on AH, you need to modify the version number of your package. That is, the version field in the package section of the kcl.mod file.
118+
NOTE: **We do not provide any upgrade strategy that changes the content of the module but does not change the version number.** If you want to upgrade your module and want your upgraded module to be displayed on AH, you need to modify the version number of your module. That is, the version field in the module section of the kcl.mod file.
119119

120120
```
121121
[package]
122-
name = "my_package"
122+
name = "my_module"
123123
edition = "*"
124-
version = "0.1.0" # change this field to upgrade your package
125-
description = "This is my package."
124+
version = "0.1.0" # change this field to upgrade your module
125+
description = "This is my module."
126126
```
127127

128-
**At the same time, you cannot upload the same version package multiple times.** Once the version number of your package has been used, you will not be able to use this version number again. The only way to upload this package again is to upgrade the version number.
128+
**At the same time, you cannot upload the same version module multiple times.** Once the version number of your module has been used, you will not be able to use this version number again. The only way to upload this module again is to upgrade the version number.
129129

0 commit comments

Comments
 (0)