Documentation
¶
Overview ¶
Package config reads lidza.json, the per-project configuration.
Index ¶
Constants ¶
View Source
const FileName = "lidza.json"
FileName is the project configuration file, at the project root.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Name is the application name; also the output binary name.
Name string `json:"name"`
Frontend Frontend `json:"frontend"`
// Packs are the enabled packs under packs/, started in this order.
// `lidza pack scaffold` appends here; packs.go is generated from it.
Packs []string `json:"packs,omitempty"`
// SDK names extra generated clients: {"dart": "clients/dart"} writes
// the Dart package to that directory on every `lidza gen`.
SDK SDK `json:"sdk,omitempty"`
// Deploy is what `lidza ship` writes into deploy/production.env: the
// domains the binary serves over TLS and the ACME contact.
Deploy Deploy `json:"deploy,omitempty"`
// AppDir is the directory, relative to the project root, of the Go
// package that describes the app (routes.go, start.go, tools.go and
// the generated packs.go). Empty is the root's package main. Set, the
// package is importable, so the app's tests can live in their own
// directory (tests/) and main.go only runs it.
AppDir string `json:"appDir,omitempty"`
// Dir is the project root the file was read from. Not serialized.
Dir string `json:"-"`
}
Config is the parsed lidza.json.
func (Config) AppPackage ¶
AppPackage is the Go package name of the app's package: main at the root, else the last element of AppDir.
type Deploy ¶
type Deploy struct {
// Domains are LIDZA_TLS_DOMAINS: the first is the public name.
Domains []string `json:"domains,omitempty"`
// Email is LIDZA_TLS_EMAIL, the ACME account contact.
Email string `json:"email,omitempty"`
// Env are the app's production settings that are not secrets
// (MAIL_PROVIDER, LLM_MODEL, STORAGE_BUCKET): lidza ship writes them
// into deploy/production.env. Secrets stay in the credentials.
Env map[string]string `json:"env,omitempty"`
}
Deploy holds the deployment settings `lidza ship --domains` records.
type Frontend ¶
type Frontend struct {
// Template is the template name: react, svelte, astro or htmx.
Template string `json:"template"`
// Dev is the shell command that starts the frontend dev server. Empty
// for templates without one (htmx).
Dev string `json:"dev,omitempty"`
// URL is where the dev server listens; `lidza dev` proxies to it.
URL string `json:"url,omitempty"`
// Dist is the build output directory, relative to the project root,
// embedded into the production binary.
Dist string `json:"dist,omitempty"`
// Watch lists directories, relative to the project root, whose files
// `lidza dev` rebuilds on besides the Go sources: views and static
// files a Go-rendered frontend embeds.
Watch []string `json:"watch,omitempty"`
}
Frontend is the "frontend" block: which template the app uses and how the dev proxy reaches its dev server.
func (Frontend) HasDevServer ¶
HasDevServer reports whether the template runs a separate dev server that `lidza dev` must start and proxy to.
Click to show internal directories.
Click to hide internal directories.