Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fetch-depth: 0

- name: Setup Zig
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64
- name: Install Linux dependencies
run: |
sudo apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/binary-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
fetch-depth: 0

- name: Setup Zig
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64
- name: Install Linux dependencies
run: |
sudo apt-get update
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Verify Zig installation
run: eval "$(pantry env | sed -n '/^export /,$p')" && zig version
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install dependencies
run: bun install
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install dependencies
run: bun install
Expand All @@ -132,7 +132,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install dependencies
run: bun install
Expand All @@ -156,7 +156,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install dependencies
run: bun install
Expand All @@ -179,7 +179,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install dependencies
run: bun install
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
fetch-depth: 0

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install Dependencies
run: bun install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Zig
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Zig
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64
- name: Setup Java
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/native-lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v6

- name: Setup Pantry (provides Bun)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install dependencies
run: bun install --frozen-lockfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
fetch-depth: 0

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64

- name: Install System Dependencies
if: matrix.platform.deps != ''
Expand Down Expand Up @@ -290,7 +290,7 @@ jobs:
# 2. Auto-packages binaries from zig-out/ into platform-named zips
# 3. Creates/updates GitHub release with all artifacts + changelog
- name: Publish & Release
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64
with:
install: 'false'
publish: 'zig'
Expand Down Expand Up @@ -427,7 +427,7 @@ jobs:
fetch-depth: 0

- name: Setup Pantry (provides Bun, Zig, etc.)
uses: pantry-pm/pantry/packages/action@main
uses: pantry-pm/pantry/packages/action@235036fa0f48bae99b2293df5a3dc35c809b1777 # pinned: last SHA whose bundled typescript resolves on linux-x64
- name: Install Dependencies
run: bun install

Expand Down
13 changes: 10 additions & 3 deletions deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ dependencies:
bun.sh: 1.3.14
# Also pinned exactly. `^0.17.0-dev` floats on Zig's *dev* channel, so any
# `pantry install` can swap the compiler out from under a build — observed
# jumping 1509 -> 1606 unprompted. This is the version v0.0.58 was released
# with. Bump deliberately, and rebuild when you do.
ziglang.org: 0.17.0-dev.1509_bb296ab9b
# jumping 1509 -> 1606 unprompted. Bump deliberately, and rebuild when you do.
#
# The pin has a shelf life, which 1509 is how we found out. ziglang.org
# serves exactly one dev build — whatever master is now — plus the tagged
# releases, and prunes the rest. Every platform tarball for 1509 returned
# 404, so CI was running on cached toolchains and any uncached runner failed
# to provision at all: `darwin-x64` went red on a lockfile-free PR, and the
# next tagged release would have failed the same way. A pinned dev build is
# reproducible only for as long as it is master.
ziglang.org: 0.17.0-dev.1963_e00c6c439
2 changes: 1 addition & 1 deletion docs/android-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ Per `CLAUDE.md`'s distribution rule, the `.so` resolution lives here in the Andr
| Phase A0 | pinned Zig only | ✅ works today |
| Phase A1+ | Android SDK, NDK (pinned `26.1.10909125`), `adb`, `gradle` | ❌ none present |

Zig is pinned at `0.17.0-dev.1509+bb296ab9b`.
Zig is pinned at `0.17.0-dev.1963+e00c6c439`.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/ios-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ gated on `hashFiles('packages/ios/TestApp/TestApp.xcodeproj')`, which has never
| Phase 0 | nothing beyond the pinned Zig | ✅ works today on Command Line Tools |
| Phase 1+ | full Xcode — SDK, simulator runtime | ❌ install required |

Zig is pinned at `0.17.0-dev.1509+bb296ab9b`. Clear `.zig-cache` between heavy rounds.
Zig is pinned at `0.17.0-dev.1963+e00c6c439`. Clear `.zig-cache` between heavy rounds.

---

