commit 967b77c51c6b3bdb3148275b54965d9aba183530 Author: grngxd <36968271+grngxd@users.noreply.github.com> Date: Mon Jun 16 22:58:47 2025 +0100 init tiramisu diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..d7ff5c6 --- /dev/null +++ b/.air.toml @@ -0,0 +1,52 @@ +root = "." +testdata_dir = "testdata" +tmp_dir = "tmp" + +[build] + args_bin = [] + bin = "tmp\\main.exe" + cmd = "go build -o ./tmp/main.exe ./example" + delay = 1000 + exclude_dir = ["assets", "tmp", "vendor", "testdata", "runtime/out", "node_modules", "dist"] + exclude_file = [] + exclude_regex = ["_test.go", "out"] + exclude_unchanged = true + follow_symlink = false + full_bin = "" + include_dir = [] + include_ext = ["go", "tpl", "tmpl", "html", "js", "ts"] + include_file = [] + kill_delay = "0s" + log = "build-errors.log" + poll = false + poll_interval = 0 + post_cmd = [] + pre_cmd = ["bunx tsc -p ./runtime"] + rerun = false + rerun_delay = 500 + send_interrupt = false + stop_on_error = false + +[color] + app = "" + build = "yellow" + main = "magenta" + runner = "green" + watcher = "cyan" + +[log] + main_only = false + silent = false + time = false + +[misc] + clean_on_exit = false + +[proxy] + app_port = 0 + enabled = false + proxy_port = 0 + +[screen] + clear_on_rebuild = false + keep_scroll = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72c806f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +tmp/ +out/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2634e6 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# 🍥 tiramisu +> ` is tiramisu a cake or a pie?` + +Build modern, cross-platform desktop apps in HTML + Go from one codebase. \ No newline at end of file diff --git a/example/main.go b/example/main.go new file mode 100644 index 0000000..9177b22 --- /dev/null +++ b/example/main.go @@ -0,0 +1,49 @@ +package main + +import ( + "fmt" + + t "github.com/grngxd/tiramisu" + webview "github.com/webview/webview_go" +) + +func main() { + app := t.New(t.TiramisuOptions{ + Debug: true, + Width: 1200, + Height: 800, + Title: "Tiramisu Example", + Hints: webview.HintFixed, + }) + + app.Run(func() { + app.Bind("hello", func(args ...any) (any, error) { + if len(args) == 0 { + return "Hello, World!", nil + } + if len(args) == 1 { + return fmt.Sprintf("Hello, %s!", args[0]), nil + } + return "Hello, unknown!", nil + }) + + app.HTML(` + + +
+Click the button to see a greeting:
+ + + + + + `) + }) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..dbfc40b --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/grngxd/tiramisu + +go 1.23.4 + +require github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..2421e19 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6 h1:VQpB2SpK88C6B5lPHTuSZKb2Qee1QWwiFlC5CKY4AW0= +github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6/go.mod h1:yE65LFCeWf4kyWD5re+h4XNvOHJEXOCOuJZ4v8l5sgk= diff --git a/runtime/index.d.ts b/runtime/index.d.ts new file mode 100644 index 0000000..afb0fc3 --- /dev/null +++ b/runtime/index.d.ts @@ -0,0 +1,11 @@ +declare global { + interface Window { + invoke: (name: string, ...args: any[]) => Promise