projectDependencyIssues method

List<String> projectDependencyIssues({
  1. bool requireServerpod = true,
})

Validates the pubspec.yaml dependencies of a customer project in order to be deployed to Serverpod Cloud.

If the dependencies are not valid, the returned list will contain the error messages. If the dependencies are valid, the list will be empty.

Implementation

List<String> projectDependencyIssues({
  final bool requireServerpod = true,
}) {
  final supportedSdk = VersionConstraint.parse(
    VersionConstants.supportedSdkConstraint,
  );
  final supportedServerpod = VersionConstraint.parse(
    VersionConstants.supportedServerpodConstraint,
  );

  final sdkError = _validateEnvironmentConstraints(supportedSdk);

  final serverpodError = _validateHostedDependencyConstraint(
    packageName: 'serverpod',
    supported: supportedServerpod,
    requireDependency: requireServerpod,
  );

  return [
    if (sdkError != null) sdkError,
    if (serverpodError != null) serverpodError,
  ];
}