From 42ae3b587ac660e996d16c23169d0e285509f49b Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Tue, 12 Sep 2023 11:44:40 -0700 Subject: [PATCH 1/2] chore(aft): Package `aft` should not have `pubspec_overrides.yaml` Unlike every other package, aft must work without `pubspec_overrides`. It's counter productive to generate it and and its presence can interfere with local development. --- packages/aft/lib/src/commands/link_command.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/aft/lib/src/commands/link_command.dart b/packages/aft/lib/src/commands/link_command.dart index d10649a418..6fb7aa4b91 100644 --- a/packages/aft/lib/src/commands/link_command.dart +++ b/packages/aft/lib/src/commands/link_command.dart @@ -59,6 +59,16 @@ Map _collectDependencies( return dependencyPaths; } +/// Removes the `pubspec_overrides.yaml` file for [package]. +Future _removePubspecOverride(PackageInfo package) async { + final pubspecOverrides = File( + path.join(package.path, 'pubspec_overrides.yaml'), + ); + if (await pubspecOverrides.exists()) { + await pubspecOverrides.delete(); + } +} + /// Creates a `pubspec_overrides.yaml` file for [package]. Future _createPubspecOverride( PackageInfo package, @@ -66,6 +76,12 @@ Future _createPubspecOverride( // To be merged in Map existingDependencyOverrides, ) async { + // Unlike every other package, aft must work without pubspec_overrides. + // It's counter productive to generate it and its presence can interfere + // with local development. + if (package.name == 'aft') { + await _removePubspecOverride(package); + } final mergedOverrides = SplayTreeMap.of({ // Merge in existing dependency overrides since `pub` will only use the // pubspec_overrides file if it exists. From 3f44402a7af07090dfe2bd95c20b1c9196be4e7d Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Tue, 12 Sep 2023 12:33:22 -0700 Subject: [PATCH 2/2] return --- packages/aft/lib/src/commands/link_command.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aft/lib/src/commands/link_command.dart b/packages/aft/lib/src/commands/link_command.dart index 6fb7aa4b91..06f0de3dff 100644 --- a/packages/aft/lib/src/commands/link_command.dart +++ b/packages/aft/lib/src/commands/link_command.dart @@ -80,7 +80,7 @@ Future _createPubspecOverride( // It's counter productive to generate it and its presence can interfere // with local development. if (package.name == 'aft') { - await _removePubspecOverride(package); + return _removePubspecOverride(package); } final mergedOverrides = SplayTreeMap.of({ // Merge in existing dependency overrides since `pub` will only use the