Class: Lilac::CLI::BuildContext

Inherits:
Struct
  • Object
show all
Defined in:
lib/lilac/cli/build/build_context.rb

Overview

Per-build shared state handed from Builder (orchestrator) to PageCompiler (per-page compiler). All fields are set before the page loop starts, so PageCompiler treats the struct as read-only; the cache / linter references inside it accumulate per-page state via their own APIs.

Fields:

- `components`        — { name => SFC::Component }, .lil + synthesized
- `bundle_assets`     — BundleAssetWriter::BundleAssets or nil (:inline mode)
- `package_dist_urls` — Array<String> page-relative URLs for `.mrb` packages
- `template_cache`    — shared TemplateASTCache (parse once, reuse)
- `build_linter`      — BuildLinter accumulating cross-page diagnostics
- `bytecode_builder`  — BytecodeBuilder for compiled-target `.mrb` emission
- `target`            — :full | :compiled
- `delivery`          — :inline | :bundle
- `live_reload`       — boolean (dev path injects SSE client script)
- `output_dir`        — absolute dist path (relative refs in boot module need this)
- `pages_dir`         — absolute pages root (for computing output paths)

Instance Attribute Summary collapse

Instance Attribute Details

#build_linterObject

Returns the value of attribute build_linter

Returns:

  • (Object)

    the current value of build_linter



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def build_linter
  @build_linter
end

#bundle_assetsObject

Returns the value of attribute bundle_assets

Returns:

  • (Object)

    the current value of bundle_assets



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def bundle_assets
  @bundle_assets
end

#bytecode_builderObject

Returns the value of attribute bytecode_builder

Returns:

  • (Object)

    the current value of bytecode_builder



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def bytecode_builder
  @bytecode_builder
end

#componentsObject

Returns the value of attribute components

Returns:

  • (Object)

    the current value of components



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def components
  @components
end

#deliveryObject

Returns the value of attribute delivery

Returns:

  • (Object)

    the current value of delivery



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def delivery
  @delivery
end

#live_reloadObject

Returns the value of attribute live_reload

Returns:

  • (Object)

    the current value of live_reload



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def live_reload
  @live_reload
end

#output_dirObject

Returns the value of attribute output_dir

Returns:

  • (Object)

    the current value of output_dir



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def output_dir
  @output_dir
end

#package_dist_urlsObject

Returns the value of attribute package_dist_urls

Returns:

  • (Object)

    the current value of package_dist_urls



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def package_dist_urls
  @package_dist_urls
end

#pages_dirObject

Returns the value of attribute pages_dir

Returns:

  • (Object)

    the current value of pages_dir



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def pages_dir
  @pages_dir
end

#targetObject

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def target
  @target
end

#template_cacheObject

Returns the value of attribute template_cache

Returns:

  • (Object)

    the current value of template_cache



23
24
25
# File 'lib/lilac/cli/build/build_context.rb', line 23

def template_cache
  @template_cache
end