Documentation
¶
Index ¶
Constants ¶
const ( LIB_PATH = "static/gen/lib" ESM_PATH = "static/gen/esm" )
const ( // TODO: allow custom config file to be specified TAILWIND_CONFIG_FILE = "tailwind.config.js" TAILWIND_CONFIG_CONTENTS = ` module.exports = { content: [%s], theme: { extend: {}, }, plugins: [ %s ], %s }` TAILWIND_INPUT_CONTENTS = ` @tailwind base; @tailwind components; @tailwind utilities; ` )
const (
STYLE_FILE_PATH = "static/gen/css/style.css"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppDev ¶
type AppDev struct { *utils.Logger CustomLayout bool Config *util.AppConfig AppStyle *AppStyle JsLibs []JSLibrary // contains filtered or unexported fields }
AppDev is the main object that represents a Clace app in dev mode. It is created when the app is loaded with is_dev true and handles the styling and js library related functionalities. Access to this is synced through the initMutex in App. The reload method in App is the main access point to this object
func (*AppDev) GenerateHTML ¶
GenerateHTML generates the default HTML template files for the app.
func (*AppDev) SaveConfigLockFile ¶
func (*AppDev) SetupJsLibs ¶
SetupJsLibs sets up the js libraries for the app.
type AppStyle ¶
type AppStyle struct { DisableWatcher bool // contains filtered or unexported fields }
AppStyle is the style related configuration and state for an app. It is created when the App is loaded. It keeps track of the watcher process required to rebuild the CSS file when the tailwind/daisy config changes. The reload mutex lock in App is used to ensure only one call to the watcher is done at a time, no locking is implemented in AppStyle
func (*AppStyle) Setup ¶
Setup sets up the style library for the app. This is called when the app is reloaded.
func (*AppStyle) StartWatcher ¶
StartWatcher starts the watcher process for the app. This is called when the app is reloaded.
func (*AppStyle) StopWatcher ¶
type JSLibrary ¶
type JSLibrary struct {
// contains filtered or unexported fields
}
JSLibrary handles the downloading for JS libraries and esbuild based bundling for ESM libraries
func NewLibrary ¶
func NewLibraryESM ¶
type LibraryType ¶
type LibraryType string
const ( ESModule LibraryType = "ecmascript_module" Library LibraryType = "library" )
type WatcherState ¶
type WatcherState struct {
// contains filtered or unexported fields
}
WatcherState is the state of the watcher process as of when it was last started.