From a8c37e78a413c1a3fbbbed7fd565d4abe6587b6a Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 24 Jul 2024 17:04:25 +0800 Subject: [PATCH 1/2] Refactor page test to check for minimum number of pages and children --- sui/storages/local/page_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sui/storages/local/page_test.go b/sui/storages/local/page_test.go index cd6a7d21..62badeed 100644 --- a/sui/storages/local/page_test.go +++ b/sui/storages/local/page_test.go @@ -60,7 +60,7 @@ func TestTemplatePageTree(t *testing.T) { t.Fatalf("Pages error: %v", err) } - if len(pages) < 2 { + if len(pages) < 4 { t.Fatalf("Pages error: %v", len(pages)) } @@ -70,8 +70,8 @@ func TestTemplatePageTree(t *testing.T) { t.Fatalf("Pages error: %v", len(pages[1].Children)) } - assert.NotEmpty(t, pages[2].Children[0].Children) - if len(pages[2].Children[0].Children) < 2 { + assert.NotEmpty(t, pages[3].Children[0].Children) + if len(pages[3].Children[0].Children) < 2 { t.Fatalf("Pages error: %v", len(pages[2].Children[0].Children)) } } From 8d375e2222c508a9fda96b3d79f593cd885ea44c Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 24 Jul 2024 19:23:46 +0800 Subject: [PATCH 2/2] chore: Refactor SUI core to use lazy loading for the SUI library --- sui/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sui/README.md diff --git a/sui/README.md b/sui/README.md new file mode 100644 index 00000000..2a682b1e --- /dev/null +++ b/sui/README.md @@ -0,0 +1,29 @@ +# SUI + +SUI is a full-stack web development tool that allows you to create web applications using HTML, CSS, and Typescript/JavaScript. + +It is designed to be simple and easy to use. If you are familiar with HTML, CSS, and Typescript/JavaScript, you can start using SUI right away. + +No dependencies required, no build tools required, no complex frameworks required, just write your HTML, CSS, and TS/JS code, and you are good to go. + +## Demo Application + +[https://github.com/YaoApp/yao-startup-webapp](https://github.com/YaoApp/yao-startup-webapp) + +## Commands + +- `yao sui watch` - Watch for changes in the templates directory and compile them into a single SUI file. +- `yao sui build` - Compile the templates into a single SUI file. +- `yao sui trans` - Generate the i18n translation files, and compile the templates. you can specify the translator automatically translate the text with `trans` attribute. + +## Usage + +Comming soon... + +## About SUI + +SUI is a part of the Yao project, which is a collection of tools for web development. + +SUI name comes from the chinese word "随" which means "follow" or "accompany", it's one of the sixteenth hexagrams of the I Ching, and you can think of SUI as a tool that follows you in your web development journey. + +SUI name also comes from the word "SUI" which means "simple user interface", and you can think of SUI as a tool that makes it easy to create web applications.