writeAggregateChangelog method

Future<void> writeAggregateChangelog(
  1. MelosWorkspace workspace,
  2. AggregateChangelogConfig config,
  3. List<MelosPendingPackageUpdate> pendingPackageUpdates
)
inherited

Implementation

Future<void> writeAggregateChangelog(
  MelosWorkspace workspace,
  AggregateChangelogConfig config,
  List<MelosPendingPackageUpdate> pendingPackageUpdates,
) async {
  final today = DateTime.now();
  final dateSlug = [
    today.year.toString(),
    today.month.toString().padLeft(2, '0'),
    today.day.toString().padLeft(2, '0')
  ].join('-');

  final packages =
      await workspace.allPackages.applyFilter(config.packageFilter);
  // ignore: parameter_assignments
  pendingPackageUpdates = pendingPackageUpdates
      .where((update) => packages[update.package.name] != null)
      .toList();

  final changelog = AggregateChangelog(
    workspace,
    config.description,
    dateSlug,
    pendingPackageUpdates,
    logger,
    config.path,
  );

  await changelog.write();
}