# Core since perl 5.30. Older releases than 0.083 do not verify TLS
# certificates by default (CVE-2023-31486); the SDK always asks them to.
requires 'HTTP::Tiny', '0.076';

# What HTTP::Tiny needs for https DSNs
requires 'IO::Socket::SSL', '1.968';
requires 'Net::SSLeay',     '1.49';

# The values of variables in stack trace frames (include_local_variables).
# XS like Net::SSLeay, without dependencies of its own
requires 'PadWalker', '2.0';

requires 'JSON::PP';
requires 'List::Util';
requires 'Time::HiRes';
requires 'perl', '5.030';

# Only for Mojolicious applications, which bring it along: the plugin and
# the integrations for it, and sending in the background of Mojo::IOLoop
recommends 'Mojolicious', '8';

feature 'cgiapp', 'CGI::Application plugin' => sub {
  requires 'CGI';
  requires 'CGI::Application';
};

feature 'plack', 'PSGI middleware' => sub {
  requires 'Plack';
};

suggests 'Cpanel::JSON::XS', '3.0201';

on 'test' => sub {
  requires 'Capture::Tiny';
  requires 'DBD::SQLite';
  requires 'CGI';
  requires 'CGI::Application';
  requires 'Devel::StackTrace';
  requires 'Exception::Class';
  requires 'LWP::UserAgent';
  requires 'URI';
  requires 'Test::Spec';
  requires 'Try::Tiny';

  # The tests of the Mojolicious parts are skipped without it
  recommends 'Mojolicious', '8';

  # For the test of async subs awaiting Mojo::Promise (Mojolicious 9)
  recommends 'Future::AsyncAwait';

  # For the test of rethrows from its catch blocks
  recommends 'Syntax::Keyword::Try';

  # Optional integrations, whose tests are skipped without them
  recommends 'AnyEvent';
  recommends 'AnyEvent::HTTP';
  recommends 'Archive::Zip';
  recommends 'CGI::Application::Plugin::TT';
  recommends 'CGI::PSGI';
  recommends 'CGI::Fast';
  recommends 'Cache::Memcached';
  recommends 'DBIx::Class';
  recommends 'EV';
  recommends 'FCGI';
  recommends 'Future';
  recommends 'GraphQL::Client';
  recommends 'Image::Magick';
  recommends 'HTML::Template';
  recommends 'HTML::Template::Pro';
  recommends 'Log::Log4perl';
  recommends 'MIME::Lite';
  recommends 'Net::Amazon::S3';
  recommends 'Net::LDAP';
  recommends 'Net::APNS::Simple';
  recommends 'Plack';
  recommends 'Redis';
  recommends 'Redis::Fast';
  recommends 'SOAP::Lite';
  recommends 'Search::Elasticsearch';
  recommends 'Starman';
  recommends 'Template';
  recommends 'XML::LibXSLT';
};

# The tools that judge the code (t/critic.t, t/tidy.t, t/imports.t) at exact
# versions: each release may judge differently and fail the build without a
# code change. For developers, tidy-all and CI alike; bump them deliberately,
# together with the reformatting.
on 'develop' => sub {
  requires 'App::perlimports',    '== 0.000067';
  requires 'CPAN::Uploader',      '0';
  # Generates META.json, Build.PL and README.md, and drives the release
  requires 'Minilla',             '== v3.3.2';
  requires 'PPI',                 '== 1.291';
  requires 'Perl::Critic',        '== 1.156';
  requires 'Perl::Tidy',          '== 20260826';
  requires 'Test::CPAN::Meta',    '0';
  requires 'Test::MinimumVersion::Fast', '0.04';
  requires 'Test::Perl::Critic',  '== 1.04';
  requires 'Test::PerlTidy',      '== 20260110';
  requires 'Test::Pod',           '1.14';
  requires 'Test::Pod::Coverage', '1.04';
  # Minilla's release (minil prepare) bumps the version with it, an optional
  # dependency Minilla does not declare
  requires 'Version::Next',       '0';
};
