examples/

directory
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MPL-2.0

README

Examples

This directory contains runnable .gwdk examples for the current compiler and runtime surface. Use it as inventory; use the cookbook for task-oriented recipes.

Run commands from the repository root unless an example says to cd into its own directory. The root gowdk.config.go is part of the example smoke setup and is required by project-level compiler commands.

Start Here

Goal Example Command
Static page and component examples/pages/ go run ./cmd/gowdk build --out /tmp/gowdk-build examples/pages/home.page.gwdk examples/pages/hero.cmp.gwdk
Dynamic SPA route examples/pages/blog-post.page.gwdk go run ./cmd/gowdk build --out /tmp/gowdk-dynamic-build examples/pages/blog-post.page.gwdk
Build-time Go data examples/go-interop/ go run ./cmd/gowdk build --out /tmp/gowdk-go-interop examples/go-interop/imported-build.page.gwdk
Actions, APIs, fragments examples/endpoints/ cd examples/endpoints && make check && make routes && make build
SSR and guards examples/auth-guard/ cd examples/auth-guard && make check && make routes && make build
One generated binary examples/embed/ go run ./cmd/gowdk build --out /tmp/gowdk-embed-build --app /tmp/gowdk-embed-app --bin /tmp/gowdk-embed-site examples/embed/site.page.gwdk
Contracts and realtime examples/contracts/ go run ./cmd/gowdk build --config examples/contracts/gowdk.config.go --out /tmp/gowdk-contracts-build --app /tmp/gowdk-contracts-app --bin /tmp/gowdk-contracts-site examples/contracts/patients.page.gwdk
CSS examples/css/ go run ./cmd/gowdk build --config examples/css/gowdk.config.go --out /tmp/gowdk-css-build examples/css/styled.page.gwdk
Tailwind examples/tailwind/ go run ./cmd/gowdk build --config examples/tailwind/gowdk.config.go --out /tmp/gowdk-tailwind-build examples/tailwind/site.page.gwdk
SEO examples/seo/ go run ./cmd/gowdk build --config examples/seo/gowdk.config.go --out /tmp/gowdk-seo-build examples/seo/*.gwdk
Component assets and WASM islands examples/components/ go run ./cmd/gowdk build --out /tmp/gowdk-wasm-island examples/components/wasm/*.gwdk
Full-stack vertical slice examples/flagship/ cd examples/flagship && make check && make routes && make build

The Tailwind build command requires the standalone tailwindcss executable on PATH. To validate the source without running the CSS processor:

go run ./cmd/gowdk check --config examples/tailwind/gowdk.config.go examples/tailwind/site.page.gwdk

Full Example Check

Validate the broad source set with SSR enabled:

go run ./cmd/gowdk check --ssr examples/pages/*.gwdk examples/marketing/*.gwdk examples/actions/*.gwdk examples/partials/*.gwdk examples/api/*.gwdk examples/ssr/*.gwdk examples/go-interop/*.gwdk examples/components/base/*.gwdk examples/components/css/*.gwdk examples/components/assets/*.gwdk examples/components/wasm/*.gwdk examples/store-persist/*.gwdk examples/embed/*.gwdk examples/seo/*.gwdk examples/css/*.gwdk examples/tailwind/*.gwdk examples/contracts/*.gwdk examples/security/*.gwdk

Focused directories such as examples/endpoints, examples/auth-guard, and examples/flagship include Makefile targets that run the local checks used by CI.

Documentation Map

Need Source
Recipes Native Cookbook
Learning path Native Learning Path
Commands and config Reference Index
Language syntax Language Index
Generated output Compiler Index
Current capability status Product Requirements

When an example changes, update its command here, the cookbook recipe if one exists, and the contract doc that owns the behavior.

Directories

Path Synopsis
components
store-persist
ui
Package ui holds the user-owned Go state for the store-persistence example.
Package ui holds the user-owned Go state for the store-persistence example.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL