module GeneratorHelper

def package_json

def package_json
  # Lazy load package_json gem only when actually needed for dependency management
  require "package_json" unless defined?(PackageJson)
  @package_json ||= PackageJson.read
rescue LoadError
  puts "Warning: package_json gem not available. This is expected before Shakapacker installation."
  puts "Dependencies will be installed using the default package manager after Shakapacker setup."
  nil
rescue StandardError => e
  puts "Warning: Could not read package.json: #{e.message}"
  puts "This is normal before Shakapacker creates the package.json file."
  nil
end