File tree Expand file tree Collapse file tree 2 files changed +22
-29
lines changed
Expand file tree Collapse file tree 2 files changed +22
-29
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ if ! command -v jq &> /dev/null; then
2121 sudo apt-get update -qq && sudo apt-get install -y -qq jq >&2
2222fi
2323
24- # Calculate SDK size using jq with multiple search patterns
24+ # Calculate SDK size using jq - use nested package that contains "src"
2525RESULT=$( jq '
2626 def sum_values:
2727 if type == "object" then
@@ -32,27 +32,12 @@ RESULT=$(jq '
3232 0
3333 end;
3434
35- # Try multiple patterns to find the SDK package
35+ # Find the nested package that has "src" as a child (actual SDK code)
3636 (
37- [.. | objects | select(.n? == "package:stadata_flutter_sdk")] |
38- if length > 0 then
39- (.[0] | sum_values)
40- else
41- # Try alternative pattern without package: prefix
42- [.. | objects | select(.n? == "stadata_flutter_sdk")] |
43- if length > 0 then
44- (.[0] | sum_values)
45- else
46- # Try pattern with lib prefix
47- [.. | objects | select(.n? | test("stadata_flutter_sdk"))] |
48- if length > 0 then
49- (.[0] | sum_values)
50- else
51- 0
52- end
53- end
54- end
55- )
37+ .. | objects |
38+ select(.n? == "package:stadata_flutter_sdk" and (.children | if . then (map(.n) | any(. == "src")) else false end)) |
39+ sum_values
40+ ) // 0
5641' " $JSON_FILE " 2> /dev/null)
5742
5843if [ -z " $RESULT " ] || [ " $RESULT " = " null" ]; then
Original file line number Diff line number Diff line change @@ -72,14 +72,22 @@ jq -r '
7272 end;
7373
7474 # Combine all results
75- [extract_features, extract_core_shared] |
76- group_by(.feature) |
77- map({
78- feature: .[0].feature,
79- size: (map(.size) | add)
80- }) |
8175 {
82- total: (map(.size) | add // 0),
83- features: (map({(.feature): .size}) | add // {})
76+ # Calculate total from nested package that has "src" as child
77+ total: (
78+ .. | objects |
79+ select(.n? == "package:stadata_flutter_sdk" and (.children | if . then (map(.n) | any(. == "src")) else false end)) |
80+ sum_values
81+ ),
82+ # Feature breakdown
83+ features: (
84+ [extract_features, extract_core_shared] |
85+ group_by(.feature) |
86+ map({
87+ feature: .[0].feature,
88+ size: (map(.size) | add)
89+ }) |
90+ map({(.feature): .size}) | add // {}
91+ )
8492 }
8593' " $JSON_FILE " 2> /dev/null || echo " {}"
You can’t perform that action at this time.
0 commit comments