class SvelteOnRails::Renderer
def initialize(component_name, base_path: SvelteOnRails::Configuration.instance.components_folder_full)
def initialize(component_name, base_path: SvelteOnRails::Configuration.instance.components_folder_full) config = SvelteOnRails::Configuration.instance unless system("#{config.node_bin_path} --version > /dev/null 2>&1") raise "Node.js not found at '#{config.node_bin_path}'. Please configure SvelteOnRails.node_bin (e.g., to ~/.nvm/versions/node/vX.Y.Z/bin/node) or ensure 'node' is in the PATH. If using NVM, run `nvm which default` to find the path." end if !Dir.exist?(config.ssr_dist_folder) || config.watch_changes? SvelteOnRails::Lib::Utils.watch_changes_and_precompile end utils = SvelteOnRails::Lib::Utils @component_files = utils.component_files(component_name, base_path: base_path) end