internal

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotBuildAssetKeys = errors.New("cannot build asset keys")
View Source
var ErrFileTooRecentlyProcessed = errors.New("change not accepted, file too recently processed")

Functions

func Build added in v0.10.0

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

func New added in v0.7.0

func New(ctx context.Context, opts *SessionOpts) (*devSession, error)

New creates a new active dev session with the following:

  1. a flat tree represented by a map of the root page in component form
  2. initializes the development build process

Types

type BuildOpts added in v0.10.0

type BuildOpts struct {
	Packname       string
	OutDir         string
	WebDir         string
	Mode           string
	NodeModulePath string
	PublicDir      string
	Dirs           []string
	NoWrite        bool
}

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 NewDevServer(hotReload *hotreload.HotReload, logger log.Logger, session *devSession, changeOpts *ChangeRequestOpts) *DevServer

func (*DevServer) FileWatcherBundler added in v0.21.0

func (s *DevServer) FileWatcherBundler(timeout time.Duration, watcher *fsnotify.Watcher)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL