Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidContractRef = errors.New("invalid contract reference") ErrContractNotPublished = errors.New("contract is not published on umono.dev") ErrRegistryUnreachable = errors.New("umono.dev is unreachable") )
var DefaultRegistry = Registry{BaseURL: "https://umono.dev", Client: &http.Client{Timeout: 30 * time.Second}}
DefaultRegistry is umono.dev, the only registry in v0.9.
var ErrExists = errors.New("already exists")
ErrExists is returned when a file or a directory already has the name of the project. Nothing is overwritten.
var ErrNotThemeProject = errors.New("not a theme project: theme.toml is missing")
ErrNotThemeProject is returned when the directory has no theme.toml.
Functions ¶
func Create ¶
Create validates m and creates the theme project dir with the boilerplate files: theme.toml, assets/theme.css and .gitignore. Once dir is made, an error removes it, so a failed run leaves nothing behind.
func EnsureContract ¶
EnsureContract returns the cache path of ref in projectDir, .dev/contracts/{org}/{id}/v{major}.{minor}.toml. The file is fetched from r only when it is missing: contracts are immutable, so a cached file never changes.
Types ¶
type BuildResult ¶
type BuildResult struct {
// Path is the built file, dist/{org}_{id}_{version}.umono-theme.
Path string
Report themecore.BuildReport
// PreservedComment reports a comment starting with /*! in
// assets/theme.css. Comments do not go into the package; a note meant
// to stay belongs in LICENSE.
PreservedComment bool
}
BuildResult is the outcome of Build.
type Manifest ¶
type Manifest struct {
ID string
Name string
Contract string
Version string
Description string
License string
Homepage string
Repository string
AuthorName string
AuthorURL string
}
Manifest holds the answers of umono theme create. Empty optional fields are not written. AuthorName and AuthorURL make the single [[authors]] entry.