module ViteRuby::CompatibilityCheck

def verify_plugin_version(root)

Public: Attempt to verify that the vite-plugin-ruby version is compatible.
def verify_plugin_version(root)
  package = JSON.parse(root.join('package.json').read) rescue {}
  requirement = package.dig('devDependencies', 'vite-plugin-ruby') ||
                package.dig('dependencies', 'vite-plugin-ruby')
  raise_unless_satisfied(requirement, ViteRuby::DEFAULT_PLUGIN_VERSION)
end