From e54c74546bd5cbb585d80147eb45c5d897911365 Mon Sep 17 00:00:00 2001 From: zongzhe Date: Sat, 12 Oct 2024 10:34:37 +0800 Subject: [PATCH 1/2] feat: add schema and schema instance to package helloworld Signed-off-by: zongzhe --- helloworld/{ => 0.1.2}/kcl.mod | 0 helloworld/{ => 0.1.2}/kcl.mod.lock | 0 helloworld/{ => 0.1.2}/main.k | 0 helloworld/0.1.3/kcl.mod | 6 ++++++ helloworld/0.1.3/kcl.mod.lock | 0 helloworld/0.1.3/main.k | 8 ++++++++ 6 files changed, 14 insertions(+) rename helloworld/{ => 0.1.2}/kcl.mod (100%) rename helloworld/{ => 0.1.2}/kcl.mod.lock (100%) rename helloworld/{ => 0.1.2}/main.k (100%) create mode 100644 helloworld/0.1.3/kcl.mod create mode 100644 helloworld/0.1.3/kcl.mod.lock create mode 100644 helloworld/0.1.3/main.k diff --git a/helloworld/kcl.mod b/helloworld/0.1.2/kcl.mod similarity index 100% rename from helloworld/kcl.mod rename to helloworld/0.1.2/kcl.mod diff --git a/helloworld/kcl.mod.lock b/helloworld/0.1.2/kcl.mod.lock similarity index 100% rename from helloworld/kcl.mod.lock rename to helloworld/0.1.2/kcl.mod.lock diff --git a/helloworld/main.k b/helloworld/0.1.2/main.k similarity index 100% rename from helloworld/main.k rename to helloworld/0.1.2/main.k diff --git a/helloworld/0.1.3/kcl.mod b/helloworld/0.1.3/kcl.mod new file mode 100644 index 00000000..d114b362 --- /dev/null +++ b/helloworld/0.1.3/kcl.mod @@ -0,0 +1,6 @@ +[package] +name = "helloworld" +edition = "*" +version = "0.1.3" +description = "This is a hello world package that contains a schema and a schema instance" + diff --git a/helloworld/0.1.3/kcl.mod.lock b/helloworld/0.1.3/kcl.mod.lock new file mode 100644 index 00000000..e69de29b diff --git a/helloworld/0.1.3/main.k b/helloworld/0.1.3/main.k new file mode 100644 index 00000000..2ab43baf --- /dev/null +++ b/helloworld/0.1.3/main.k @@ -0,0 +1,8 @@ +schema HelloWorldSchema: + msg: str + +The_fisrt_schema_inst = HelloWorldSchema{ + msg: "Hello Schema!" +} + +The_first_kcl_program = 'Hello World!' \ No newline at end of file From 13eca5a72288814157c3a80710d5866120906832 Mon Sep 17 00:00:00 2001 From: zongzhe Date: Sat, 12 Oct 2024 10:42:04 +0800 Subject: [PATCH 2/2] fix: fix ci Signed-off-by: zongzhe --- main_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main_test.go b/main_test.go index 77bbc319..ab14d1b9 100644 --- a/main_test.go +++ b/main_test.go @@ -14,7 +14,7 @@ import ( func TestUpdateReadmeAndMetadata(t *testing.T) { pwd, err := os.Getwd() assert.Equal(t, nil, err) - testDir := filepath.Join(pwd, "helloworld") + testDir := filepath.Join(pwd, "helloworld", "0.1.2") modPath := filepath.Join(testDir, "kcl.mod") ahPath := filepath.Join(".integration", "artifacthub", "helloworld", "0.1.2", "artifacthub-pkg.yaml")