Documentation
¶
Overview ¶
Package devserver manages .dev/server, the Umono project that umono theme dev runs a theme project with.
Index ¶
Constants ¶
const ( Username = "admin" Password = "admin" )
Username and Password are the account of .dev/server.
Variables ¶
var ErrCLIOutdated = errors.New("the CLI is outdated")
ErrCLIOutdated is returned when no theme the CLI builds works with the runtime of .dev/server.
Functions ¶
func CheckThemeAPI ¶
CheckThemeAPI compares the Theme API range in the umono.json of .dev/server with the CLI's themecore. The same range returns nothing. A runtime whose theme_api_min is above the CLI's ThemeAPICurrent runs no theme the CLI builds: ErrCLIOutdated. Any other difference is a warning.
func Ensure ¶
Ensure sets .dev/server up when it has no umono.json: an empty Umono project of the latest release of client, with the account admin/admin. It is set up in a temporary directory next to it and renamed into place, so a failed setup leaves nothing. A .dev/server without a valid umono.json is not touched: it may hold the theme author's umono.db. It reports whether it set the server up.
Types ¶
type Server ¶
type Server struct {
// URL is where it listens, http://127.0.0.1:{port}.
URL string
// contains filtered or unexported fields
}
Server is a running .dev/server.
func Start ¶
Start starts the binary of .dev/server in its directory on a free port, which the CLI picks on every start, with UMONO_THEME_DEV set to the absolute path of projectDir: Umono opens its dev mode only with it. The server's output goes to .dev/server/umono.log. Start returns when the server listens. A server that exits before shows the end of its log.