You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/).
7
7
8
8
## Quick Start
9
9
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.
-[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)
17
17
18
18
### Code Repository
19
19
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.
21
21
22
-
### Prepare your KCL package
22
+
### Prepare your KCL Module
23
23
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.
25
25
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:
27
27
28
-
```
29
-
<package_name>
28
+
```text
29
+
<module_name>
30
30
|- kcl.mod (required)
31
31
|- kcl.mod.lock (optional)
32
32
|- artifacthub-pkg.yaml (optional)
33
33
|- README.md (optional)
34
34
|- (*.k) kcl program files
35
35
```
36
36
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.
38
38
39
39
- kcl.mod.lock : Automatically generated file to fix dependency versions, this file is **optional** and does not need to be manually modified.
40
40
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.**
42
42
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**.
44
44
45
45
- (*.k) kcl program files: The source code of your KCL program.
46
46
47
-
### Publish your package by PR
47
+
### Publish your module by PR
48
48
49
49
#### 1. Clone the code repository
50
50
@@ -54,76 +54,76 @@ First, you need to clone the repository
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.
60
60
61
-
Take the package`helloworld` as an example
61
+
Take the module`helloworld` as an example
62
62
63
63
Enter the artifacthub directory you downloaded
64
64
```
65
65
cd artifacthub
66
66
```
67
67
68
-
Create a branch `publish-pkg-helloworld` for the package`helloworld`
68
+
Create a branch `publish-pkg-helloworld` for the module`helloworld`
69
69
```
70
70
git checkout -b publish-pkg-helloworld
71
71
```
72
72
73
-
#### 3. Add your KCL package
73
+
#### 3. Add your KCL module
74
74
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`
76
76
77
77
```
78
78
kpm init helloworld
79
79
```
80
80
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.
82
82
```
83
83
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
85
85
```
86
86
87
-
#### 4. Commit your package
87
+
#### 4. Commit your module
88
88
89
-
You can use the following command to commit your package
89
+
You can use the following command to commit your module
90
90
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
92
92
93
93
```
94
94
git add .
95
95
```
96
96
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>".
98
98
```
99
-
git commit -m"publish package helloworld" -s
99
+
git commit -m"publish module helloworld" -s
100
100
```
101
101
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>`
103
103
104
104
```
105
105
git push
106
106
```
107
107
108
108
#### 5. Submit a PR
109
109
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>`.
111
111
112
112
-[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)
113
113
114
-
### Upgrade your package by PR
114
+
### Upgrade your module by PR
115
115
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.
117
117
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.
119
119
120
120
```
121
121
[package]
122
-
name = "my_package"
122
+
name = "my_module"
123
123
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."
126
126
```
127
127
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.
0 commit comments