Documentation ¶
Index ¶
- Variables
- func Build(opts *BuildOpts) (srcpack.PackedComponentList, error)
- func CachedEnvFromFile(path string) (srcpack.CachedEnvKeys, error)
- func New(ctx context.Context, opts *SessionOpts) (*devSession, error)
- type BuildOpts
- type ChangeRequestOpts
- type ComponentStaticContext
- type DevServer
- type FileStructure
- type PackageJSONTemplate
- type SessionOpts
- type StaticBuild
Constants ¶
This section is empty.
Variables ¶
var ErrCannotBuildAssetKeys = errors.New("cannot build asset keys")
var ErrFileTooRecentlyProcessed = errors.New("change not accepted, file too recently processed")
Functions ¶
func CachedEnvFromFile ¶
func CachedEnvFromFile(path string) (srcpack.CachedEnvKeys, error)
CachedEnvFromFile creates a new cached environment provided a file path for this method, we prefer using a single pass file reader over something like reflection due to the speed constraints of reflection
Types ¶
type ChangeRequestOpts ¶ added in v0.3.2
type ChangeRequestOpts struct { SafeFileTimeout time.Duration HotReload hotreload.HotReloader Hook *srcpack.SyncHook Parser jsparse.JSParser }
ChangeRequestOpts options used for processing a change request
type ComponentStaticContext ¶ added in v0.21.0
type ComponentStaticContext struct { StaticMap map[ewrap.PageRender]bool Pages map[ewrap.PageRender]*ewrap.DocumentRenderer BundlePaths map[ewrap.PageRender]string }
type DevServer ¶ added in v0.21.0
type DevServer struct {
// contains filtered or unexported fields
}
func NewDevServer ¶ added in v0.21.0
func (*DevServer) FileWatcherBundler ¶ added in v0.21.0
FileWatcherBundler watches for events given the file watcher and processes change requests as found
func (*DevServer) RedirectionBundler ¶ added in v0.21.0
func (s *DevServer) RedirectionBundler()
RedirectionBundler waits for a redirection event from the client and performs a re-bundle if needed.
type FileStructure ¶ added in v0.21.0
type FileStructure struct { PackageName string OutDir string Assets []fs.DirEntry Dist []fs.DirEntry Mkdirs []string }
FileStructureOpts reqired structure options for the file structure creation
func (*FileStructure) Cleanup ¶ added in v0.21.0
func (s *FileStructure) Cleanup() error
Cleanup removes all required file paths
func (*FileStructure) Make ¶ added in v0.21.0
func (s *FileStructure) Make() error
Make creates the foundation for orbits file structure
type PackageJSONTemplate ¶
type PackageJSONTemplate struct { Name string `json:"name"` Version string `json:"version"` Author string `json:"author"` License string `json:"license"` Description string `json:"description"` Dependencies map[string]string `json:"dependencies"` }
PackageJSONTemplate struct for nodejs package.json file.
func (*PackageJSONTemplate) Write ¶
func (p *PackageJSONTemplate) Write(path string) error
Write creates a new package.json to the provided path
type SessionOpts ¶ added in v0.3.0
type SessionOpts struct { WebDir string Mode string Pacname string OutDir string NodeModDir string PublicDir string HotReloadPort int }
SessionOpts are options used for creating a new session
type StaticBuild ¶ added in v0.21.0
type StaticBuild struct { SkipResourceCheck bool // contains filtered or unexported fields }
func NewStaticBuild ¶ added in v0.21.0
func NewStaticBuild(buildOpts *BuildOpts, staticBuildOut string) *StaticBuild
func (*StaticBuild) Build ¶ added in v0.21.0
func (opts *StaticBuild) Build(components srcpack.PackedComponentList) error
StaticBuild builds the given components into its static file (html) counterpart this method does not account for the javascript bundles that may be present in process