Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
098b1b3
lint: line-length (codex)
fizzy-linux[bot] Oct 24, 2026
ec4ad4c
Merge main into lint/line-length
fizzy-windows[bot] Oct 24, 2026
6415b4a
Merge main into lint/line-length
fizzy-linux[bot] Oct 25, 2026
4714efa
Merge main into lint/line-length
fizzy-linux[bot] Oct 25, 2026
acea9ac
lint: line-length (codex)
fizzy-linux[bot] Oct 25, 2026
bc3d865
lint: line-length (codex)
fizzy-linux[bot] Oct 25, 2026
c661f99
Merge main into lint/line-length
fizzy-linux[bot] Oct 25, 2026
11725ca
Merge main for the zb flake fix (#841)
fizzy-linux[bot] Oct 25, 2026
d27b5d0
Merge main into lint/line-length
fizzy-linux[bot] Oct 25, 2026
4bfabbf
lint: line-length (codex)
fizzy-linux[bot] Oct 26, 2026
6dbe77a
lint: line-length (codex)
fizzy-linux[bot] Oct 26, 2026
2c67d85
Merge main into lint/line-length
fizzy-linux[bot] Oct 26, 2026
50dfc9c
lint: keep the multiline string literal in build/app.zig
fizzy-linux[bot] Oct 26, 2026
20f8e3b
lint: line-length (codex)
fizzy-linux[bot] Oct 26, 2026
5fbbd61
Merge main into lint/line-length
fizzy-linux[bot] Oct 26, 2026
7944ca6
lint: line-length (codex)
fizzy-linux[bot] Oct 26, 2026
a7143da
Merge main into lint/line-length
fizzy-linux[bot] Oct 26, 2026
d298138
lint: line-length (codex)
fizzy-linux[bot] Oct 26, 2026
8cfa3ee
Merge main into lint/line-length
fizzy-linux[bot] Oct 26, 2026
9c32444
lint: line-length (codex)
fizzy-linux[bot] Oct 26, 2026
fea16e0
lint: line-length (codex)
fizzy-linux[bot] Oct 27, 2026
308773c
Merge main into lint/line-length
fizzy-linux[bot] Oct 27, 2026
72b9ff0
lint: reflow markdown comment paragraphs to 100 characters
fizzy-linux[bot] Oct 27, 2026
764fe6c
lint: line-length (codex)
fizzy-linux[bot] Oct 27, 2026
3d66b8f
lint: rejoin net_image comment orphan
fizzy-linux[bot] Oct 28, 2026
7d1f639
Merge origin/main into lint/line-length
fizzy-linux[bot] Oct 28, 2026
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
7 changes: 3 additions & 4 deletions plugins/markdown/src/md/net_image.zig
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ const is_wasm = builtin.target.cpu.arch == .wasm32;
pub const fetch_supported = true;

/// The browser rasterizes SVG for us (the page reads its pixels, through the image proxy when
/// the host sends no CORS header). Native cannot — dvui's `svgToTvg` mangles every real badge — so
/// SVG
/// URLs are skipped there instead of fetched. The preview uses this to decide
/// *before* a fetch, so a `.svg` badge never becomes the "open" fallback link.
/// the host sends no CORS header). Native cannot — dvui's `svgToTvg` mangles every real badge —
/// so SVG URLs are skipped there instead of fetched. The preview uses this to decide *before* a
/// fetch, so a `.svg` badge never becomes the "open" fallback link.
pub const rasterizes_svg = is_wasm;

pub const Status = enum(u8) { fetching, ready, failed };
Expand Down
4 changes: 2 additions & 2 deletions sdk/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const std = @import("std");

// Build-time surface of this package, for the app as well as third-party plugins. The app consumes
// `sdk/` as a dependency and reaches these through it (`@import("fizzy_sdk").plugin`) rather than by
// relative path: a file may belong to only one module, and importing these from the root build
// `sdk/` as a dependency and reaches these through it (`@import("fizzy_sdk").plugin`) rather than
// by relative path: a file may belong to only one module, and importing these from the root build
// scripts by path would claim them for the root's build module and make this package unusable as a
// dependency of it. Going through the dependency is also what lets the app share this package's
// dvui instead of pinning its own — see `build/sdk.zig`'s `dvuiDependency`.
Expand Down
4 changes: 3 additions & 1 deletion sdk/core_module.zig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ pub fn addImports(
/// package — so the access check below picks whichever layout is present.
pub fn repoPath(b: *std.Build, sub_path: []const u8) std.Build.LazyPath {
b.root.access(b.graph.io, sub_path, .{}) catch {
return .{ .cwd_relative = b.root.joinString(b.allocator, b.pathJoin(&.{ "..", sub_path })) catch @panic("OOM") };
return .{
.cwd_relative = b.root.joinString(b.allocator, b.pathJoin(&.{ "..", sub_path })) catch @panic("OOM"),
};
};
return b.path(sub_path);
}
Expand Down
64 changes: 53 additions & 11 deletions sdk/plugin_sdk.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
//! Required in your project (see `docs/PLUGINS.md` §2):
//! - `plugin.zig` — `register(host)` + `Plugin` vtable; read `sdk.allocator()` / `sdk.host()`.
//! This is the module root: everything under `src/` imports it via relative paths, and the
//! shared deps (`fizzy_sdk`/`core`/`dvui`/`proxy_bridge`) are named imports (`@import("fizzy_sdk")`, …).
//! shared deps (`fizzy_sdk`/`core`/`dvui`/`proxy_bridge`) are named imports
//! (`@import("fizzy_sdk")`, …).
//! - `plugin.zig.zon` — identity only (`id`/`name`/`version`/`min_sdk_version`). Read
//! at configure time by `create` below; also embedded verbatim into the dylib (`fizzy_plugin_
//! manifest_zon`) so a disabled/unloaded plugin's identity can still be probed. There is no
Expand Down Expand Up @@ -89,9 +90,16 @@ pub fn readManifest(b: *std.Build) IdentityManifest {

fn readManifestAt(b: *std.Build, rel_path: []const u8) IdentityManifest {
b.dependOnFileContents(b.path(rel_path));
const raw = std.Io.Dir.cwd().readFileAlloc(b.graph.io, b.root.joinString(b.allocator, rel_path) catch @panic("OOM"), b.allocator, std.Io.Limit.limited(256 * 1024)) catch |e|
const raw = std.Io.Dir.cwd().readFileAlloc(
b.graph.io,
b.root.joinString(b.allocator, rel_path) catch @panic("OOM"),
b.allocator,
std.Io.Limit.limited(256 * 1024),
) catch |e|
std.debug.panic(
"fizzy: could not read {s}: {}\nEvery plugin needs a `plugin.zig.zon` manifest at its root (id/name/version) — see docs/PLUGINS.md.",
"fizzy: could not read {s}: {}\n" ++
"Every plugin needs a `plugin.zig.zon` manifest at its root (id/name/version) — " ++
"see docs/PLUGINS.md.",
.{ rel_path, e },
);
const src = b.allocator.dupeSentinel(u8, raw, 0) catch @panic("OOM");
Expand All @@ -103,13 +111,25 @@ fn readManifestAt(b: *std.Build, rel_path: []const u8) IdentityManifest {
};
// The build's allocator is freed only when the build ends: the manifest is read into it.
var diag: std.zon.parse.Diagnostics = undefined;
const parsed = std.zon.parse.fromSlice(Target, .{ .gpa = b.allocator, .arena = b.allocator, .source = src, .diagnostics = &diag, .ignore_unknown_fields = true }) catch |e|
const parsed = std.zon.parse.fromSlice(Target, .{
.gpa = b.allocator,
.arena = b.allocator,
.source = src,
.diagnostics = &diag,
.ignore_unknown_fields = true,
}) catch |e|
std.debug.panic("fizzy: failed to parse {s}: {}", .{ rel_path, e });
_ = std.SemanticVersion.parse(parsed.version) catch
std.debug.panic("fizzy: {s} .version \"{s}\" is not valid semver (expected e.g. 1.2.3)", .{ rel_path, parsed.version });
std.debug.panic(
"fizzy: {s} .version \"{s}\" is not valid semver (expected e.g. 1.2.3)",
.{ rel_path, parsed.version },
);
if (parsed.min_sdk_version.len > 0) {
_ = std.SemanticVersion.parse(parsed.min_sdk_version) catch
std.debug.panic("fizzy: {s} .min_sdk_version \"{s}\" is not valid semver", .{ rel_path, parsed.min_sdk_version });
std.debug.panic(
"fizzy: {s} .min_sdk_version \"{s}\" is not valid semver",
.{ rel_path, parsed.min_sdk_version },
);
}
return .{
.id = parsed.id,
Expand Down Expand Up @@ -264,7 +284,13 @@ pub const InstallBesideOptions = struct {
/// fizzy.plugin.installBeside(b, helper_exe, .{ .plugin = "agent" });
pub fn installBeside(b: *std.Build, artifact: *std.Build.Step.Compile, opts: InstallBesideOptions) void {
if (artifact.rootModuleTarget().cpu.arch == .wasm32) return;
addDevInstall(b, artifact, opts.plugin, artifact.out_filename, b.fmt("install '{s}' beside plugin '{s}'", .{ artifact.out_filename, opts.plugin }));
addDevInstall(
b,
artifact,
opts.plugin,
artifact.out_filename,
b.fmt("install '{s}' beside plugin '{s}'", .{ artifact.out_filename, opts.plugin }),
);
}

/// The helper `addDevInstall` runs, one per builder however many artifacts it installs. Debug:
Expand All @@ -288,7 +314,13 @@ var dev_install_exes: std.AutoHashMapUnmanaged(*std.Build, *std.Build.Step.Compi

/// Copy `artifact` to `{plugins}/{dir_name}/{file_name}` on every `zig build install`, through
/// `plugin_sdk_install.zig`: Zig 0.17's build has no custom steps.
fn addDevInstall(b: *std.Build, artifact: *std.Build.Step.Compile, dir_name: []const u8, file_name: []const u8, step_name: []const u8) void {
fn addDevInstall(
b: *std.Build,
artifact: *std.Build.Step.Compile,
dir_name: []const u8,
file_name: []const u8,
step_name: []const u8,
) void {
const dev = b.addRunArtifact(devInstallExe(b));
dev.setName(step_name);
dev.addArtifactArg(artifact);
Expand Down Expand Up @@ -345,7 +377,10 @@ fn addSdkMeta(b: *std.Build, lib: *std.Build.Step.Compile) *std.Build.Step {
fn addSdkCheck(b: *std.Build) *std.Build.Step {
if (b.top_level_steps.get("check")) |existing| return &existing.step;

const step = b.step("check", "Print pinned fizzy SDK version + abi fingerprint (and catch legacy release.yml drift)");
const step = b.step(
"check",
"Print pinned fizzy SDK version + abi fingerprint (and catch legacy release.yml drift)",
);

const release_yml = ".github/workflows/release.yml";
dependOnPathExistence(b, release_yml);
Expand All @@ -371,7 +406,11 @@ fn addSdkCheck(b: *std.Build) *std.Build.Step {
/// without regard to the environment, so a variable read here would be seen once and then ignored.
fn pluginUseLlvm(b: *std.Build) ?bool {
const gop = plugin_use_llvm.getOrPut(b.allocator, b) catch @panic("OOM");
if (!gop.found_existing) gop.value_ptr.* = b.option(bool, "plugin-use-llvm", "Force (true) or forbid (false) LLVM for plugin builds; unset, Zig chooses");
if (!gop.found_existing) gop.value_ptr.* = b.option(
bool,
"plugin-use-llvm",
"Force (true) or forbid (false) LLVM for plugin builds; unset, Zig chooses",
);
return gop.value_ptr.*;
}
var plugin_use_llvm: std.AutoHashMapUnmanaged(*std.Build, ?bool) = .empty;
Expand Down Expand Up @@ -561,7 +600,10 @@ pub fn create(b: *std.Build, opts: CreateOptions) PluginArtifact {
.link_libc = opts.link_libc and opts.target.result.cpu.arch != .wasm32,
});
static_module.addAnonymousImport("plugin_zon", .{ .root_source_file = b.path("plugin.zig.zon") });
static_module.addOptions(plugin_options_import, pluginOptions(b, m.id, m.name, m.version, m.min_sdk_version, m.raw));
static_module.addOptions(
plugin_options_import,
pluginOptions(b, m.id, m.name, m.version, m.min_sdk_version, m.raw),
);

return .{ .lib = lib, .module = plugin_module, .static = static_module };
}
Expand Down
4 changes: 3 additions & 1 deletion sdk/replay_module.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
//!
//! ```zig
//! const sdk = b.dependency("fizzy_sdk", .{});
//! const automation = @import("fizzy_sdk").replay.modules(b, sdk.builder, my_dvui_module, target, optimize);
//! const automation = @import("fizzy_sdk").replay.modules(
//! b, sdk.builder, my_dvui_module, target, optimize,
//! );
//! exe.root_module.addImport("tape", automation.tape);
//! exe.root_module.addImport("replay", automation.replay);
//! ```
Expand Down
Loading