Expand Down
2 changes: 1 addition & 1 deletion packages/ios/fixtures/zig-slice/build-and-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
ZIG="${CRAFT_ZIG:-$HOME/.cache/craft-ci-local/zig-aarch64-macos-0.17.0-dev.1509+bb296ab9b/zig}"
ZIG="${CRAFT_ZIG:-$HOME/.cache/craft-ci-local/zig-aarch64-macos-0.17.0-dev.1963+e00c6c439/zig}"
FIXTURE="$ROOT/packages/ios/fixtures/zig-slice"
OUT="${1:-$FIXTURE/build}"
BUNDLE_ID="app.craft.slice"
Expand Down
5 changes: 3 additions & 2 deletions packages/typescript/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ async function build(entrypoints: string[], outdir: string): Promise<void> {
// their implementation and templates instead of importing unpublished peers.
await build(['../ios/src/index.ts'], 'dist/ios/src')
await build(['../android/src/index.ts'], 'dist/android/src')
await Bun.$`bunx tsc ${resolve(root, '../ios/src/index.ts')} --declaration --emitDeclarationOnly --module esnext --target esnext --moduleResolution bundler --types bun --skipLibCheck --ignoreConfig --outDir ${resolve(dist, 'ios/src')}`
await Bun.$`bunx tsc ${resolve(root, '../android/src/index.ts')} --declaration --emitDeclarationOnly --module esnext --target esnext --moduleResolution bundler --types bun --skipLibCheck --ignoreConfig --outDir ${resolve(dist, 'android/src')}`
// scripts/tsc.ts, not `bunx tsc`: PATH is not trustworthy in CI. See that file.
await Bun.$`bun ${resolve(root, "scripts/tsc.ts")} ${resolve(root, '../ios/src/index.ts')} --declaration --emitDeclarationOnly --module esnext --target esnext --moduleResolution bundler --types bun --skipLibCheck --ignoreConfig --outDir ${resolve(dist, 'ios/src')}`
await Bun.$`bun ${resolve(root, "scripts/tsc.ts")} ${resolve(root, '../android/src/index.ts')} --declaration --emitDeclarationOnly --module esnext --target esnext --moduleResolution bundler --types bun --skipLibCheck --ignoreConfig --outDir ${resolve(dist, 'android/src')}`
await cp(resolve(root, '../ios/templates'), resolve(dist, 'ios/templates'), { recursive: true })
await cp(resolve(root, '../android/templates'), resolve(dist, 'android/templates'), { recursive: true })

Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"scripts": {
"build": "bun build.ts && bun run build:types",
"build:lib": "bun build src/index.ts --outdir dist --format esm --target bun && bun build src/index.ts --outfile dist/index.cjs --format cjs --target node",
"build:types": "bun run tsc -p tsconfig.build.json && cp dist/index.d.ts dist/index.d.cts",
"build:types": "bun scripts/tsc.ts -p tsconfig.build.json && cp dist/index.d.ts dist/index.d.cts",
"dev": "bun --watch src/index.ts",
"lint": "bunx --bun pickier lint . --config ../../pickier.config.ts --max-warnings 9999",
"lint:fix": "bunx --bun pickier lint . --fix --config ../../pickier.config.ts --max-warnings 9999",
Expand Down
21 changes: 21 additions & 0 deletions packages/typescript/scripts/tsc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Run the `tsc` this package declares, not the one on PATH.
*
* `bunx tsc` resolves through PATH. In CI the pantry action provisions its own
* typescript into `<repo>/pantry` and puts it ahead of `node_modules/.bin`, so
* the same command silently ran a different compiler — a dev build the
* lockfile never pinned, and one whose linux-x64 platform binary is missing:
*
* Error: Unable to resolve @typescript/typescript-linux-x64.
*
* Locally nothing shadows `node_modules/.bin`, which is why the break only
* ever showed up in one CI job. Resolving through the module graph instead of
* PATH makes both places run the version `bun.lock` says.
*/
import { dirname, join } from 'node:path'

const pkgRoot = dirname(dirname(Bun.resolveSync('typescript', import.meta.dir)))
const tsc = join(pkgRoot, 'bin', 'tsc')

const proc = Bun.spawn(['bun', tsc, ...Bun.argv.slice(2)], { stdio: ['inherit', 'inherit', 'inherit'] })
process.exit(await proc.exited)
6 changes: 3 additions & 3 deletions packages/zig/src/benchmark.zig
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub const BenchmarkSuite = struct {
}

pub fn generateReport(self: *const BenchmarkSuite, allocator: std.mem.Allocator) ![]const u8 {
var buf = std.ArrayList(u8){ .items = &.{}, .capacity = 0 };
var buf = std.ArrayList(u8).empty;
errdefer buf.deinit(allocator);

const header = try std.fmt.allocPrint(allocator, "Benchmark Suite: {s}\n", .{self.name});
Expand All @@ -301,7 +301,7 @@ pub const BenchmarkSuite = struct {
}

pub fn generateJSON(self: *const BenchmarkSuite, allocator: std.mem.Allocator) ![]const u8 {
var buf = std.ArrayList(u8){ .items = &.{}, .capacity = 0 };
var buf = std.ArrayList(u8).empty;
errdefer buf.deinit(allocator);

try buf.appendSlice(allocator, "{");
Expand Down Expand Up @@ -422,7 +422,7 @@ pub fn benchmarkArrayListOperations(allocator: std.mem.Allocator, operations: us
}

fn arrayListOps(allocator: std.mem.Allocator, ops: usize) !void {
var list = std.ArrayList(usize){ .items = &.{}, .capacity = 0 };
var list = std.ArrayList(usize).empty;
defer list.deinit(allocator);

var i: usize = 0;
Expand Down
4 changes: 2 additions & 2 deletions packages/zig/src/bridge_clipboard.zig
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub const ClipboardBridge = struct {
log.debug("Read text from clipboard: {s}", .{text_str});

// Escape backslashes and quotes for safe JSON embedding
var buf: std.ArrayList(u8) = .{ .items = &.{}, .capacity = 0 };
var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);

try buf.appendSlice(self.allocator, "{\"text\":\"");
Expand Down Expand Up @@ -306,7 +306,7 @@ pub const ClipboardBridge = struct {
const html_str = std.mem.span(@as([*:0]const u8, @ptrCast(html_cstr)));
log.debug("Read HTML from clipboard: {s}", .{html_str});

var buf: std.ArrayList(u8) = .{ .items = &.{}, .capacity = 0 };
var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);

try buf.appendSlice(self.allocator, "{\"html\":\"");
Expand Down
8 changes: 4 additions & 4 deletions packages/zig/src/bridge_dialog.zig
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ pub const DialogBridge = struct {
if (comptime builtin.mode == .debug)
std.debug.print("[DialogBridge] Selected file: {s}\n", .{path_str});

var buf: std.ArrayList(u8) = .{ .items = &.{}, .capacity = 0 };
var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);

try buf.appendSlice(self.allocator, "{\"canceled\":false,\"filePaths\":[\"");
Expand Down Expand Up @@ -502,7 +502,7 @@ pub const DialogBridge = struct {
if (comptime builtin.mode == .debug)
std.debug.print("[DialogBridge] Selected {d} files\n", .{count});

var buf: std.ArrayList(u8) = .{ .items = &.{}, .capacity = 0 };
var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);

try buf.appendSlice(self.allocator, "{\"canceled\":false,\"filePaths\":[");
Expand Down Expand Up @@ -581,7 +581,7 @@ pub const DialogBridge = struct {
if (comptime builtin.mode == .debug)
std.debug.print("[DialogBridge] Selected folder: {s}\n", .{path_str});

var buf: std.ArrayList(u8) = .{ .items = &.{}, .capacity = 0 };
var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);

try buf.appendSlice(self.allocator, "{\"canceled\":false,\"filePaths\":[\"");
Expand Down Expand Up @@ -645,7 +645,7 @@ pub const DialogBridge = struct {
if (comptime builtin.mode == .debug)
std.debug.print("[DialogBridge] Save path: {s}\n", .{path_str});

var buf: std.ArrayList(u8) = .{ .items = &.{}, .capacity = 0 };
var buf: std.ArrayList(u8) = .empty;
defer buf.deinit(self.allocator);

try buf.appendSlice(self.allocator, "{\"canceled\":false,\"filePath\":\"");
Expand Down
14 changes: 7 additions & 7 deletions packages/zig/src/bridge_native_ui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub const NativeUIBridge = struct {
/// The returned slice borrows every string from `parsed`, so it must be
/// consumed before the parse arena is freed — `SpaceList.append` copies.
fn parseSpaces(allocator: std.mem.Allocator, value: std.json.Value) !std.ArrayList(space_switcher.Space) {
var spaces: std.ArrayList(space_switcher.Space) = .{ .items = &.{}, .capacity = 0 };
var spaces: std.ArrayList(space_switcher.Space) = .empty;
errdefer spaces.deinit(allocator);

for (value.array.items) |entry| {
Expand Down Expand Up @@ -270,7 +270,7 @@ pub const NativeUIBridge = struct {
var spaces = if (root.get("spaces")) |v|
try parseSpaces(self.allocator, v)
else
std.ArrayList(space_switcher.Space){ .items = &.{}, .capacity = 0 };
std.ArrayList(space_switcher.Space).empty;
defer spaces.deinit(self.allocator);

const active = if (root.get("activeSpace")) |v| switch (v) {
Expand Down Expand Up @@ -366,7 +366,7 @@ pub const NativeUIBridge = struct {
const section_label = if (section_obj.get("label")) |v| v.string else if (section_obj.get("title")) |v| v.string else section_id;
const items_value = section_obj.get("items") orelse continue;

var items: std.ArrayList(NativeSidebar.SidebarItem) = .{ .items = &.{}, .capacity = 0 };
var items: std.ArrayList(NativeSidebar.SidebarItem) = .empty;
defer items.deinit(self.allocator);

for (items_value.array.items) |item_value| {
Expand Down Expand Up @@ -481,7 +481,7 @@ pub const NativeUIBridge = struct {
const items_json = section_data.get("items").?.array;

// Build items array
var items: std.ArrayList(NativeSidebar.SidebarItem) = .{ .items = &.{}, .capacity = 0 };
var items: std.ArrayList(NativeSidebar.SidebarItem) = .empty;
defer items.deinit(self.allocator);

for (items_json.items) |item_json| {
Expand Down Expand Up @@ -596,7 +596,7 @@ pub const NativeUIBridge = struct {

const browser = self.file_browsers.get(browser_id) orelse return error.BrowserNotFound;

var files: std.ArrayList(NativeFileBrowser.FileItem) = .{ .items = &.{}, .capacity = 0 };
var files: std.ArrayList(NativeFileBrowser.FileItem) = .empty;
defer files.deinit(self.allocator);

for (files_json.items) |file_json| {
Expand Down Expand Up @@ -766,7 +766,7 @@ pub const NativeUIBridge = struct {

// Parse menu items
const items_json = root.get("items").?.array;
var items: std.ArrayList(context_menu.MenuItem) = .{ .items = &.{}, .capacity = 0 };
var items: std.ArrayList(context_menu.MenuItem) = .empty;
defer items.deinit(self.allocator);

for (items_json.items) |item_json| {
Expand All @@ -785,7 +785,7 @@ pub const NativeUIBridge = struct {
if (item_type == .submenu) {
if (item_obj.get("submenu")) |submenu_json| {
if (submenu_json == .array) {
var submenu_list: std.ArrayList(context_menu.MenuItem) = .{ .items = &.{}, .capacity = 0 };
var submenu_list: std.ArrayList(context_menu.MenuItem) = .empty;
for (submenu_json.array.items) |sub_item_json| {
if (sub_item_json == .object) {
const sub_obj = sub_item_json.object;
Expand Down
2 changes: 1 addition & 1 deletion packages/zig/src/components/context_menu.zig
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub const MenuCallbackData = struct {
data.* = .{
.target_id = try allocator.dupe(u8, target_id),
.target_type = try allocator.dupe(u8, target_type),
.item_ids = .{ .items = &.{}, .capacity = 0 },
.item_ids = .empty,
.allocator = allocator,
};
return data;
Expand Down
2 changes: 1 addition & 1 deletion packages/zig/src/components/native_sidebar.zig
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub const NativeSidebar = struct {
var new_section = OutlineViewDataSource.DataStore.Section{
.id = try self.allocator.dupe(u8, section.id),
.header = if (section.header) |h| try self.allocator.dupe(u8, h) else null,
.items = .{ .items = &.{}, .capacity = 0 },
.items = .empty,
.is_expanded = true,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/zig/src/components/outline_view_datasource.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub const OutlineViewDataSource = struct {

pub fn init(allocator: std.mem.Allocator) DataStore {
return .{
.sections = .{ .items = &.{}, .capacity = 0 },
.sections = .empty,
.allocator = allocator,
};
}
Expand Down
Loading
Loading