Skip to content

Commit 856e0ec

Browse files
committed
updated command to ingore dependencies to example apps
1 parent 5c4bf2e commit 856e0ec

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

packages/aft/lib/src/commands/generate/generate_api_report_command.dart

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class GenerateApiReportCommand extends AmplifyCommand {
3333

3434
logger.info('Generating API JSON files for all packages...');
3535
final failedPackages = <String>[];
36-
36+
3737
for (final package in _categoryPackages) {
3838
logger.info('Processing $package...');
3939
try {
@@ -48,11 +48,12 @@ class GenerateApiReportCommand extends AmplifyCommand {
4848
logger.info('Generating API change report for amplify_core...');
4949
await _generateApiChangeReport();
5050

51-
5251
if (failedPackages.isNotEmpty) {
53-
logger.warn('Some packages had issues but placeholders were created: ${failedPackages.join(', ')}');
52+
logger.warn(
53+
'Some packages had issues but placeholders were created: ${failedPackages.join(', ')}',
54+
);
5455
}
55-
56+
5657
logger.info('Remember to commit these files with your changes.');
5758
} catch (e, stackTrace) {
5859
logger.error('Failed to generate API reports: $e');
@@ -107,7 +108,8 @@ class GenerateApiReportCommand extends AmplifyCommand {
107108
packagePath,
108109
'--output',
109110
outputPath,
110-
], workingDirectory: rootDir.path,);
111+
'--no-deps', // Skip dependency resolution
112+
], workingDirectory: rootDir.path);
111113

112114
if (result.exitCode != 0) {
113115
logger.error(result.stderr.toString());
@@ -122,13 +124,13 @@ class GenerateApiReportCommand extends AmplifyCommand {
122124
await _createEmptyApiJson(outputPath);
123125
return;
124126
}
125-
127+
// ignore: avoid_catches_without_on_clauses
126128
} catch (e) {
127129
logger.warn('Error generating API JSON for $packagePath: $e');
128130
await _createEmptyApiJson(outputPath);
129131
}
130132
}
131-
133+
132134
/// Creates an empty API JSON file as a fallback
133135
Future<void> _createEmptyApiJson(String outputPath) async {
134136
logger.info('Creating an empty API JSON file as a placeholder');
@@ -159,7 +161,7 @@ class GenerateApiReportCommand extends AmplifyCommand {
159161
);
160162

161163
final outputPath = path.join(corePackagePath, 'api_changes_report.md');
162-
164+
163165
try {
164166
final result = await Process.run('dart-apitool', [
165167
'diff',
@@ -171,7 +173,7 @@ class GenerateApiReportCommand extends AmplifyCommand {
171173
'markdown',
172174
'--report-file-path',
173175
outputPath,
174-
], workingDirectory: rootDir.path,);
176+
], workingDirectory: rootDir.path);
175177

176178
if (result.exitCode != 0) {
177179
logger
@@ -187,18 +189,19 @@ class GenerateApiReportCommand extends AmplifyCommand {
187189
await _createEmptyApiChangeReport(outputPath);
188190
return;
189191
}
190-
191192
} catch (e) {
192193
logger.warn('Error generating API change report: $e');
193194
await _createEmptyApiChangeReport(outputPath);
194195
}
195196
}
196-
197+
197198
/// Creates an empty API change report as a fallback
198199
Future<void> _createEmptyApiChangeReport(String outputPath) async {
199200
logger.info('Creating an empty API change report as a placeholder');
200201
final outputFile = File(outputPath);
201-
await outputFile.writeAsString('# API Changes Report\n\nNo changes detected or report generation failed.\n');
202+
await outputFile.writeAsString(
203+
'# API Changes Report\n\nNo changes detected or report generation failed.\n',
204+
);
202205
logger.info('Created placeholder report at $outputPath');
203206
}
204207
}

0 commit comments

Comments
 (0)