also looking at this
fix(ci): build the SDK types with the repo's own tsc (and pin the pantry action)
#104
29 files
+85
-56
| @@ -228,7 +228,7 @@ pub const NativeUIBridge = struct { | ||
| 228 | 228 | /// The returned slice borrows every string from `parsed`, so it must be |
| 229 | 229 | /// consumed before the parse arena is freed — `SpaceList.append` copies. |
| 230 | 230 | fn parseSpaces(allocator: std.mem.Allocator, value: std.json.Value) !std.ArrayList(space_switcher.Space) { |
| 231 | var spaces: std.ArrayList(space_switcher.Space) = .{ .items = &.{}, .capacity = 0 }; | |
| 231 | var spaces: std.ArrayList(space_switcher.Space) = .empty; | |
| 232 | 232 | errdefer spaces.deinit(allocator); |
| 233 | 233 | |
| 234 | 234 | for (value.array.items) |entry| { |
| @@ -270,7 +270,7 @@ pub const NativeUIBridge = struct { | ||
| 270 | 270 | var spaces = if (root.get("spaces")) |v| |
| 271 | 271 | try parseSpaces(self.allocator, v) |
| 272 | 272 | else |
| 273 | std.ArrayList(space_switcher.Space){ .items = &.{}, .capacity = 0 }; | |
| 273 | std.ArrayList(space_switcher.Space).empty; | |
| 274 | 274 | defer spaces.deinit(self.allocator); |
| 275 | 275 | |
| 276 | 276 | const active = if (root.get("activeSpace")) |v| switch (v) { |
| @@ -366,7 +366,7 @@ pub const NativeUIBridge = struct { | ||
| 366 | 366 | const section_label = if (section_obj.get("label")) |v| v.string else if (section_obj.get("title")) |v| v.string else section_id; |
| 367 | 367 | const items_value = section_obj.get("items") orelse continue; |
| 368 | 368 | |
| 369 | var items: std.ArrayList(NativeSidebar.SidebarItem) = .{ .items = &.{}, .capacity = 0 }; | |
| 369 | var items: std.ArrayList(NativeSidebar.SidebarItem) = .empty; | |
| 370 | 370 | defer items.deinit(self.allocator); |
| 371 | 371 | |
| 372 | 372 | for (items_value.array.items) |item_value| { |
| @@ -481,7 +481,7 @@ pub const NativeUIBridge = struct { | ||
| 481 | 481 | const items_json = section_data.get("items").?.array; |
| 482 | 482 | |
| 483 | 483 | // Build items array |
| 484 | var items: std.ArrayList(NativeSidebar.SidebarItem) = .{ .items = &.{}, .capacity = 0 }; | |
| 484 | var items: std.ArrayList(NativeSidebar.SidebarItem) = .empty; | |
| 485 | 485 | defer items.deinit(self.allocator); |
| 486 | 486 | |
| 487 | 487 | for (items_json.items) |item_json| { |
| @@ -596,7 +596,7 @@ pub const NativeUIBridge = struct { | ||
| 596 | 596 | |
| 597 | 597 | const browser = self.file_browsers.get(browser_id) orelse return error.BrowserNotFound; |
| 598 | 598 | |
| 599 | var files: std.ArrayList(NativeFileBrowser.FileItem) = .{ .items = &.{}, .capacity = 0 }; | |
| 599 | var files: std.ArrayList(NativeFileBrowser.FileItem) = .empty; | |
| 600 | 600 | defer files.deinit(self.allocator); |
| 601 | 601 | |
| 602 | 602 | for (files_json.items) |file_json| { |
| @@ -766,7 +766,7 @@ pub const NativeUIBridge = struct { | ||
| 766 | 766 | |
| 767 | 767 | // Parse menu items |
| 768 | 768 | const items_json = root.get("items").?.array; |
| 769 | var items: std.ArrayList(context_menu.MenuItem) = .{ .items = &.{}, .capacity = 0 }; | |
| 769 | var items: std.ArrayList(context_menu.MenuItem) = .empty; | |
| 770 | 770 | defer items.deinit(self.allocator); |
| 771 | 771 | |
| 772 | 772 | for (items_json.items) |item_json| { |
| @@ -785,7 +785,7 @@ pub const NativeUIBridge = struct { | ||
| 785 | 785 | if (item_type == .submenu) { |
| 786 | 786 | if (item_obj.get("submenu")) |submenu_json| { |
| 787 | 787 | if (submenu_json == .array) { |
| 788 | var submenu_list: std.ArrayList(context_menu.MenuItem) = .{ .items = &.{}, .capacity = 0 }; | |
| 788 | var submenu_list: std.ArrayList(context_menu.MenuItem) = .empty; | |
| 789 | 789 | for (submenu_json.array.items) |sub_item_json| { |
| 790 | 790 | if (sub_item_json == .object) { |
| 791 | 791 | const sub_obj = sub_item_json.object; |