ReviewOS

also looking at this

craft-native/craft

fix(ci): build the SDK types with the repo's own tsc (and pin the pantry action)

#104
Merged glennmichael123 wants to merge fix/pin-pantry-action into main
29 files +85 -56
packages/zig/src/bridge_native_ui.zigmodified+7-7
Changes to packages/zig/src/bridge_native_ui.zig
@@ -228,7 +228,7 @@ pub const NativeUIBridge = struct {
228228 /// The returned slice borrows every string from `parsed`, so it must be
229229 /// consumed before the parse arena is freed — `SpaceList.append` copies.
230230 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;
232232 errdefer spaces.deinit(allocator);
233233
234234 for (value.array.items) |entry| {
@@ -270,7 +270,7 @@ pub const NativeUIBridge = struct {
270270 var spaces = if (root.get("spaces")) |v|
271271 try parseSpaces(self.allocator, v)
272272 else
273 std.ArrayList(space_switcher.Space){ .items = &.{}, .capacity = 0 };
273 std.ArrayList(space_switcher.Space).empty;
274274 defer spaces.deinit(self.allocator);
275275
276276 const active = if (root.get("activeSpace")) |v| switch (v) {
@@ -366,7 +366,7 @@ pub const NativeUIBridge = struct {
366366 const section_label = if (section_obj.get("label")) |v| v.string else if (section_obj.get("title")) |v| v.string else section_id;
367367 const items_value = section_obj.get("items") orelse continue;
368368
369 var items: std.ArrayList(NativeSidebar.SidebarItem) = .{ .items = &.{}, .capacity = 0 };
369 var items: std.ArrayList(NativeSidebar.SidebarItem) = .empty;
370370 defer items.deinit(self.allocator);
371371
372372 for (items_value.array.items) |item_value| {
@@ -481,7 +481,7 @@ pub const NativeUIBridge = struct {
481481 const items_json = section_data.get("items").?.array;
482482
483483 // Build items array
484 var items: std.ArrayList(NativeSidebar.SidebarItem) = .{ .items = &.{}, .capacity = 0 };
484 var items: std.ArrayList(NativeSidebar.SidebarItem) = .empty;
485485 defer items.deinit(self.allocator);
486486
487487 for (items_json.items) |item_json| {
@@ -596,7 +596,7 @@ pub const NativeUIBridge = struct {
596596
597597 const browser = self.file_browsers.get(browser_id) orelse return error.BrowserNotFound;
598598
599 var files: std.ArrayList(NativeFileBrowser.FileItem) = .{ .items = &.{}, .capacity = 0 };
599 var files: std.ArrayList(NativeFileBrowser.FileItem) = .empty;
600600 defer files.deinit(self.allocator);
601601
602602 for (files_json.items) |file_json| {
@@ -766,7 +766,7 @@ pub const NativeUIBridge = struct {
766766
767767 // Parse menu items
768768 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;
770770 defer items.deinit(self.allocator);
771771
772772 for (items_json.items) |item_json| {
@@ -785,7 +785,7 @@ pub const NativeUIBridge = struct {
785785 if (item_type == .submenu) {
786786 if (item_obj.get("submenu")) |submenu_json| {
787787 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;
789789 for (submenu_json.array.items) |sub_item_json| {
790790 if (sub_item_json == .object) {
791791 const sub_obj = sub_item_json.object;