@@ -12,6 +12,8 @@ import 'package:df_gen_core/df_gen_core.dart';
12
12
import 'package:df_log/df_log.dart' ;
13
13
14
14
import '_extract_class_insights_from_dart_file.dart' ;
15
+ import '_generator_converger.dart' ;
16
+ import '_insight_mappers.dart' ;
15
17
16
18
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
17
19
@@ -54,8 +56,6 @@ Future<void> generateScreenAccess({
54
56
),
55
57
);
56
58
57
- printRed (template.length);
58
-
59
59
// ---------------------------------------------------------------------------
60
60
61
61
// Create context for the Dart analyzer.
@@ -65,8 +65,8 @@ Future<void> generateScreenAccess({
65
65
);
66
66
67
67
// For each file...
68
- for (final filePathResult in sourceFileExplorerResults.filePathResults
69
- .where ((e) => e.category == _Categories .DART )) {
68
+ for (final filePathResult
69
+ in sourceFileExplorerResults.filePathResults .where ((e) => e.category == _Categories .DART )) {
70
70
final filePath = filePathResult.path;
71
71
72
72
// Extract insights from the file.
@@ -77,65 +77,18 @@ Future<void> generateScreenAccess({
77
77
78
78
if (classInsights.isNotEmpty) {
79
79
// Converge what was gathered to generate the output.
80
- // await generatorConverger.converge(
81
- // classInsights,
82
- // [template],
83
- // [
84
- // ...insightMappersA,
85
- // ...insightMappersB,
86
- // ],
87
- // );
80
+ await generatorConverger.converge (
81
+ classInsights,
82
+ [template],
83
+ [
84
+ ...insightMappers,
85
+ ],
86
+ );
88
87
}
89
88
}
90
89
91
- // final screenClassNames = <String>{};
92
- // for (final dirPath in combinePathSets([rootDirPaths, subDirPaths])) {
93
- // final filePaths = await listFilePaths(dirPath);
94
- // if (filePaths != null) {
95
- // filePaths.sort();
96
- // for (final filePath in filePaths) {
97
- // if (isGeneratedDartFilePath(filePath) && matchesAnyPathPattern(filePath, pathPatterns)) {
98
- // var screenFileKey = getBaseName(filePath).replaceAll('.g.dart', '');
99
- // screenFileKey =
100
- // screenFileKey.startsWith('_') ? screenFileKey.substring(1) : screenFileKey;
101
- // final contents = await readFile(filePath);
102
- // if (contents != null) {
103
- // final x = RegExp(r'''const +_CLASS += +["'](\w+)["'];''');
104
- // final match = x.firstMatch(contents);
105
- // if (match != null && match.groupCount == 1) {
106
- // final screenClassName = match.group(1);
107
- // if (screenClassName != null) {
108
- // screenClassNames1.add(screenClassName);
109
- // }
110
- // }
111
- // }
112
- // }
113
- // }
114
- // }
115
- // }
116
- // final sorted = screenClassNames1.toList()..sort();
117
- // final keys = sorted.map((e) => e.toSnakeCase().toUpperCase());
118
- // final a = sorted.map((e) => 'maker$e').join(',');
119
- // final b = keys.map((e) => '...PATH_$e').join(',');
120
- // final c = keys.map((e) => '...PATH_NOT_REDIRECTABLE_$e').join(',');
121
- // final d = keys.map((e) => '...PATH_ALWAYS_ACCESSIBLE_$e').join(',');
122
- // final e = keys.map((e) => '...PATH_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED_$e').join(',');
123
- // final f = keys.map((e) => '...PATH_ACCESSIBLE_ONLY_IF_LOGGED_IN_$e').join(',');
124
- // final g = keys.map((e) => '...PATH_ACCESSIBLE_ONLY_IF_LOGGED_OUT_$e').join(',');
125
- // final h = sorted.map((e) => 'generated${e}Route').join(',');
126
- // final template = (await readSnippetsFromMarkdownFile(templateFilePath)).join('\n');
127
- // final outputContent = replaceData(template, {
128
- // '___SCREEN_MAKERS___': a,
129
- // '___PATHS___': b,
130
- // '___PATHS_NOT_REDIRECTABLE___': c,
131
- // '___PATHS_ALWAYS_ACCESSIBLE___': d,
132
- // '___PATHS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED___': e,
133
- // '___PATHS_ACCESSIBLE_ONLY_IF_LOGGED_IN___': f,
134
- // '___PATHS_ACCESSIBLE_ONLY_IF_LOGGED_OUT___': g,
135
- // '___GENERATED_SCREEN_ROUTES___': h,
136
- // });
137
90
// await writeFile(outputFilePath, outputContent);
138
- // Here().debugLogStop('Done!');
91
+ Here ().debugLogStop ('Done!' );
139
92
}
140
93
141
94
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
0 commit comments