File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,9 +50,9 @@ abstract class CompareCommand extends BaseCommand {
5050 );
5151 }
5252
53- dynamic get _baseDep => parseDependency (argResults! ['base' ] as String );
53+ dynamic get _baseDep => parseOverReactDependency (argResults! ['base' ] as String );
5454
55- dynamic get _headDep => parseDependency (argResults! ['head' ] as String );
55+ dynamic get _headDep => parseOverReactDependency (argResults! ['head' ] as String );
5656}
5757
5858class CompareSizeCommand extends CompareCommand {
@@ -125,7 +125,7 @@ class GetCodeCommand extends BaseCommand {
125125 );
126126 }
127127
128- dynamic get _dep => parseDependency (argResults! ['dependency' ] as String );
128+ dynamic get _dep => parseOverReactDependency (argResults! ['dependency' ] as String );
129129
130130 @override
131131 Future <void > run () async {
Original file line number Diff line number Diff line change @@ -6,7 +6,12 @@ final localPathDepString = jsonEncode({
66 'path' : Directory .current.path,
77});
88
9- dynamic parseDependency (String dependency) {
9+ /// Parses a string representation of an `over_react` [dependency] from a command-line arg.
10+ ///
11+ /// Supports either
12+ /// - a JSON format, equivalent to the YAML-parsed value of `dependencies` .`over_react` in a pubspec.yaml
13+ /// - a `git:<ref>` shorthand
14+ dynamic parseOverReactDependency (String dependency) {
1015 final gitShorthandMatch = RegExp (r'^git:(.+)$' ).matchAsPrefix (dependency);
1116 if (gitShorthandMatch != null ) {
1217 return {
Original file line number Diff line number Diff line change 1+ /// Returns Dart source for a general (function) component declaration,
2+ /// for use in various benchmarks.
13String componentBenchmark ({
24 required int componentCount,
35 required int propsCount,
You can’t perform that action at this time.
0 commit comments