mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-19 10:09:36 -06:00
refactor(cli): transpile and cleanup
This commit is contained in:
parent
35b631080a
commit
6337f05d1e
@ -38,7 +38,7 @@ fn redirect(ctx: zx.PageContext) void {
|
||||
}
|
||||
|
||||
pub fn handleRequest(ctx: zx.PageContext) BenchState {
|
||||
const io = std.Io.Threaded.global_single_threaded.io();
|
||||
const io = zx.io();
|
||||
// Add CORS headers to allow requests from the benchmark server
|
||||
ctx.response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
ctx.response.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
||||
|
||||
@ -29,7 +29,7 @@ pub const Row = struct {
|
||||
};
|
||||
|
||||
fn random(max: usize) usize {
|
||||
const io = std.Io.Threaded.global_single_threaded.io();
|
||||
const io = zx.io();
|
||||
var buffer: [1]u8 = undefined;
|
||||
std.Io.random(io, &buffer);
|
||||
return @mod(buffer[0], max);
|
||||
@ -66,3 +66,5 @@ pub fn buildData(allocator: std.mem.Allocator, count: usize) !std.ArrayList(Row)
|
||||
pub fn resetIdCounter() void {
|
||||
id_counter = 1;
|
||||
}
|
||||
|
||||
const zx = @import("zx");
|
||||
|
||||
@ -7,7 +7,7 @@ pub fn Page(ctx: zx.PageContext) zx.Component {
|
||||
<main @allocator={ctx.arena}>
|
||||
<ol>
|
||||
<li><a href="/js-framework-benchmark/csr">js-framework-benchmark | CSR</a></li>
|
||||
<li><a href="/js-framework-benchmark/ssr">js-framework-benchmark | SSR</a></li>
|
||||
<li><a href="/js-framework-benchmdark/ssr">js-framework-benchmark | SSR</a></li>
|
||||
<li><a href="/ssr-performance-showdown">SSR Performance Showdown</a></li>
|
||||
<li><a href="/ssr">Generalized | SSR</a></li>
|
||||
</ol>
|
||||
|
||||
38
build.zig
38
build.zig
@ -1,6 +1,5 @@
|
||||
const std = @import("std");
|
||||
const initlib = @import("src/build/init.zig");
|
||||
|
||||
const build_zon = @import("build.zig.zon");
|
||||
|
||||
/// Options for initializing
|
||||
@ -111,11 +110,11 @@ pub fn build(b: *std.Build) !void {
|
||||
|
||||
// --- Steps: Test --- //
|
||||
{
|
||||
const mod_tests = b.addTest(.{ .root_module = mod });
|
||||
const run_mod_tests = b.addRunArtifact(mod_tests);
|
||||
|
||||
const exe_tests = b.addTest(.{ .root_module = exe.root_module });
|
||||
const run_exe_tests = b.addRunArtifact(exe_tests);
|
||||
const mode_test = b.createModule(.{ .root_source_file = b.path("src/root.zig") });
|
||||
if (b.lazyDependency("adapters", .{})) |ad| mode_test.addImport("zqlite", ad.module("zqlite"));
|
||||
mode_test.addOptions("zx_info", options);
|
||||
mode_test.addOptions("zx_module_options", zx_module_options);
|
||||
mode_test.addImport("zx_core_lang", zx_core_lang_mod);
|
||||
|
||||
const testing_mod = b.createModule(.{
|
||||
.root_source_file = b.path("test/main.zig"),
|
||||
@ -123,7 +122,16 @@ pub fn build(b: *std.Build) !void {
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "cli_options", .module = cli_options_dev.createModule() },
|
||||
.{ .name = "zx", .module = mod },
|
||||
.{ .name = "zx", .module = mode_test },
|
||||
.{ .name = "html_hover", .module = b.createModule(.{
|
||||
.root_source_file = b.path("src/lsp/html_hover.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "core_lang", .module = zx_core_lang_mod },
|
||||
},
|
||||
}) },
|
||||
.{ .name = "builder", .module = b.createModule(.{
|
||||
.root_source_file = b.path("src/cli/dev/Builder.zig"),
|
||||
}) },
|
||||
},
|
||||
});
|
||||
const testing_mod_tests = b.addTest(.{
|
||||
@ -133,24 +141,8 @@ pub fn build(b: *std.Build) !void {
|
||||
const test_run = b.addRunArtifact(testing_mod_tests);
|
||||
test_run.step.dependOn(b.getInstallStep());
|
||||
|
||||
// LSP HTML hover docs: tested standalone since the LSP server itself
|
||||
// depends on ZLS (excluded by default / not yet available for 0.17).
|
||||
const html_hover_mod = b.createModule(.{
|
||||
.root_source_file = b.path("src/lsp/html_hover.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
.imports = &.{
|
||||
.{ .name = "core_lang", .module = zx_core_lang_mod },
|
||||
},
|
||||
});
|
||||
const html_hover_tests = b.addTest(.{ .root_module = html_hover_mod });
|
||||
const run_html_hover_tests = b.addRunArtifact(html_hover_tests);
|
||||
|
||||
const test_step = b.step("test", "Run tests");
|
||||
test_step.dependOn(&run_mod_tests.step);
|
||||
test_step.dependOn(&run_exe_tests.step);
|
||||
test_step.dependOn(&test_run.step);
|
||||
test_step.dependOn(&run_html_hover_tests.step);
|
||||
|
||||
const transpile_only = b.addExecutable(.{
|
||||
.name = "transpile-only",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "create-ziex",
|
||||
"version": "0.1.0-dev.1103",
|
||||
"version": "0.1.0-dev.1259",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"create-ziex": "dist/index.js"
|
||||
|
||||
@ -77,7 +77,7 @@ pub const Event = union(enum) {
|
||||
assets_installed: AssetChange,
|
||||
};
|
||||
|
||||
const StepStatus = enum { success, cached, failure };
|
||||
pub const StepStatus = enum { success, cached, failure };
|
||||
|
||||
pub const BuildState = struct {
|
||||
allocator: std.mem.Allocator,
|
||||
@ -351,7 +351,7 @@ fn mergeStatus(prev: ?StepStatus, next: StepStatus) StepStatus {
|
||||
return .cached;
|
||||
}
|
||||
|
||||
fn stripTreePrefix(line: []const u8) []const u8 {
|
||||
pub fn stripTreePrefix(line: []const u8) []const u8 {
|
||||
var i: usize = 0;
|
||||
while (i < line.len) {
|
||||
const c = line[i];
|
||||
@ -373,7 +373,7 @@ fn stripTreePrefix(line: []const u8) []const u8 {
|
||||
/// Remove inline ANSI escape sequences and "bare" CSI fragments like "[2m" /
|
||||
/// "[0m" left behind when the escape byte was stripped upstream. The result
|
||||
/// reuses the input buffer (returning a sub-slice up to the new length).
|
||||
fn stripAnsiInPlace(line: []const u8) []const u8 {
|
||||
pub fn stripAnsiInPlace(line: []const u8) []const u8 {
|
||||
// ANSI cleanup is rare; do it lazily with a scratch trick: rewrite into a
|
||||
// small stack buffer only when needed.
|
||||
var has_ansi = false;
|
||||
@ -423,7 +423,7 @@ fn stripAnsiInPlace(line: []const u8) []const u8 {
|
||||
|
||||
/// Match `install <role> <name> <status>` (status is the final word, possibly
|
||||
/// followed by timing info we ignore). Returns the status or null.
|
||||
fn parseInstallStatus(content: []const u8, role: []const u8) ?StepStatus {
|
||||
pub fn parseInstallStatus(content: []const u8, role: []const u8) ?StepStatus {
|
||||
const prefix = "install ";
|
||||
if (!std.mem.startsWith(u8, content, prefix)) return null;
|
||||
var rest = content[prefix.len..];
|
||||
@ -451,7 +451,7 @@ fn parseCompileStatus(content: []const u8, target_marker: []const u8) ?StepStatu
|
||||
}
|
||||
|
||||
/// Match `install <something>/ <status>` for asset directories.
|
||||
fn parseAssetDirStatus(content: []const u8) ?StepStatus {
|
||||
pub fn parseAssetDirStatus(content: []const u8) ?StepStatus {
|
||||
const prefix = "install ";
|
||||
if (!std.mem.startsWith(u8, content, prefix)) return null;
|
||||
var rest = content[prefix.len..];
|
||||
@ -464,7 +464,7 @@ fn parseAssetDirStatus(content: []const u8) ?StepStatus {
|
||||
|
||||
/// The first token of `rest` is the status word. We ignore "(reused)" entirely
|
||||
/// (it represents a downstream dependency dedupe, not a real install outcome).
|
||||
fn parseStatusWord(rest: []const u8) ?StepStatus {
|
||||
pub fn parseStatusWord(rest: []const u8) ?StepStatus {
|
||||
if (rest.len == 0) return null;
|
||||
const end = std.mem.indexOfAny(u8, rest, " \t") orelse rest.len;
|
||||
const word = rest[0..end];
|
||||
@ -488,7 +488,7 @@ const AssetInstall = struct {
|
||||
/// `/static/` whose source is in `public/` or `assets/`). Returns the web path
|
||||
/// (e.g. "favicon.ico" or "assets/style.css"). Built artifacts in
|
||||
/// `.zig-cache` / package cache are filtered out.
|
||||
fn parseUserAssetInstall(line: []const u8) ?AssetInstall {
|
||||
pub fn parseUserAssetInstall(line: []const u8) ?AssetInstall {
|
||||
const trimmed = std.mem.trimStart(u8, line, " \t");
|
||||
if (!std.mem.startsWith(u8, trimmed, "install ")) return null;
|
||||
if (std.mem.indexOf(u8, trimmed, ".zig-cache") != null) return null;
|
||||
@ -540,11 +540,11 @@ pub fn formatDiagnostics(allocator: std.mem.Allocator, diagnostics: []const Diag
|
||||
return buf.toOwnedSlice(allocator);
|
||||
}
|
||||
|
||||
fn isBuildCommandLine(line: []const u8) bool {
|
||||
pub fn isBuildCommandLine(line: []const u8) bool {
|
||||
return isBuildCommandForOs(builtin.os.tag, line);
|
||||
}
|
||||
|
||||
fn isBuildCommandForOs(os_tag: std.Target.Os.Tag, line: []const u8) bool {
|
||||
pub fn isBuildCommandForOs(os_tag: std.Target.Os.Tag, line: []const u8) bool {
|
||||
const trimmed = std.mem.trim(u8, line, " \t");
|
||||
if (trimmed.len == 0) return false;
|
||||
|
||||
@ -653,7 +653,7 @@ fn accumulateDuration(line: []const u8, max_ms: *u64) void {
|
||||
}
|
||||
}
|
||||
|
||||
fn parseDurationMs(text: []const u8) ?u64 {
|
||||
pub fn parseDurationMs(text: []const u8) ?u64 {
|
||||
if (text.len < 2) return null;
|
||||
var num_end: usize = 0;
|
||||
while (num_end < text.len) : (num_end += 1) {
|
||||
@ -677,359 +677,3 @@ fn parseDurationMs(text: []const u8) ?u64 {
|
||||
return null;
|
||||
return @intFromFloat(ms);
|
||||
}
|
||||
|
||||
const err_sample = @embedFile("ErrorOutput.txt");
|
||||
const sample_win = @embedFile("Output_Win.txt");
|
||||
const sample_err_then_fix = @embedFile("ErrorThenFix.txt");
|
||||
const sample_first = @embedFile("FirstOutput.txt");
|
||||
const sample_change = @embedFile("ChangeOutput.txt");
|
||||
|
||||
fn feedLines(state: *BuildState, input: []const u8, events: *std.ArrayList(Event)) !void {
|
||||
var lines = std.mem.splitScalar(u8, input, '\n');
|
||||
while (lines.next()) |line| {
|
||||
const clean = if (line.len > 0 and line[line.len - 1] == '\r') line[0 .. line.len - 1] else line;
|
||||
if (try state.processLine(clean)) |event| {
|
||||
try events.append(state.allocator, event);
|
||||
}
|
||||
}
|
||||
if (state.flushPending()) |event| {
|
||||
try events.append(state.allocator, event);
|
||||
}
|
||||
}
|
||||
|
||||
fn freeEvents(allocator: std.mem.Allocator, events: *std.ArrayList(Event)) void {
|
||||
for (events.items) |*e| switch (e.*) {
|
||||
.errors => |*r| r.deinit(),
|
||||
.assets_installed => |*a| a.deinit(),
|
||||
else => {},
|
||||
};
|
||||
events.deinit(allocator);
|
||||
}
|
||||
|
||||
test "parseStatusWord recognizes success/cached/failure" {
|
||||
try std.testing.expectEqual(StepStatus.success, parseStatusWord("success 35s MaxRSS:964M").?);
|
||||
try std.testing.expectEqual(StepStatus.cached, parseStatusWord("cached 102ms MaxRSS:32M").?);
|
||||
try std.testing.expectEqual(StepStatus.failure, parseStatusWord("1 errors").?);
|
||||
try std.testing.expectEqual(StepStatus.failure, parseStatusWord("transitive failure").?);
|
||||
try std.testing.expectEqual(@as(?StepStatus, null), parseStatusWord("(reused)"));
|
||||
}
|
||||
|
||||
test "parseInstallStatus parses server/client lines" {
|
||||
try std.testing.expectEqual(StepStatus.success, parseInstallStatus("install server ziex_app success 35s", "server").?);
|
||||
try std.testing.expectEqual(StepStatus.cached, parseInstallStatus("install server ziex_app cached 102ms", "server").?);
|
||||
try std.testing.expectEqual(StepStatus.success, parseInstallStatus("install client ziex_app success", "client").?);
|
||||
try std.testing.expectEqual(@as(?StepStatus, null), parseInstallStatus("install ziex_app success", "server"));
|
||||
}
|
||||
|
||||
test "stripTreePrefix handles unicode and ascii trees" {
|
||||
try std.testing.expectEqualStrings("install server x success", stripTreePrefix("│ └─ install server x success"));
|
||||
try std.testing.expectEqualStrings("install server x success", stripTreePrefix("| +- install server x success"));
|
||||
try std.testing.expectEqualStrings("install x success", stripTreePrefix("├─ install x success"));
|
||||
}
|
||||
|
||||
test "stripAnsiInPlace removes dim codes" {
|
||||
const out = stripAnsiInPlace("install [2mserver[0m ziex_app success");
|
||||
try std.testing.expectEqualStrings("install server ziex_app success", out);
|
||||
}
|
||||
|
||||
test "FirstOutput.txt: first cycle is success, second is cached" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
try feedLines(&state, sample_first, &events);
|
||||
|
||||
// Cycle 1: should_restart (first build done).
|
||||
// Cycle 2: build_complete_no_change (everything cached) - but FirstOutput
|
||||
// doesn't terminate cycle 2's tree with a blank line; the stream just ends.
|
||||
// We don't require the second event, but the first must be a restart.
|
||||
var found_restart = false;
|
||||
for (events.items) |e| {
|
||||
if (e == .should_restart) {
|
||||
found_restart = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
try std.testing.expect(found_restart);
|
||||
}
|
||||
|
||||
test "FirstOutput.txt: second cycle is no-change (all cached)" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
// Append a trailing blank line so the second tree finalizes.
|
||||
const padded = try std.mem.concat(allocator, u8, &.{ sample_first, "\n\n" });
|
||||
defer allocator.free(padded);
|
||||
|
||||
try feedLines(&state, padded, &events);
|
||||
|
||||
var restart_count: usize = 0;
|
||||
var no_change_count: usize = 0;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => restart_count += 1,
|
||||
.build_complete_no_change => no_change_count += 1,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expectEqual(@as(usize, 1), restart_count);
|
||||
try std.testing.expectEqual(@as(usize, 1), no_change_count);
|
||||
}
|
||||
|
||||
test "ChangeOutput.txt: server+client success triggers should_restart" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
// Trailing blank to finalize the tree.
|
||||
const padded = try std.mem.concat(allocator, u8, &.{ sample_change, "\n\n" });
|
||||
defer allocator.free(padded);
|
||||
|
||||
try feedLines(&state, padded, &events);
|
||||
|
||||
var found_restart = false;
|
||||
var found_no_change = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => found_restart = true,
|
||||
.build_complete_no_change => found_no_change = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_restart);
|
||||
try std.testing.expect(!found_no_change);
|
||||
}
|
||||
|
||||
test "synthetic: all-cached tree emits no_change, not restart" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"install -C .zig-cache/o/abc/main.wasm /proj/zig-out/static/assets/_/main.wasm\n" ++
|
||||
"install -C .zig-cache/o/abc/ziex_app /proj/zig-out/bin/ziex_app\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install cached\n" ++
|
||||
"├─ install ziex_app cached\n" ++
|
||||
"│ └─ install server ziex_app cached 102ms MaxRSS:32M\n" ++
|
||||
"└─ install client ziex_app cached\n" ++
|
||||
" └─ compile exe main Debug wasm32-freestanding-none cached 80ms\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_restart = false;
|
||||
var found_no_change = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => found_restart = true,
|
||||
.build_complete_no_change => found_no_change = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(!found_restart);
|
||||
try std.testing.expect(found_no_change);
|
||||
}
|
||||
|
||||
test "synthetic: server success only (zx edit rebuilds server)" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install success\n" ++
|
||||
"├─ install ziex_app success\n" ++
|
||||
"│ └─ install server ziex_app success 5s MaxRSS:680M\n" ++
|
||||
"└─ install client ziex_app cached\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_restart = false;
|
||||
for (events.items) |e| if (e == .should_restart) {
|
||||
found_restart = true;
|
||||
};
|
||||
try std.testing.expect(found_restart);
|
||||
}
|
||||
|
||||
test "synthetic: client success only (zx edit rebuilds wasm)" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install success\n" ++
|
||||
"├─ install ziex_app success\n" ++
|
||||
"│ └─ install server ziex_app cached 102ms\n" ++
|
||||
"└─ install client ziex_app success 928ms\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_restart = false;
|
||||
var found_no_change = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => found_restart = true,
|
||||
.build_complete_no_change => found_no_change = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_restart);
|
||||
try std.testing.expect(!found_no_change);
|
||||
}
|
||||
|
||||
test "synthetic: asset-only change emits assets_installed" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"install -C /proj/app/assets/style.css /proj/zig-out/static/assets/style.css\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install success\n" ++
|
||||
"├─ install ziex_app cached\n" ++
|
||||
"│ └─ install server ziex_app cached 102ms\n" ++
|
||||
"│ ├─ install app/assets/ success\n" ++
|
||||
"└─ install client ziex_app cached\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_assets = false;
|
||||
var found_restart = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.assets_installed => |a| {
|
||||
try std.testing.expect(a.files.len >= 1);
|
||||
found_assets = true;
|
||||
},
|
||||
.should_restart => found_restart = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_assets);
|
||||
try std.testing.expect(!found_restart);
|
||||
}
|
||||
|
||||
test "error build cycle emits errors" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
try feedLines(&state, err_sample, &events);
|
||||
|
||||
var found_errors = false;
|
||||
for (events.items) |*e| switch (e.*) {
|
||||
.errors => |r| {
|
||||
try std.testing.expect(r.diagnostics.len > 0);
|
||||
try std.testing.expectEqualStrings("expected ',' after field", r.diagnostics[0].message);
|
||||
try std.testing.expectEqual(DiagKind.@"error", r.diagnostics[0].kind);
|
||||
found_errors = true;
|
||||
},
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_errors);
|
||||
}
|
||||
|
||||
test "error then fix: error event then later resolved" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
try feedLines(&state, sample_err_then_fix, &events);
|
||||
|
||||
var saw_error = false;
|
||||
var saw_restart_or_resolved = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.errors => saw_error = true,
|
||||
.should_restart, .resolved => saw_restart_or_resolved = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(saw_error);
|
||||
try std.testing.expect(saw_restart_or_resolved);
|
||||
}
|
||||
|
||||
test "windows watch output detects build start and restart" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.os_tag = .windows;
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
// Pad with a trailing blank line to finalize the tree.
|
||||
const padded = try std.mem.concat(allocator, u8, &.{ sample_win, "\n\n" });
|
||||
defer allocator.free(padded);
|
||||
|
||||
try feedLines(&state, padded, &events);
|
||||
|
||||
// Output_Win.txt is two cycles glued together with the summary tree of
|
||||
// the FIRST cycle showing all-cached, then a new build-exe starts cycle 2.
|
||||
var change_count: usize = 0;
|
||||
for (events.items) |e| if (e == .change_detected) {
|
||||
change_count += 1;
|
||||
};
|
||||
try std.testing.expect(change_count >= 1);
|
||||
}
|
||||
|
||||
test "parseDiagnostic - errors" {
|
||||
const allocator = std.testing.allocator;
|
||||
const diag = parseDiagnostic(allocator, ".zig-cache/app/pages/page.zig:95:12: error: expected ',' after field").?;
|
||||
defer allocator.free(diag.file);
|
||||
defer allocator.free(diag.message);
|
||||
try std.testing.expectEqualStrings(".zig-cache/app/pages/page.zig", diag.file);
|
||||
try std.testing.expectEqual(@as(u32, 95), diag.line);
|
||||
try std.testing.expectEqual(@as(u32, 12), diag.col);
|
||||
}
|
||||
|
||||
test "isBuildCommand handles windows zig path and rejects other tools" {
|
||||
try std.testing.expect(isBuildCommandForOs(.windows, "\"C:\\\\Users\\\\x\\\\zig.exe\" build-exe -ODebug"));
|
||||
try std.testing.expect(isBuildCommandForOs(.macos, "/Users/x/.asdf/installs/zig/0.16.0/zig build-lib -ODebug"));
|
||||
try std.testing.expect(!isBuildCommandForOs(.windows, "install -C foo bar"));
|
||||
}
|
||||
|
||||
test "parseDurationMs handles common units" {
|
||||
try std.testing.expectEqual(@as(?u64, 23), parseDurationMs("23ms"));
|
||||
try std.testing.expectEqual(@as(?u64, 1500), parseDurationMs("1.5s"));
|
||||
try std.testing.expectEqual(@as(?u64, null), parseDurationMs("cached"));
|
||||
}
|
||||
|
||||
test "parseUserAssetInstall extracts web path" {
|
||||
const a = parseUserAssetInstall("install -C /proj/app/public/favicon.ico /proj/zig-out/static/favicon.ico").?;
|
||||
try std.testing.expectEqualStrings("favicon.ico", a.web_path);
|
||||
try std.testing.expect(parseUserAssetInstall("install -C .zig-cache/o/abc/main.wasm /proj/zig-out/static/assets/_/main.wasm") == null);
|
||||
}
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
./.zig-cache/o/0dd1e53085f7ac550c714172e2b3d2ee/zx transpile /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app --outdir ./.zig-cache/tmp/f902814f93223aff/app --rootdir /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static --dep-file ./.zig-cache/tmp/f902814f93223aff/transpile.d --map inline --cache-dir .zig-cache/zx_transpile
|
||||
/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/node_modules/.bin/esbuild /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/scripts/client.ts --bundle --outfile=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.js --log-level=error --sourcemap=inline --define:__DEV__=true "--define:process.env.NODE_ENV=\"development\""
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/jsz/src/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/9cc260c2c43c5d8c9bcf68e69db2036a/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep js --dep zx_style --dep zx_info --dep zx_options=zx_options0 --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/46d04359730ac4021c9189d199119a0c/app/meta.zig -Mzx_options0=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/adbafb1f5a2085d4e2e4d717bd668812/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/46d04359730ac4021c9189d199119a0c/app/meta.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig -Mbuild0=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C .zig-cache/o/b3c6439c1ec80b8b11d2cd80c7a37d3d/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.wasm
|
||||
install -C .zig-cache/o/6352b563e71ad4ef29bd19bf931cb999/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/bin/ziex_app
|
||||
Build Summary: 32/32 steps succeeded
|
||||
install success
|
||||
├─ install ziex_app success
|
||||
│ └─ install server ziex_app success 5s MaxRSS:673M
|
||||
│ ├─ install app/public/ cached
|
||||
│ ├─ install app/assets/ cached
|
||||
│ ├─ install dependency to static/assets/_/main.js cached
|
||||
│ ├─ zx transpile success 74ms
|
||||
│ │ └─ compile exe zx Debug native cached 7s MaxRSS:802M
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ WriteFile . cached
|
||||
│ │ ├─ compile lib tree-sitter Debug native cached 67ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree-sitter Debug native (reused)
|
||||
│ │ ├─ WriteFile cached
|
||||
│ │ ├─ compile lib tree_sitter_zx Debug native cached 65ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree_sitter_zx Debug native (reused)
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ WriteFile cached
|
||||
│ │ ├─ compile lib tree_sitter_mdzx Debug native cached 63ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree_sitter_mdzx Debug native (reused)
|
||||
│ │ └─ options cached
|
||||
│ ├─ esbuild success 34ms
|
||||
│ │ └─ zx transpile (+1 more reused dependencies)
|
||||
│ ├─ options cached
|
||||
│ ├─ options cached
|
||||
│ ├─ options cached
|
||||
│ ├─ generate zx injections cached
|
||||
│ ├─ zx transpile (+1 more reused dependencies)
|
||||
│ ├─ options (reused)
|
||||
│ └─ options (reused)
|
||||
└─ install client ziex_app success
|
||||
└─ compile exe main Debug wasm32-freestanding-none success 960ms MaxRSS:283M
|
||||
├─ zx transpile (+1 more reused dependencies)
|
||||
├─ options cached
|
||||
├─ options (reused)
|
||||
├─ options cached
|
||||
├─ generate zx injections (reused)
|
||||
├─ zx transpile (+1 more reused dependencies)
|
||||
└─ options cached
|
||||
@ -1,106 +0,0 @@
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/src/lib.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/include -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/src -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/src/wasm -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE= -D_BSD_SOURCE= -D_DARWIN_C_SOURCE= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree-sitter -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-mdzx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/tree-sitter-mdzx/src -DTREE_SITTER_DEBUG= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_mdzx -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-zx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/tree-sitter-zx/src -DTREE_SITTER_DEBUG= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_zx -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/ziex_js-0.1.0-dev.804-v1W0GXFyAwBPFp90LeyI_plexclVbbXIj_kN-iKxmalY/wasm/init.js /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.js
|
||||
install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/public/favicon.ico /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/favicon.ico
|
||||
install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/assets/style.css /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/style.css
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep cli_options --dep zx --dep zli --dep tree_sitter --dep tree_sitter_zx --dep build_options -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/main.zig -Mcli_options=.zig-cache/c/89059958ab4126294329cf4e79b27d5f/options.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_core_lang --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_meta --dep zx_injections -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -fno-single-threaded -ODebug -Mzli=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cliz/src/zli.zig .zig-cache/o/2b9d4d55be3f6ba8b26fd1c3d80d2cb2/libtree-sitter.a -ODebug -I .zig-cache/o/3fd8826528e39a25d8911b429f17b911 --dep build -Mtree_sitter=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/zig-tree-sitter/src/root.zig .zig-cache/o/6546f61c1e1562b795e0d4e81c87e474/libtree_sitter_zx.a -ODebug -I .zig-cache/o/2fb5824d4233e9fe32370ab196a5b16d -Mtree_sitter_zx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-zx/bindings/zig/root.zig -Mbuild_options=.zig-cache/c/da12794a2af4c375b95bf33473f9fbe2/options.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build=build0 -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug --dep tree_sitter --dep tree_sitter_zx --dep tree_sitter_mdzx -Mzx_core_lang=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/core/root.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig -Mzx_module_options=.zig-cache/c/96c7368497eb1889e2578f8b1df8fa11/options.zig --dep zx -Mzx_meta=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/build/stub_meta.zig -Mzx_injections=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/build/stubs/injections.zig -Mbuild=.zig-cache/c/6f41b5bb5e7b7c024586754b5fcf386c/options.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build1 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild0=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig .zig-cache/o/892b70225ed7bacef116058ec3a83e6e/libtree_sitter_mdzx.a -ODebug -I .zig-cache/o/2fb5824d4233e9fe32370ab196a5b16d -Mtree_sitter_mdzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-mdzx/bindings/zig/root.zig -Mbuild1=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name zx --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
./.zig-cache/o/0dd1e53085f7ac550c714172e2b3d2ee/zx transpile /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app --outdir ./.zig-cache/tmp/beb264a0048951d7/app --rootdir /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static --dep-file ./.zig-cache/tmp/beb264a0048951d7/transpile.d --map inline --cache-dir .zig-cache/zx_transpile
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/jsz/src/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/9cc260c2c43c5d8c9bcf68e69db2036a/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep js --dep zx_style --dep zx_info --dep zx_options=zx_options0 --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/d0cc3c541b9b77710d9638e21bb9cdc6/app/meta.zig -Mzx_options0=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/node_modules/.bin/esbuild /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/scripts/client.ts --bundle --outfile=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.js --log-level=error --sourcemap=inline --define:__DEV__=true "--define:process.env.NODE_ENV=\"development\""
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/adbafb1f5a2085d4e2e4d717bd668812/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/d0cc3c541b9b77710d9638e21bb9cdc6/app/meta.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig -Mbuild0=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C .zig-cache/o/2697fe165a84c48fa6fe203f323d373b/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.wasm
|
||||
install -C .zig-cache/o/1a0728b27bee4f01320714291a3368be/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/bin/ziex_app
|
||||
Build Summary: 32/32 steps succeeded
|
||||
install success
|
||||
├─ install ziex_app success
|
||||
│ └─ install server ziex_app success 35s MaxRSS:964M
|
||||
│ ├─ install app/public/ cached
|
||||
│ ├─ install app/assets/ cached
|
||||
│ ├─ install dependency to static/assets/_/main.js cached
|
||||
│ ├─ zx transpile success 919ms
|
||||
│ │ └─ compile exe zx Debug native success 7s MaxRSS:802M
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ WriteFile . cached
|
||||
│ │ ├─ compile lib tree-sitter Debug native cached 67ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree-sitter Debug native (reused)
|
||||
│ │ ├─ WriteFile cached
|
||||
│ │ ├─ compile lib tree_sitter_zx Debug native cached 65ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree_sitter_zx Debug native (reused)
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ WriteFile cached
|
||||
│ │ ├─ compile lib tree_sitter_mdzx Debug native cached 63ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree_sitter_mdzx Debug native (reused)
|
||||
│ │ └─ options cached
|
||||
│ ├─ esbuild success 38ms
|
||||
│ │ └─ zx transpile (+1 more reused dependencies)
|
||||
│ ├─ options cached
|
||||
│ ├─ options cached
|
||||
│ ├─ options cached
|
||||
│ ├─ generate zx injections success
|
||||
│ ├─ zx transpile (+1 more reused dependencies)
|
||||
│ ├─ options (reused)
|
||||
│ └─ options (reused)
|
||||
└─ install client ziex_app success
|
||||
└─ compile exe main Debug wasm32-freestanding-none success 928ms MaxRSS:283M
|
||||
├─ zx transpile (+1 more reused dependencies)
|
||||
├─ options cached
|
||||
├─ options (reused)
|
||||
├─ options cached
|
||||
├─ generate zx injections (reused)
|
||||
├─ zx transpile (+1 more reused dependencies)
|
||||
└─ options cached
|
||||
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/jsz/src/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/9cc260c2c43c5d8c9bcf68e69db2036a/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep js --dep zx_style --dep zx_info --dep zx_options=zx_options0 --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/d0cc3c541b9b77710d9638e21bb9cdc6/app/meta.zig -Mzx_options0=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/adbafb1f5a2085d4e2e4d717bd668812/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/d0cc3c541b9b77710d9638e21bb9cdc6/app/meta.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig -Mbuild0=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C .zig-cache/o/2697fe165a84c48fa6fe203f323d373b/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.wasm
|
||||
install -C .zig-cache/o/1a0728b27bee4f01320714291a3368be/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/bin/ziex_app
|
||||
Build Summary: 32/32 steps succeeded
|
||||
install cached
|
||||
├─ install ziex_app cached
|
||||
│ └─ install server ziex_app cached 102ms MaxRSS:32M
|
||||
│ ├─ install app/public/ cached
|
||||
│ ├─ install app/assets/ cached
|
||||
│ ├─ install dependency to static/assets/_/main.js cached
|
||||
│ ├─ zx transpile cached 919ms
|
||||
│ │ └─ compile exe zx Debug native cached 7s MaxRSS:802M
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ WriteFile . cached
|
||||
│ │ ├─ compile lib tree-sitter Debug native cached 67ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree-sitter Debug native (reused)
|
||||
│ │ ├─ WriteFile cached
|
||||
│ │ ├─ compile lib tree_sitter_zx Debug native cached 65ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree_sitter_zx Debug native (reused)
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ options cached
|
||||
│ │ ├─ WriteFile cached
|
||||
│ │ ├─ compile lib tree_sitter_mdzx Debug native cached 63ms MaxRSS:30M
|
||||
│ │ ├─ compile lib tree_sitter_mdzx Debug native (reused)
|
||||
│ │ └─ options cached
|
||||
│ ├─ esbuild cached 38ms
|
||||
│ │ └─ zx transpile (+1 more reused dependencies)
|
||||
│ ├─ options cached
|
||||
│ ├─ options cached
|
||||
│ ├─ options cached
|
||||
│ ├─ generate zx injections cached
|
||||
│ ├─ zx transpile (+1 more reused dependencies)
|
||||
│ ├─ options (reused)
|
||||
│ └─ options (reused)
|
||||
└─ install client ziex_app cached
|
||||
└─ compile exe main Debug wasm32-freestanding-none cached 80ms MaxRSS:32M
|
||||
├─ zx transpile (+1 more reused dependencies)
|
||||
├─ options cached
|
||||
├─ options (reused)
|
||||
├─ options cached
|
||||
├─ generate zx injections (reused)
|
||||
├─ zx transpile (+1 more reused dependencies)
|
||||
└─ options cached
|
||||
@ -1,114 +0,0 @@
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-mdzx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/tree-sitter-mdzx/src -DTREE_SITTER_DEBUG= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_mdzx -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/assets/style.css /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/style.css
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/src/lib.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/include -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/src -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/tree_sitter-0.27.0-Tw2sR0TDCwBUIKjCd2avkJKfxXvSNZmdynJqiXMUYgAv/lib/src/wasm -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE= -D_BSD_SOURCE= -D_DARWIN_C_SOURCE= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree-sitter -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/ziex_js-0.1.0-dev.804-v1W0GXFyAwBPFp90LeyI_plexclVbbXIj_kN-iKxmalY/wasm/init.js /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.js
|
||||
install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/public/favicon.ico /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/favicon.ico
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-zx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/tree-sitter-zx/src -DTREE_SITTER_DEBUG= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_zx -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep cli_options --dep zx --dep zli --dep tree_sitter --dep tree_sitter_zx --dep build_options -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/main.zig -Mcli_options=.zig-cache/c/89059958ab4126294329cf4e79b27d5f/options.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_core_lang --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_meta --dep zx_injections -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -fno-single-threaded -ODebug -Mzli=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cliz/src/zli.zig .zig-cache/o/62026befe52e9e65ac3e1ed82daa0832/libtree-sitter.a -ODebug -I .zig-cache/o/3fd8826528e39a25d8911b429f17b911 --dep build -Mtree_sitter=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/zig-tree-sitter/src/root.zig .zig-cache/o/38584ee8050f3a4f309748d6a72cc850/libtree_sitter_zx.a -ODebug -I .zig-cache/o/2fb5824d4233e9fe32370ab196a5b16d -Mtree_sitter_zx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-zx/bindings/zig/root.zig -Mbuild_options=.zig-cache/c/da12794a2af4c375b95bf33473f9fbe2/options.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build=build0 -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug --dep tree_sitter --dep tree_sitter_zx --dep tree_sitter_mdzx -Mzx_core_lang=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/core/root.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig -Mzx_module_options=.zig-cache/c/96c7368497eb1889e2578f8b1df8fa11/options.zig --dep zx -Mzx_meta=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/build/stub_meta.zig -Mzx_injections=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/build/stubs/injections.zig -Mbuild=.zig-cache/c/6f41b5bb5e7b7c024586754b5fcf386c/options.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build1 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild0=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig .zig-cache/o/bd9d6a619910da8ff30e857e3458d47b/libtree_sitter_mdzx.a -ODebug -I .zig-cache/o/2fb5824d4233e9fe32370ab196a5b16d -Mtree_sitter_mdzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/tree-sitter-mdzx/bindings/zig/root.zig -Mbuild1=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name zx --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
./.zig-cache/o/99a58bae3d46949d7bb012b59cd10d91/zx transpile /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app --outdir ./.zig-cache/tmp/e29e7f0527c18596/app --rootdir /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static --dep-file ./.zig-cache/tmp/e29e7f0527c18596/transpile.d --map inline --cache-dir .zig-cache/zx_transpile
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/jsz/src/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/9cc260c2c43c5d8c9bcf68e69db2036a/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep js --dep zx_style --dep zx_info --dep zx_options=zx_options0 --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/a37bc1d144915a2ef218b91bf20f59d5/app/meta.zig -Mzx_options0=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/node_modules/.bin/esbuild /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/scripts/client.ts --bundle --outfile=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.js --log-level=error --sourcemap=inline --define:__DEV__=true "--define:process.env.NODE_ENV=\"development\""
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/adbafb1f5a2085d4e2e4d717bd668812/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/a37bc1d144915a2ef218b91bf20f59d5/app/meta.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig -Mbuild0=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C .zig-cache/o/95e41f39de71c7ac70058b9458366d89/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.wasm
|
||||
install -C .zig-cache/o/6f22ba297ccc4e9a66a1f9de38421942/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/bin/ziex_app
|
||||
Build Summary: 32/32 steps succeeded
|
||||
install success
|
||||
+- install ziex_app success
|
||||
| +- install [2mserver[0m ziex_app success 5s MaxRSS:680M
|
||||
| +- install app/public/ cached
|
||||
| +- install app/assets/ cached
|
||||
| +- install dependency to static/assets/_/main.js success
|
||||
| +- zx transpile success 673ms
|
||||
| | +- compile exe zx Debug native success 6s MaxRSS:797M
|
||||
| | +- options cached
|
||||
| | +- WriteFile . cached
|
||||
| | +- compile lib tree-sitter Debug native cached 66ms MaxRSS:30M
|
||||
| | +- compile lib tree-sitter Debug native (reused)
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_zx Debug native cached 63ms MaxRSS:30M
|
||||
| | +- compile lib tree_sitter_zx Debug native (reused)
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_mdzx Debug native cached 63ms MaxRSS:30M
|
||||
| | +- compile lib tree_sitter_mdzx Debug native (reused)
|
||||
| | +- options cached
|
||||
| +- esbuild success 31ms
|
||||
| | +- zx transpile (+1 more reused dependencies)
|
||||
| +- options cached
|
||||
| +- options cached
|
||||
| +- options cached
|
||||
| +- generate zx injections success
|
||||
| +- zx transpile (+1 more reused dependencies)
|
||||
| +- options (reused)
|
||||
| +- options (reused)
|
||||
+- install [2mclient[0m ziex_app success
|
||||
+- compile exe main Debug wasm32-freestanding-none success 889ms MaxRSS:276M
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options cached
|
||||
+- options (reused)
|
||||
+- options cached
|
||||
+- generate zx injections (reused)
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options cached
|
||||
|
||||
./.zig-cache/o/99a58bae3d46949d7bb012b59cd10d91/zx transpile /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app --outdir ./.zig-cache/tmp/81837c9a5c5f5335/app --rootdir /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static --dep-file ./.zig-cache/tmp/81837c9a5c5f5335/transpile.d --map inline --cache-dir .zig-cache/zx_transpile
|
||||
/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/node_modules/.bin/esbuild /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/scripts/client.ts --bundle --outfile=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.js --log-level=error --sourcemap=inline --define:__DEV__=true "--define:process.env.NODE_ENV=\"development\""
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/jsz/src/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/9cc260c2c43c5d8c9bcf68e69db2036a/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep js --dep zx_style --dep zx_info --dep zx_options=zx_options0 --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/e750e0dc4139f3f3cb68fa49525de27f/app/meta.zig -Mzx_options0=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/adbafb1f5a2085d4e2e4d717bd668812/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/e750e0dc4139f3f3cb68fa49525de27f/app/meta.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig -Mbuild0=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
install -C .zig-cache/o/1a058291aa53ed86d856948bff30496c/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.wasm
|
||||
install -C .zig-cache/o/e3afaedccad00febf22c51c8806a52d7/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/bin/ziex_app
|
||||
Build Summary: 32/32 steps succeeded
|
||||
install success
|
||||
+- install ziex_app success
|
||||
| +- install [2mserver[0m ziex_app success 5s MaxRSS:667M
|
||||
| +- install app/public/ cached
|
||||
| +- install app/assets/ cached
|
||||
| +- install dependency to static/assets/_/main.js cached
|
||||
| +- zx transpile success 57ms
|
||||
| | +- compile exe zx Debug native cached 6s MaxRSS:797M
|
||||
| | +- options cached
|
||||
| | +- WriteFile . cached
|
||||
| | +- compile lib tree-sitter Debug native cached 66ms MaxRSS:30M
|
||||
| | +- compile lib tree-sitter Debug native (reused)
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_zx Debug native cached 63ms MaxRSS:30M
|
||||
| | +- compile lib tree_sitter_zx Debug native (reused)
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_mdzx Debug native cached 63ms MaxRSS:30M
|
||||
| | +- compile lib tree_sitter_mdzx Debug native (reused)
|
||||
| | +- options cached
|
||||
| +- esbuild success 12ms
|
||||
| | +- zx transpile (+1 more reused dependencies)
|
||||
| +- options cached
|
||||
| +- options cached
|
||||
| +- options cached
|
||||
| +- generate zx injections cached
|
||||
| +- zx transpile (+1 more reused dependencies)
|
||||
| +- options (reused)
|
||||
| +- options (reused)
|
||||
+- install [2mclient[0m ziex_app success
|
||||
+- compile exe main Debug wasm32-freestanding-none success 887ms MaxRSS:281M
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options cached
|
||||
+- options (reused)
|
||||
+- options cached
|
||||
+- generate zx injections (reused)
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options cached
|
||||
|
||||
install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/assets/style.css /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/style.css
|
||||
./.zig-cache/o/99a58bae3d46949d7bb012b59cd10d91/zx transpile /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app --outdir ./.zig-cache/tmp/91ada7cfc2a1ca0b/app --rootdir /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static --dep-file ./.zig-cache/tmp/91ada7cfc2a1ca0b/transpile.d --map inline --cache-dir .zig-cache/zx_transpile
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/jsz/src/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/9cc260c2c43c5d8c9bcf68e69db2036a/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep js --dep zx_style --dep zx_info --dep zx_options=zx_options0 --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/5cbd024e8bdb83ee43937153eabb9b45/app/meta.zig -Mzx_options0=.zig-cache/c/2106c2b1c67bd4c1c2d4e42593260221/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/node_modules/.bin/esbuild /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/scripts/client.ts --bundle --outfile=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-out/static/assets/_/main.js --log-level=error --sourcemap=inline --define:__DEV__=true "--define:process.env.NODE_ENV=\"development\""
|
||||
/Users/nurulhudaapon/.asdf/installs/zig/0.16.0/zig build-exe -ODebug --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/app/main.zig -ODebug --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx_meta -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/root.zig -ODebug -Mdb=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db.zig -cflags -std=c99 -DSQLITE_DQS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_USE_ALLOCA=1 -DSQLITE_THREADSAFE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_API_ARMOR=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 -DSQLITE_OMIT_DEPRECATED=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_OMIT_PROGRESS_CALLBACK=1 -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TRACE=1 -DSQLITE_OMIT_UTF16=1 -DHAVE_USLEEP=0 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/sqlite/sqlite3.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite --dep db --dep zqlite -Mdb_sqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/src/db/sqlite.zig -ODebug -Mcachez=/Users/nurulhudaapon/Projects/ziex-dev/ziex/vendor/cachez/src/cache.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/httpz-0.0.0-PNVzrJUWCADf96eygXxMPMSWJ-SMNkGDB1B6BUEP7dZZ/src/httpz.zig -ODebug -Mzx_style=/Users/nurulhudaapon/Projects/ziex-dev/ziex/src/style/root.zig -Mzx_info=.zig-cache/c/03446054f2e6729e59f2aaf4bb182b05/options.zig -Mzx_options=.zig-cache/c/8f276f8c5d2435506ddd2860320162ff/options.zig -Mzx_module_options=.zig-cache/c/adbafb1f5a2085d4e2e4d717bd668812/options.zig -Mzx_injections=.zig-cache/zx_injections.zig --dep db --dep db_sqlite --dep cachez --dep httpz --dep zx_style --dep zx_info --dep zx_options --dep zx_module_options --dep zx_injections --dep zx -Mzx_meta=.zig-cache/o/5cbd024e8bdb83ee43937153eabb9b45/app/meta.zig -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/../../pkg/adapters/vendor/sqlite -Mzqlite=/Users/nurulhudaapon/Projects/ziex-dev/ziex/pkg/adapters/vendor/zqlite/src/zqlite.zig -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/metrics-0.0.0-W7G4eIegAQD4XxA9Co7Atbw59u_2zvxYf406AZuoAHPM/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/templates/_base/zig-pkg/websocket-0.1.0-ZPISdUU6BAAPe0iZ_JHMVAXaBlz327xZRBrRY06-Vw5h/src/websocket.zig -Mbuild=.zig-cache/c/588d8e90b2ff6dc0bd7ddf1ba6f5872d/options.zig -Mbuild0=.zig-cache/c/cc544fc8f162c327786efad17dbbf432/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/0.16.0/lib/ --listen=-
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,591 +0,0 @@
|
||||
const Element = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const assert = std.debug.assert;
|
||||
const Allocator = std.mem.Allocator;
|
||||
const root = @import("html.zig");
|
||||
const Language = root.Language;
|
||||
const Span = root.Span;
|
||||
const Ast = @import("Ast.zig");
|
||||
const Error = Ast.Error;
|
||||
const Kind = Ast.Kind;
|
||||
const Tokenizer = @import("Tokenizer.zig");
|
||||
const Attribute = @import("Attribute.zig");
|
||||
|
||||
const log = std.log.scoped(.element);
|
||||
|
||||
tag: Kind,
|
||||
|
||||
/// The static model of this element. Static means the combination of
|
||||
/// categories and content model that the element has without any change
|
||||
/// that could be caused by the presence/absence of attributes or nested
|
||||
/// content.
|
||||
model: Model,
|
||||
|
||||
/// Support information used for computing completions and deriving reasons
|
||||
/// behind errors caused by non-static model changes.
|
||||
meta: struct {
|
||||
categories_superset: Categories,
|
||||
content_reject: Categories = .none,
|
||||
extra_reject: Extra = .none,
|
||||
},
|
||||
|
||||
/// Strings used to explain reasons behind errors caused by non-static model
|
||||
/// changes.
|
||||
reasons: Reasons = .{},
|
||||
|
||||
/// Attribute validation.
|
||||
attributes: union(enum) {
|
||||
/// Attribute validation will not be performed when adding the element to
|
||||
/// the AST. Used by:
|
||||
/// - `<source>`, validated by parent elements
|
||||
/// - `<optgroup>`, validated while validating children
|
||||
manual,
|
||||
static,
|
||||
/// Custom attribute validation. Has also access to the incomplete AST to
|
||||
/// navigate ancestry when necessary. Any constraint that requires knowledge
|
||||
/// of descendants must be evaluated in the content callback.
|
||||
/// NOTE: node_idx is not yet present in the AST, to navigate upwards use
|
||||
/// parent_idx directly.
|
||||
dynamic: *const fn (
|
||||
gpa: Allocator,
|
||||
errors: *std.ArrayListUnmanaged(Error),
|
||||
src: []const u8,
|
||||
nodes: []const Ast.Node,
|
||||
parent_idx: u32,
|
||||
node_idx: u32,
|
||||
vait: *Attribute.ValidatingIterator,
|
||||
) error{OutOfMemory}!Model,
|
||||
},
|
||||
|
||||
/// Content validation and completions.
|
||||
content: union(enum) {
|
||||
model,
|
||||
anything,
|
||||
simple: Simple,
|
||||
custom: struct {
|
||||
validate: *const fn (
|
||||
gpa: Allocator,
|
||||
nodes: []const Ast.Node,
|
||||
seen_attrs: *std.StringHashMapUnmanaged(Span),
|
||||
seen_ids: *std.StringHashMapUnmanaged(Span),
|
||||
errors: *std.ArrayListUnmanaged(Ast.Error),
|
||||
src: []const u8,
|
||||
parent_idx: u32,
|
||||
) error{OutOfMemory}!void,
|
||||
completions: *const fn (
|
||||
arena: Allocator,
|
||||
ast: Ast,
|
||||
src: []const u8,
|
||||
parent_idx: u32,
|
||||
offset: u32, // cursor position
|
||||
) error{OutOfMemory}![]const Ast.Completion,
|
||||
},
|
||||
},
|
||||
|
||||
desc: []const u8,
|
||||
|
||||
pub const Simple = struct {
|
||||
// Allowed tags that are not part of the allowed categories.
|
||||
extra_children: []const Kind = &.{},
|
||||
// Frobidden tags that are part of the allowed categories.
|
||||
forbidden_children: []const Kind = &.{},
|
||||
// Frobidden tags that are part of the allowed categories,
|
||||
// applies to all descendants, not just direct children.
|
||||
forbidden_descendants: ?std.EnumSet(Kind) = null,
|
||||
forbidden_descendants_extra: Extra = .none,
|
||||
};
|
||||
|
||||
const Reasons = struct {
|
||||
categories: Reasons.Categories = .{},
|
||||
const Categories = struct {
|
||||
// metadata: []const u8 = "",
|
||||
flow: Reason = .{},
|
||||
// sectioning: []const u8 = "",
|
||||
// heading: []const u8 = "",
|
||||
phrasing: Reason = .{},
|
||||
// embedded: []const u8 = "",
|
||||
interactive: Reason = .{},
|
||||
};
|
||||
|
||||
const Reason = struct {
|
||||
reject: []const u8 = "",
|
||||
accept: []const u8 = "",
|
||||
};
|
||||
};
|
||||
|
||||
pub const CompletionMode = enum { content, attrs };
|
||||
|
||||
pub const Set = std.StaticStringMapWithEql(
|
||||
void,
|
||||
std.static_string_map.eqlAsciiIgnoreCase,
|
||||
);
|
||||
|
||||
pub const Model = struct {
|
||||
categories: Categories,
|
||||
content: Categories,
|
||||
extra: Extra = .none,
|
||||
};
|
||||
|
||||
pub const Extra = packed struct {
|
||||
// checked by `a`
|
||||
tabindex: bool = false,
|
||||
|
||||
// set by img elements, used to validate source siblings
|
||||
autosizes_allowed: bool = false,
|
||||
|
||||
pub const none: Extra = .{};
|
||||
|
||||
const Tag = @typeInfo(Extra).@"struct".backing_integer.?;
|
||||
|
||||
// TODO: remove once packed struct comparison works
|
||||
pub inline fn empty(e: Extra) bool {
|
||||
const int: Tag = @bitCast(e);
|
||||
return int == 0;
|
||||
}
|
||||
|
||||
pub inline fn overlaps(lhs: Extra, rhs: Extra) bool {
|
||||
const l: Tag = @bitCast(lhs);
|
||||
const r: Tag = @bitCast(rhs);
|
||||
return (l & r) != 0;
|
||||
}
|
||||
|
||||
pub inline fn intersect(lhs: Extra, rhs: Extra) Extra {
|
||||
const l: Tag = @bitCast(lhs);
|
||||
const r: Tag = @bitCast(rhs);
|
||||
return @bitCast(l & r);
|
||||
}
|
||||
};
|
||||
|
||||
pub const Categories = packed struct {
|
||||
metadata: bool = false,
|
||||
flow: bool = false,
|
||||
phrasing: bool = false,
|
||||
text: bool = false,
|
||||
sectioning: bool = false,
|
||||
heading: bool = false,
|
||||
interactive: bool = false,
|
||||
// embedded: bool = false,
|
||||
|
||||
pub const none: Categories = .{};
|
||||
pub const all: Categories = .{
|
||||
.metadata = true,
|
||||
.flow = true,
|
||||
.phrasing = true,
|
||||
.text = true,
|
||||
.sectioning = true,
|
||||
.heading = true,
|
||||
.interactive = true,
|
||||
// .embedded = true,
|
||||
};
|
||||
// Just for clarity
|
||||
pub const transparent: Categories = .all;
|
||||
|
||||
const Tag = @typeInfo(Categories).@"struct".backing_integer.?;
|
||||
|
||||
// TODO: remove once packed struct comparison works
|
||||
pub inline fn empty(cs: Categories) bool {
|
||||
const int: Tag = @bitCast(cs);
|
||||
return int == 0;
|
||||
}
|
||||
|
||||
pub inline fn overlaps(lhs: Categories, rhs: Categories) bool {
|
||||
const l: Tag = @bitCast(lhs);
|
||||
const r: Tag = @bitCast(rhs);
|
||||
return (l & r) != 0;
|
||||
}
|
||||
|
||||
pub inline fn intersect(lhs: Categories, rhs: Categories) Categories {
|
||||
const l: Tag = @bitCast(lhs);
|
||||
const r: Tag = @bitCast(rhs);
|
||||
return @bitCast(l & r);
|
||||
}
|
||||
|
||||
pub inline fn merge(lhs: Categories, rhs: Categories) Categories {
|
||||
const l: Tag = @bitCast(lhs);
|
||||
const r: Tag = @bitCast(rhs);
|
||||
return @bitCast(l | r);
|
||||
}
|
||||
|
||||
pub inline fn has(cs: Categories, cat: std.meta.FieldEnum(Categories)) bool {
|
||||
return switch (cat) {
|
||||
inline else => |f| @field(cs, @tagName(f)),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
pub const Rejection = struct {
|
||||
reason: []const u8,
|
||||
span: Span,
|
||||
};
|
||||
pub inline fn modelRejects(
|
||||
parent_element: *const Element,
|
||||
nodes: []const Ast.Node,
|
||||
src: []const u8,
|
||||
parent_node: Ast.Node,
|
||||
parent_span: Span,
|
||||
descendant_element: *const Element,
|
||||
descendant_rt_model: Model,
|
||||
) ?Rejection {
|
||||
log.debug("========== modelRejects {t} > {t}", .{
|
||||
parent_element.tag,
|
||||
descendant_element.tag,
|
||||
});
|
||||
|
||||
if (!parent_node.model.content.overlaps(descendant_rt_model.categories)) {
|
||||
log.debug("========== no content - categories overlap {t} > {t}", .{
|
||||
parent_element.tag,
|
||||
descendant_element.tag,
|
||||
});
|
||||
|
||||
if (!parent_element.model.content.overlaps(descendant_rt_model.categories)) {
|
||||
log.debug("========== no static overlap {t} > {t}", .{
|
||||
parent_element.tag,
|
||||
descendant_element.tag,
|
||||
});
|
||||
|
||||
const intersection = parent_node.model.content.intersect(
|
||||
descendant_element.meta.categories_superset,
|
||||
);
|
||||
|
||||
inline for (std.meta.fieldNames(Categories)) |field_name| {
|
||||
if (@field(intersection, field_name) and @hasField(Reasons.Categories, field_name)) {
|
||||
// if this is not a runtime property, report it as the reason
|
||||
if (!@field(descendant_element.model.categories, field_name)) {
|
||||
return .{
|
||||
.reason = @field(descendant_element.reasons.categories, field_name).accept,
|
||||
.span = parent_span,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return .{ .reason = "", .span = parent_span };
|
||||
}
|
||||
|
||||
// Check if the content model of the parent was changed because it's
|
||||
// transparent.
|
||||
log.debug("========== yes static overlap {t} > {t}", .{
|
||||
parent_element.tag,
|
||||
descendant_element.tag,
|
||||
});
|
||||
|
||||
var ancestor_idx = parent_node.parent_idx;
|
||||
while (ancestor_idx != 0) {
|
||||
const ancestor = nodes[ancestor_idx];
|
||||
ancestor_idx = ancestor.parent_idx;
|
||||
|
||||
assert(ancestor.kind.isElement());
|
||||
assert(ancestor.kind != .___);
|
||||
const element = Element.all.get(ancestor.kind);
|
||||
if (!element.model.content.overlaps(descendant_rt_model.categories)) {
|
||||
return .{
|
||||
.reason = "",
|
||||
.span = ancestor.span(src),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// if we reach here it means that we have transparent elements at the
|
||||
// top level of our tree.
|
||||
return .{
|
||||
.reason = "",
|
||||
.span = parent_span,
|
||||
};
|
||||
}
|
||||
|
||||
if (parent_element.meta.content_reject.overlaps(descendant_rt_model.categories)) {
|
||||
const intersection = parent_element.meta.content_reject.intersect(
|
||||
descendant_rt_model.categories,
|
||||
);
|
||||
|
||||
inline for (std.meta.fieldNames(Categories)) |field_name| {
|
||||
if (@field(intersection, field_name) and @hasField(Reasons.Categories, field_name)) {
|
||||
// if this is not a runtime property, report it as the reason
|
||||
if (!@field(descendant_element.model.categories, field_name)) {
|
||||
return .{
|
||||
.reason = @field(descendant_element.reasons.categories, field_name).reject,
|
||||
.span = parent_span,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return .{ .reason = "", .span = parent_span };
|
||||
}
|
||||
|
||||
if (parent_element.meta.extra_reject.tabindex and descendant_rt_model.extra.tabindex) {
|
||||
return .{
|
||||
.span = parent_span,
|
||||
.reason = "presence of tabindex attribute",
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
pub inline fn validateContent(
|
||||
parent_element: *const Element,
|
||||
gpa: Allocator,
|
||||
nodes: []const Ast.Node,
|
||||
seen_attrs: *std.StringHashMapUnmanaged(Span),
|
||||
seen_ids: *std.StringHashMapUnmanaged(Span),
|
||||
errors: *std.ArrayListUnmanaged(Ast.Error),
|
||||
src: []const u8,
|
||||
parent_idx: u32,
|
||||
) !void {
|
||||
content: switch (parent_element.content) {
|
||||
.anything => {},
|
||||
.custom => |custom| try custom.validate(
|
||||
gpa,
|
||||
nodes,
|
||||
seen_attrs,
|
||||
seen_ids,
|
||||
errors,
|
||||
src,
|
||||
parent_idx,
|
||||
),
|
||||
.model => continue :content .{ .simple = .{} },
|
||||
.simple => |simple| {
|
||||
const parent = nodes[parent_idx];
|
||||
const parent_span = parent.startTagIterator(src, .html).name_span;
|
||||
assert(parent.kind.isElement());
|
||||
assert(parent.kind != .___);
|
||||
const first_child_idx = nodes[parent_idx].first_child_idx;
|
||||
|
||||
var child_idx = first_child_idx;
|
||||
outer: while (child_idx != 0) {
|
||||
const child = nodes[child_idx];
|
||||
defer child_idx = child.next_idx;
|
||||
|
||||
switch (child.kind) {
|
||||
else => {},
|
||||
.doctype => continue,
|
||||
.comment => continue,
|
||||
.___ => continue,
|
||||
.text => {
|
||||
if (!parent.model.content.flow and
|
||||
!parent.model.content.phrasing and
|
||||
!parent.model.content.text)
|
||||
{
|
||||
try errors.append(gpa, .{
|
||||
.tag = .{
|
||||
.invalid_nesting = .{
|
||||
.span = parent_span,
|
||||
},
|
||||
},
|
||||
.main_location = child.open,
|
||||
.node_idx = child_idx,
|
||||
});
|
||||
}
|
||||
|
||||
continue;
|
||||
},
|
||||
}
|
||||
|
||||
assert(simple.extra_children.len < 10);
|
||||
for (simple.extra_children) |extra| {
|
||||
if (child.kind == extra) continue :outer;
|
||||
}
|
||||
|
||||
assert(simple.forbidden_children.len < 10);
|
||||
for (simple.forbidden_children) |forbidden| {
|
||||
if (child.kind == forbidden) {
|
||||
try errors.append(gpa, .{
|
||||
.tag = .{
|
||||
.invalid_nesting = .{
|
||||
.span = parent_span,
|
||||
},
|
||||
},
|
||||
.main_location = child.span(src),
|
||||
.node_idx = child_idx,
|
||||
});
|
||||
continue :outer;
|
||||
}
|
||||
}
|
||||
|
||||
if (parent_element.modelRejects(
|
||||
nodes,
|
||||
src,
|
||||
parent,
|
||||
parent_span,
|
||||
&Element.all.get(child.kind),
|
||||
child.model,
|
||||
)) |rejection| {
|
||||
try errors.append(gpa, .{
|
||||
.tag = .{
|
||||
.invalid_nesting = .{
|
||||
.span = rejection.span,
|
||||
.reason = rejection.reason,
|
||||
},
|
||||
},
|
||||
.main_location = child.span(src),
|
||||
.node_idx = child_idx,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (simple.forbidden_descendants == null and
|
||||
simple.forbidden_descendants_extra.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// check descendants
|
||||
if (first_child_idx == 0) return;
|
||||
const stop_idx = parent.stop(nodes);
|
||||
|
||||
var next_idx = first_child_idx;
|
||||
outer: while (next_idx != stop_idx) {
|
||||
assert(next_idx != 0);
|
||||
|
||||
const node_idx = next_idx;
|
||||
const node = nodes[node_idx];
|
||||
|
||||
if (node.kind == .___) {
|
||||
next_idx = node.stop(nodes);
|
||||
continue;
|
||||
} else if (node.kind == .svg or node.kind == .math) {
|
||||
next_idx = node.stop(nodes);
|
||||
} else if (node.kind == .comment or node.kind == .text) {
|
||||
next_idx += 1;
|
||||
continue;
|
||||
} else {
|
||||
next_idx += 1;
|
||||
}
|
||||
|
||||
if (simple.forbidden_descendants) |forbidden| {
|
||||
if (forbidden.contains(node.kind)) {
|
||||
try errors.append(gpa, .{
|
||||
.tag = .{
|
||||
.invalid_nesting = .{
|
||||
.span = parent_span,
|
||||
},
|
||||
},
|
||||
.main_location = node.span(src),
|
||||
.node_idx = node_idx,
|
||||
});
|
||||
continue :outer;
|
||||
}
|
||||
}
|
||||
|
||||
if (simple.forbidden_descendants_extra.tabindex and
|
||||
node.model.extra.tabindex)
|
||||
{
|
||||
try errors.append(gpa, .{
|
||||
.tag = .{
|
||||
.invalid_nesting = .{
|
||||
.span = parent_span,
|
||||
.reason = "presence of [tabindex]",
|
||||
},
|
||||
},
|
||||
.main_location = node.span(src),
|
||||
.node_idx = node_idx,
|
||||
});
|
||||
continue :outer;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub inline fn validateAttrs(
|
||||
element: *const Element,
|
||||
gpa: Allocator,
|
||||
lang: Language,
|
||||
errors: *std.ArrayListUnmanaged(Error),
|
||||
seen_attrs: *std.StringHashMapUnmanaged(Span),
|
||||
seen_ids: *std.StringHashMapUnmanaged(Span),
|
||||
nodes: []const Ast.Node,
|
||||
parent_idx: u32,
|
||||
src: []const u8,
|
||||
tag: Span,
|
||||
node_idx: u32,
|
||||
) error{OutOfMemory}!Model {
|
||||
var vait: Attribute.ValidatingIterator = .init(
|
||||
errors,
|
||||
seen_attrs,
|
||||
seen_ids,
|
||||
lang,
|
||||
tag,
|
||||
src,
|
||||
node_idx,
|
||||
);
|
||||
|
||||
return switch (element.attributes) {
|
||||
.manual => return element.model,
|
||||
.dynamic => |validate| validate(
|
||||
gpa,
|
||||
errors,
|
||||
src,
|
||||
nodes,
|
||||
parent_idx,
|
||||
node_idx,
|
||||
&vait,
|
||||
),
|
||||
.static => blk: {
|
||||
// const max_len = comptime max: {
|
||||
// var max: u32 = 0;
|
||||
// for (Attribute.element_attrs.values[@intFromEnum(Ast.Kind.___) + 1 ..]) |set| {
|
||||
// if (max < set.list.len) max = set.list.len;
|
||||
// }
|
||||
// break :max max;
|
||||
// };
|
||||
|
||||
const attrs_set = Attribute.element_attrs.get(element.tag);
|
||||
var tabindex = false;
|
||||
|
||||
while (try vait.next(gpa, src)) |attr| {
|
||||
const span = attr.name;
|
||||
const name = span.slice(src);
|
||||
|
||||
const attr_model = model: {
|
||||
if (attrs_set.index(name)) |idx| {
|
||||
const model = attrs_set.list[idx].model;
|
||||
break :model model;
|
||||
} else if (Attribute.global.index(name)) |idx| {
|
||||
tabindex |= idx == Attribute.global.comptimeIndex("tabindex");
|
||||
break :model Attribute.global.list[idx].model;
|
||||
} else {
|
||||
if (Attribute.isData(name)) continue;
|
||||
try errors.append(gpa, .{
|
||||
.tag = .invalid_attr,
|
||||
.main_location = span,
|
||||
.node_idx = node_idx,
|
||||
});
|
||||
}
|
||||
continue;
|
||||
};
|
||||
|
||||
try attr_model.rule.validate(gpa, errors, src, node_idx, attr);
|
||||
}
|
||||
|
||||
break :blk .{
|
||||
.content = element.model.content,
|
||||
.categories = element.model.categories,
|
||||
.extra = .{
|
||||
.tabindex = tabindex,
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const KindMap = std.StaticStringMapWithEql(
|
||||
Ast.Kind,
|
||||
std.static_string_map.eqlAsciiIgnoreCase,
|
||||
);
|
||||
|
||||
pub const elements: KindMap = blk: {
|
||||
const fields = std.meta.fields(Ast.Kind)[13..]; // Skip: root, doctype, comment, text, switch_expr, if_expr, for_expr, while_expr, text_expr, extend, super, ctx, ___
|
||||
assert(std.mem.eql(u8, fields[0].name, "a"));
|
||||
|
||||
const KV = struct { []const u8, Ast.Kind };
|
||||
var keys: []const KV = &.{};
|
||||
for (fields) |f| keys = keys ++ &[_]KV{.{
|
||||
f.name,
|
||||
@enumFromInt(f.value),
|
||||
}};
|
||||
|
||||
break :blk .initComptime(keys);
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,122 +0,0 @@
|
||||
const std = @import("std");
|
||||
const Tokenizer = @import("Tokenizer.zig");
|
||||
const Writer = std.Io.Writer;
|
||||
|
||||
pub const HtmlSafe = struct {
|
||||
bytes: []const u8,
|
||||
|
||||
pub fn format(
|
||||
self: HtmlSafe,
|
||||
out_stream: *Writer,
|
||||
) !void {
|
||||
for (self.bytes) |b| {
|
||||
switch (b) {
|
||||
'&' => try out_stream.writeAll("&"),
|
||||
'>' => try out_stream.writeAll(">"),
|
||||
'<' => try out_stream.writeAll("<"),
|
||||
'\'' => try out_stream.writeAll("'"),
|
||||
'\"' => try out_stream.writeAll("""),
|
||||
else => try out_stream.writeByte(b),
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
pub const Language = enum {
|
||||
html,
|
||||
xml,
|
||||
|
||||
/// Use to map file extensions to a Language, supports aliases.
|
||||
pub fn fromSliceResilient(s: []const u8) ?Language {
|
||||
const Alias = enum { html, xml };
|
||||
|
||||
const alias = std.meta.stringToEnum(Alias, s) orelse {
|
||||
return null;
|
||||
};
|
||||
|
||||
return switch (alias) {
|
||||
.html => .html,
|
||||
.xml => .xml,
|
||||
};
|
||||
}
|
||||
};
|
||||
pub const max_size = 4 * 1024 * 1024 * 1024;
|
||||
|
||||
pub const Range = struct {
|
||||
start: Pos,
|
||||
end: Pos,
|
||||
|
||||
const Pos = struct {
|
||||
row: u32,
|
||||
col: u32,
|
||||
};
|
||||
};
|
||||
|
||||
pub const Line = struct { line: []const u8, start: u32 };
|
||||
|
||||
pub const Span = struct {
|
||||
start: u32,
|
||||
end: u32,
|
||||
|
||||
pub fn len(span: Span) u32 {
|
||||
return span.end - span.start;
|
||||
}
|
||||
|
||||
pub fn slice(self: Span, src: []const u8) []const u8 {
|
||||
return src[self.start..self.end];
|
||||
}
|
||||
|
||||
pub fn range(self: Span, code: []const u8) Range {
|
||||
var selection: Range = .{
|
||||
.start = .{ .row = 0, .col = 0 },
|
||||
.end = undefined,
|
||||
};
|
||||
|
||||
for (code[0..self.start]) |c| {
|
||||
if (c == '\n') {
|
||||
selection.start.row += 1;
|
||||
selection.start.col = 0;
|
||||
} else selection.start.col += 1;
|
||||
}
|
||||
|
||||
selection.end = selection.start;
|
||||
for (code[self.start..self.end]) |c| {
|
||||
if (c == '\n') {
|
||||
selection.end.row += 1;
|
||||
selection.end.col = 0;
|
||||
} else selection.end.col += 1;
|
||||
}
|
||||
return selection;
|
||||
}
|
||||
|
||||
/// Finds the line around a Node. Choose simple nodes
|
||||
// if you don't want unwanted newlines in the middle.
|
||||
pub fn line(span: Span, src: []const u8) Line {
|
||||
var idx = span.start;
|
||||
const s = while (idx > 0) : (idx -= 1) {
|
||||
if (src[idx] == '\n') break idx + 1;
|
||||
} else 0;
|
||||
|
||||
idx = span.end;
|
||||
const e = while (idx < src.len) : (idx += 1) {
|
||||
if (src[idx] == '\n') break idx;
|
||||
} else src.len - 1;
|
||||
|
||||
return .{ .line = src[s..e], .start = s };
|
||||
}
|
||||
|
||||
pub fn getName(span: Span, full_src: []const u8, language: Language) Span {
|
||||
var temp_tok: Tokenizer = .{
|
||||
.language = language,
|
||||
.return_attrs = true,
|
||||
.idx = span.start,
|
||||
};
|
||||
|
||||
const src = full_src[0..span.end];
|
||||
return temp_tok.getName(src).?;
|
||||
}
|
||||
|
||||
pub fn debug(span: Span, src: []const u8) void {
|
||||
std.debug.print("{s}", .{span.slice(src)});
|
||||
}
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@ -126,111 +126,4 @@ fn nodeText(node: anytype, source: []const u8) []const u8 {
|
||||
return "";
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Tests
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const testing = std.testing;
|
||||
|
||||
/// Returns the byte offset of the first occurrence of `needle` in `src`, plus
|
||||
/// `into` (used to point inside the match).
|
||||
fn offsetOf(src: []const u8, needle: []const u8, into: u32) u32 {
|
||||
const idx = std.mem.indexOf(u8, src, needle).?;
|
||||
return @intCast(idx + into);
|
||||
}
|
||||
|
||||
test "hover: element tag name" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div class="x">hi</div>);
|
||||
\\}
|
||||
;
|
||||
// Point at the "div" in the start tag.
|
||||
const off = offsetOf(src, "<div", 1);
|
||||
const md = (try hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "<div>") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "generic flow-content") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "specification") != null);
|
||||
}
|
||||
|
||||
test "hover: global attribute name" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div class="x">hi</div>);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "class=", 1);
|
||||
const md = (try hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "class") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "CSS classes") != null);
|
||||
}
|
||||
|
||||
test "hover: element-specific attribute name" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<a href="/x">link</a>);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "href=", 1);
|
||||
const md = (try hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "href") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "hyperlink points to") != null);
|
||||
// The enclosing tag should be reflected.
|
||||
try testing.expect(std.mem.indexOf(u8, md, "<a>") != null);
|
||||
}
|
||||
|
||||
test "hover: unknown element returns null" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<Foo />);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "<Foo", 1);
|
||||
try testing.expect((try hoverMarkdown(arena, src, off)) == null);
|
||||
}
|
||||
|
||||
test "hover: cursor outside tag returns null" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div>hi</div>);
|
||||
\\}
|
||||
;
|
||||
// Point at "Page" — plain Zig, not an HTML tag.
|
||||
const off = offsetOf(src, "Page", 1);
|
||||
try testing.expect((try hoverMarkdown(arena, src, off)) == null);
|
||||
}
|
||||
|
||||
test "hover: void element self-closing tag" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div><br /></div>);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "<br", 1);
|
||||
const md = (try hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "<br>") != null);
|
||||
}
|
||||
|
||||
47
test/cli/ChangeOutput.txt
Normal file
47
test/cli/ChangeOutput.txt
Normal file
@ -0,0 +1,47 @@
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-zx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-zx/src -DTREE_SITTER_DEBUG= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_zx-static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-mdzx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-mdzx/src -DTREE_SITTER_DEBUG=-Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_mdzx -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/src/lib.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/include -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/src -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/src/wasm -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE= -D_BSD_SOURCE= -D_DARWIN_C_SOURCE= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree-sitter -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/ziex_js-0.1.0-dev-v1W0GRqPAwD3VLCRLZRGJnmnjzPCemE0EIU1820xyZBn/wasm/init.js /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/static/assets/_/main.js
|
||||
info(verbose): install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/public/favicon.ico /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/static/favicon.ico
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -ODebug --dep cli_options --dep core_lang --dep zx_info --dep zli --dep tree_sitter --dep tree_sitter_zx --dep build_options --dep app_template -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/main.zig -Mcli_options=.zig-cache/o/4fd11c1ab177b4d15335556679e876a6/options.zig -ODebug --dep tree_sitter --dep tree_sitter_zx --dep tree_sitter_mdzx -Mcore_lang=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/core/root.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -fno-single-threaded -ODebug -Mzli=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../vendor/cliz/src/zli.zig .zig-cache/o/8be9c53d837666244de2b3d6be98a8ba/libtree-sitter.a -ODebug -I .zig-cache/o/47c68f5d5b83c11378c2df69e216399a --dep build -Mtree_sitter=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../vendor/zig-tree-sitter/src/root.zig .zig-cache/o/f47c9b0dbf5f5fa3d79b18b327b2268f/libtree_sitter_zx.a -ODebug -I .zig-cache/o/f1467de1083468613398e9513d83a308 -Mtree_sitter_zx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-zx/bindings/zig/root.zig -Mbuild_options=.zig-cache/o/fb0b7a6008feadd3e0bea3c01a47268f/options.zig -Mapp_template=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../templates/Template.zig .zig-cache/o/18cebcbe4d6a02541af18e9136c3766a/libtree_sitter_mdzx.a -ODebug -I .zig-cache/o/f1467de1083468613398e9513d83a308 -Mtree_sitter_mdzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-mdzx/bindings/zig/root.zig -Mbuild=.zig-cache/o/9fdeaf4c13fa9b525ec2b8ebb9d4e277/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name zx --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): ./.zig-cache/o/5fc901199550c8cd8b728e45e01f08e3/zx transpile /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app --outdir ./.zig-cache/tmp/3d19eca70e88420a/app --rootdir ./zig-out/static --dep-file ./.zig-cache/tmp/3d19eca70e88420a/transpile.d --map inline --cache-dir .zig-cache/zx_transpile
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -fno-entry -ODebug -targetwasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_info --dep zx_module_options --dep injections --dep zx_meta --dep zx_options -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../vendor/jsz/src/main.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -Mzx_module_options=.zig-cache/o/819a7b2df2874554c8e3d9dd567885d0/options.zig -Minjections=.zig-cache/o/22fae4ad6cc5a00469eac24f73b4c44d/injections.zon --dep js --dep zx_info --dep zx_module_options --dep injections --dep zx -Mzx_meta=.zig-cache/o/1fbb0698a6b56962e052924b600d3dec/app/meta.zig -Mzx_options=.zig-cache/o/d57dd3e5b3a326371d4f528a989fe6c2/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -ODebug --dep app --dep zx-Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/main.zig --dep httpz --dep zx_info --dep zx_module_options --dep zx_options --dep injections --dep zx --dep app -Mapp=.zig-cache/o/1fbb0698a6b56962e052924b600d3dec/app/meta.zig -ODebug --dep httpz --dep zx_info --dep zx_module_options --dep zx_options --dep injections --dep app -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/root.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/httpz-0.0.0-PNVzrATcCADK2AQ3S7KDpH49xF3iMZ6Itih2-uBglAae/src/httpz.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -Mzx_module_options=.zig-cache/o/7d930d1180425d2ab6dec8010276025f/options.zig -Mzx_options=.zig-cache/o/d57dd3e5b3a326371d4f528a989fe6c2/options.zig -Minjections=.zig-cache/o/22fae4ad6cc5a00469eac24f73b4c44d/injections.zon -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/metrics-0.0.0-W7G4eKXEAQDnX3LGPHFttHEV1nQn934f_shdK7p3BW66/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/websocket-0.1.0-ZPISdaXaBADnMkB-sc_PBK4Ri0DX2AyxIJsAgWFIicUH/src/websocket.zig -Mbuild=.zig-cache/o/62f454a5ae5887612b1a541324846c32/options.zig -Mbuild0=.zig-cache/o/bd1d5f68cd9ad230fe4fb7358ce37ada/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): install -C .zig-cache/o/3467457cc9338d85f5c1b15fbb0a7f79/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/static/assets/_/main.wasm
|
||||
info(verbose): install -C .zig-cache/o/dafcd2aec99699fefe2f68508c3ed270/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/bin/ziex_app
|
||||
Build Summary: 27/27 steps succeeded
|
||||
install success
|
||||
+- install ziex_app success
|
||||
| +- install server ziex_app success 2s MaxRSS:389M
|
||||
| +- install app/public/ cached
|
||||
| +- install dependency to static/assets/_/main.js cached
|
||||
| +- zx transpile success 690ms
|
||||
| | +- compile exe zx Debug native success 6s MaxRSS:730M
|
||||
| | +- options success
|
||||
| | +- options success
|
||||
| | +- WriteFile . success
|
||||
| | +- compile lib tree-sitter Debug native success 988ms MaxRSS:161M
|
||||
| | +- compile lib tree-sitter Debug native (reused)
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_zx Debug native success 505ms MaxRSS:136M
|
||||
| | +- compile lib tree_sitter_zx Debug native (reused)
|
||||
| | +- options success
|
||||
| | +- WriteFile success
|
||||
| | +- compile lib tree_sitter_mdzx Debug native success 660ms MaxRSS:159M
|
||||
| | +- compile lib tree_sitter_mdzx Debug native (reused)
|
||||
| | +- options success
|
||||
| +- zx transpile (+1 more reused dependencies)
|
||||
| +- options cached
|
||||
| +- options success
|
||||
| +- options success
|
||||
| +- WriteFile injections.zon success
|
||||
| +- options success
|
||||
| +- options success
|
||||
+- install client ziex_app success
|
||||
+- compile exe main Debug wasm32-freestanding-none success 1s MaxRSS:283M
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options cached
|
||||
+- options success
|
||||
+- WriteFile injections.zon (reused)
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options (reused)
|
||||
89
test/cli/FirstOutput.txt
Normal file
89
test/cli/FirstOutput.txt
Normal file
@ -0,0 +1,89 @@
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/src/lib.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/include -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/src -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/tree_sitter-0.27.0-Tw2sR0f_CwDrLd0k6L_8HRkq6z-omnRpV8JeIWbbCFfw/lib/src/wasm -D_POSIX_C_SOURCE=200112L -D_DEFAULT_SOURCE= -D_BSD_SOURCE= -D_DARWIN_C_SOURCE= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree-sitter -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-zx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-zx/src -DTREE_SITTER_DEBUG= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_zx -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-lib -cflags -std=c11 -- /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-mdzx/src/parser.c -ODebug -I /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-mdzx/src -DTREE_SITTER_DEBUG= -Mroot -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name tree_sitter_mdzx -static --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/ziex_js-0.1.0-dev-v1W0GRqPAwD3VLCRLZRGJnmnjzPCemE0EIU1820xyZBn/wasm/init.js /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/static/assets/_/main.js
|
||||
info(verbose): install -C /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/public/favicon.ico /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/static/favicon.ico
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -ODebug --dep cli_options --dep core_lang --dep zx_info --dep zli --dep tree_sitter --dep tree_sitter_zx --dep build_options --dep app_template -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/main.zig -Mcli_options=.zig-cache/o/4fd11c1ab177b4d15335556679e876a6/options.zig -ODebug --dep tree_sitter --dep tree_sitter_zx --dep tree_sitter_mdzx -Mcore_lang=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/core/root.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -fno-single-threaded -ODebug -Mzli=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../vendor/cliz/src/zli.zig .zig-cache/o/8be9c53d837666244de2b3d6be98a8ba/libtree-sitter.a -ODebug -I .zig-cache/o/47c68f5d5b83c11378c2df69e216399a --dep build -Mtree_sitter=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../vendor/zig-tree-sitter/src/root.zig .zig-cache/o/f47c9b0dbf5f5fa3d79b18b327b2268f/libtree_sitter_zx.a -ODebug -I .zig-cache/o/f1467de1083468613398e9513d83a308 -Mtree_sitter_zx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-zx/bindings/zig/root.zig -Mbuild_options=.zig-cache/o/fb0b7a6008feadd3e0bea3c01a47268f/options.zig -Mapp_template=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../templates/Template.zig .zig-cache/o/18cebcbe4d6a02541af18e9136c3766a/libtree_sitter_mdzx.a -ODebug -I .zig-cache/o/f1467de1083468613398e9513d83a308 -Mtree_sitter_mdzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../pkg/tree-sitter-mdzx/bindings/zig/root.zig -Mbuild=.zig-cache/o/9fdeaf4c13fa9b525ec2b8ebb9d4e277/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name zx --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): ./.zig-cache/o/5fc901199550c8cd8b728e45e01f08e3/zx transpile /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app --outdir ./.zig-cache/tmp/4eda55c7bdfa5bc1/app --rootdir ./zig-out/static --dep-file ./.zig-cache/tmp/4eda55c7bdfa5bc1/transpile.d --map inline --cache-dir .zig-cache/zx_transpile
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_info --dep zx_module_options --dep injections --dep zx_meta --dep zx_options -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../vendor/jsz/src/main.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -Mzx_module_options=.zig-cache/o/819a7b2df2874554c8e3d9dd567885d0/options.zig -Minjections=.zig-cache/o/22fae4ad6cc5a00469eac24f73b4c44d/injections.zon --dep js --dep zx_info --dep zx_module_options --dep injections --dep zx -Mzx_meta=.zig-cache/o/c05fa92ac2c029ce42e15835714e49f4/app/meta.zig -Mzx_options=.zig-cache/o/d57dd3e5b3a326371d4f528a989fe6c2/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -ODebug --dep app --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/main.zig --dep httpz --dep zx_info --dep zx_module_options --dep zx_options --dep injections --dep zx --dep app -Mapp=.zig-cache/o/c05fa92ac2c029ce42e15835714e49f4/app/meta.zig -ODebug --dep httpz --dep zx_info --dep zx_module_options --dep zx_options --dep injections --dep app -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/root.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/httpz-0.0.0-PNVzrATcCADK2AQ3S7KDpH49xF3iMZ6Itih2-uBglAae/src/httpz.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -Mzx_module_options=.zig-cache/o/7d930d1180425d2ab6dec8010276025f/options.zig -Mzx_options=.zig-cache/o/d57dd3e5b3a326371d4f528a989fe6c2/options.zig -Minjections=.zig-cache/o/22fae4ad6cc5a00469eac24f73b4c44d/injections.zon -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/metrics-0.0.0-W7G4eKXEAQDnX3LGPHFttHEV1nQn934f_shdK7p3BW66/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/websocket-0.1.0-ZPISdaXaBADnMkB-sc_PBK4Ri0DX2AyxIJsAgWFIicUH/src/websocket.zig -Mbuild=.zig-cache/o/62f454a5ae5887612b1a541324846c32/options.zig -Mbuild0=.zig-cache/o/bd1d5f68cd9ad230fe4fb7358ce37ada/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): install -C .zig-cache/o/f2bc56fe935a26ccc36bd2387146ffef/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/static/assets/_/main.wasm
|
||||
info(verbose): install -C .zig-cache/o/c3e1984cae7e1ec11b4deef3a39e24a0/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/bin/ziex_app
|
||||
Build Summary: 27/27 steps succeeded
|
||||
install success
|
||||
+- install ziex_app success
|
||||
| +- install server ziex_app success 2s MaxRSS:388M
|
||||
| +- install app/public/ cached
|
||||
| +- install dependency to static/assets/_/main.js cached
|
||||
| +- zx transpile success 762ms
|
||||
| | +- compile exe zx Debug native success 6s MaxRSS:568M
|
||||
| | +- options success
|
||||
| | +- options success
|
||||
| | +- WriteFile . success
|
||||
| | +- compile lib tree-sitter Debug native success 1s MaxRSS:159M
|
||||
| | +- compile lib tree-sitter Debug native (reused)
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_zx Debug native success 564ms MaxRSS:137M
|
||||
| | +- compile lib tree_sitter_zx Debug native (reused)
|
||||
| | +- options success
|
||||
| | +- WriteFile success
|
||||
| | +- compile lib tree_sitter_mdzx Debug native success 709ms MaxRSS:163M
|
||||
| | +- compile lib tree_sitter_mdzx Debug native (reused)
|
||||
| | +- options success
|
||||
| +- zx transpile (+1 more reused dependencies)
|
||||
| +- options cached
|
||||
| +- options success
|
||||
| +- options success
|
||||
| +- WriteFile injections.zon success
|
||||
| +- options success
|
||||
| +- options success
|
||||
+- install client ziex_app success
|
||||
+- compile exe main Debug wasm32-freestanding-none success 977ms MaxRSS:284M
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options cached
|
||||
+- options success
|
||||
+- WriteFile injections.zon (reused)
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options (reused)
|
||||
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -ODebug --dep app --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/main.zig --dep httpz --dep zx_info --dep zx_module_options --dep zx_options --dep injections --dep zx --dep app -Mapp=.zig-cache/o/c05fa92ac2c029ce42e15835714e49f4/app/meta.zig -ODebug --dep httpz --dep zx_info --dep zx_module_options --dep zx_options --dep injections --dep app -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/root.zig -ODebug --dep metrics --dep websocket --dep build -Mhttpz=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/httpz-0.0.0-PNVzrATcCADK2AQ3S7KDpH49xF3iMZ6Itih2-uBglAae/src/httpz.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -Mzx_module_options=.zig-cache/o/7d930d1180425d2ab6dec8010276025f/options.zig -Mzx_options=.zig-cache/o/d57dd3e5b3a326371d4f528a989fe6c2/options.zig -Minjections=.zig-cache/o/22fae4ad6cc5a00469eac24f73b4c44d/injections.zon -ODebug -Mmetrics=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/metrics-0.0.0-W7G4eKXEAQDnX3LGPHFttHEV1nQn934f_shdK7p3BW66/src/metrics.zig -ODebug --dep build=build0 -Mwebsocket=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-pkg/websocket-0.1.0-ZPISdaXaBADnMkB-sc_PBK4Ri0DX2AyxIJsAgWFIicUH/src/websocket.zig -Mbuild=.zig-cache/o/62f454a5ae5887612b1a541324846c32/options.zig -Mbuild0=.zig-cache/o/bd1d5f68cd9ad230fe4fb7358ce37ada/options.zig -lc --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name ziex_app --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): /Users/nurulhudaapon/.asdf/installs/zig/master/zig build-exe -fno-entry -ODebug -target wasm32-freestanding-none -mcpu baseline --dep zx -Mroot=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/app/main.zig -ODebug -target wasm32-freestanding-none -mcpu baseline --dep js --dep zx_info --dep zx_module_options --dep injections --dep zx_meta --dep zx_options -Mzx=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../src/root.zig -ODebug -target wasm32-freestanding-none -mcpu baseline -Mjs=/Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/../../vendor/jsz/src/main.zig -Mzx_info=.zig-cache/o/81a434cd57aea01a64d4764d7c98bb76/options.zig -Mzx_module_options=.zig-cache/o/819a7b2df2874554c8e3d9dd567885d0/options.zig -Minjections=.zig-cache/o/22fae4ad6cc5a00469eac24f73b4c44d/injections.zon --dep js --dep zx_info --dep zx_module_options --dep injections --dep zx -Mzx_meta=.zig-cache/o/c05fa92ac2c029ce42e15835714e49f4/app/meta.zig -Mzx_options=.zig-cache/o/d57dd3e5b3a326371d4f528a989fe6c2/options.zig --cache-dir .zig-cache --global-cache-dir /Users/nurulhudaapon/.cache/zig --name main -rdynamic --export-memory --zig-lib-dir /Users/nurulhudaapon/.asdf/installs/zig/master/lib/ --listen=-
|
||||
info(verbose): install -C .zig-cache/o/f2bc56fe935a26ccc36bd2387146ffef/main.wasm /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/static/assets/_/main.wasm
|
||||
info(verbose): install -C .zig-cache/o/c3e1984cae7e1ec11b4deef3a39e24a0/ziex_app /Users/nurulhudaapon/Projects/ziex-dev/ziex/bench/ziex/zig-out/bin/ziex_app
|
||||
Build Summary: 27/27 steps succeeded
|
||||
install success
|
||||
+- install ziex_app cached
|
||||
| +- install server ziex_app cached 86ms MaxRSS:33M
|
||||
| +- install app/public/ cached
|
||||
| +- install dependency to static/assets/_/main.js cached
|
||||
| +- zx transpile cached
|
||||
| | +- compile exe zx Debug native cached 6s MaxRSS:568M
|
||||
| | +- options cached
|
||||
| | +- options cached
|
||||
| | +- WriteFile . cached
|
||||
| | +- compile lib tree-sitter Debug native cached 1s MaxRSS:159M
|
||||
| | +- compile lib tree-sitter Debug native (reused)
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_zx Debug native cached 564ms MaxRSS:137M
|
||||
| | +- compile lib tree_sitter_zx Debug native (reused)
|
||||
| | +- options cached
|
||||
| | +- WriteFile cached
|
||||
| | +- compile lib tree_sitter_mdzx Debug native cached 709ms MaxRSS:163M
|
||||
| | +- compile lib tree_sitter_mdzx Debug native (reused)
|
||||
| | +- options cached
|
||||
| +- zx transpile (+1 more reused dependencies)
|
||||
| +- options cached
|
||||
| +- options cached
|
||||
| +- options cached
|
||||
| +- WriteFile injections.zon cached
|
||||
| +- options cached
|
||||
| +- options cached
|
||||
+- install client ziex_app cached
|
||||
+- compile exe main Debug wasm32-freestanding-none cached 75ms MaxRSS:32M
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options cached
|
||||
+- options cached
|
||||
+- WriteFile injections.zon (reused)
|
||||
+- zx transpile (+1 more reused dependencies)
|
||||
+- options (reused)
|
||||
|
||||
380
test/cli/dev.zig
Normal file
380
test/cli/dev.zig
Normal file
@ -0,0 +1,380 @@
|
||||
const std = @import("std");
|
||||
const builder = @import("builder");
|
||||
|
||||
const err_sample = @embedFile("ErrorOutput.txt");
|
||||
const sample_win = @embedFile("Output_Win.txt");
|
||||
const sample_err_then_fix = @embedFile("ErrorThenFix.txt");
|
||||
const sample_first = @embedFile("FirstOutput.txt");
|
||||
const sample_change = @embedFile("ChangeOutput.txt");
|
||||
|
||||
const BuildState = builder.BuildState;
|
||||
const Event = builder.Event;
|
||||
const StepStatus = builder.StepStatus;
|
||||
const parseStatusWord = builder.parseStatusWord;
|
||||
const parseInstallStatus = builder.parseInstallStatus;
|
||||
const stripTreePrefix = builder.stripTreePrefix;
|
||||
const stripAnsiInPlace = builder.stripAnsiInPlace;
|
||||
const DiagKind = builder.DiagKind;
|
||||
const parseDiagnostic = builder.parseDiagnostic;
|
||||
const isBuildCommandForOs = builder.isBuildCommandForOs;
|
||||
const parseDurationMs = builder.parseDurationMs;
|
||||
const parseUserAssetInstall = builder.parseUserAssetInstall;
|
||||
|
||||
fn feedLines(state: *BuildState, input: []const u8, events: *std.ArrayList(Event)) !void {
|
||||
var lines = std.mem.splitScalar(u8, input, '\n');
|
||||
const prefix = "info(verbose): ";
|
||||
|
||||
while (lines.next()) |line| {
|
||||
const has_prefix = std.mem.startsWith(u8, line, prefix);
|
||||
const clean = if (line.len > 0 and line[line.len - 1] == '\r') line[0 .. line.len - 1] else line;
|
||||
if (has_prefix) {
|
||||
if (try state.processLine(clean[prefix.len..])) |event| {
|
||||
try events.append(state.allocator, event);
|
||||
}
|
||||
} else {
|
||||
if (try state.processLine(clean)) |event| {
|
||||
try events.append(state.allocator, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (state.flushPending()) |event| {
|
||||
try events.append(state.allocator, event);
|
||||
}
|
||||
}
|
||||
|
||||
fn freeEvents(allocator: std.mem.Allocator, events: *std.ArrayList(Event)) void {
|
||||
for (events.items) |*e| switch (e.*) {
|
||||
.errors => |*r| r.deinit(),
|
||||
.assets_installed => |*a| a.deinit(),
|
||||
else => {},
|
||||
};
|
||||
events.deinit(allocator);
|
||||
}
|
||||
|
||||
test "parseStatusWord recognizes success/cached/failure" {
|
||||
try std.testing.expectEqual(StepStatus.success, parseStatusWord("success 35s MaxRSS:964M").?);
|
||||
try std.testing.expectEqual(StepStatus.cached, parseStatusWord("cached 102ms MaxRSS:32M").?);
|
||||
try std.testing.expectEqual(StepStatus.failure, parseStatusWord("1 errors").?);
|
||||
try std.testing.expectEqual(StepStatus.failure, parseStatusWord("transitive failure").?);
|
||||
try std.testing.expectEqual(@as(?StepStatus, null), parseStatusWord("(reused)"));
|
||||
}
|
||||
|
||||
test "parseInstallStatus parses server/client lines" {
|
||||
try std.testing.expectEqual(StepStatus.success, parseInstallStatus("install server ziex_app success 35s", "server").?);
|
||||
try std.testing.expectEqual(StepStatus.cached, parseInstallStatus("install server ziex_app cached 102ms", "server").?);
|
||||
try std.testing.expectEqual(StepStatus.success, parseInstallStatus("install client ziex_app success", "client").?);
|
||||
try std.testing.expectEqual(@as(?StepStatus, null), parseInstallStatus("install ziex_app success", "server"));
|
||||
}
|
||||
|
||||
test "stripTreePrefix handles unicode and ascii trees" {
|
||||
try std.testing.expectEqualStrings("install server x success", stripTreePrefix("│ └─ install server x success"));
|
||||
try std.testing.expectEqualStrings("install server x success", stripTreePrefix("| +- install server x success"));
|
||||
try std.testing.expectEqualStrings("install x success", stripTreePrefix("├─ install x success"));
|
||||
}
|
||||
|
||||
test "stripAnsiInPlace removes dim codes" {
|
||||
const out = stripAnsiInPlace("install [2mserver[0m ziex_app success");
|
||||
try std.testing.expectEqualStrings("install server ziex_app success", out);
|
||||
}
|
||||
|
||||
test "FirstOutput.txt: first cycle is success, second is cached" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
try feedLines(&state, sample_first, &events);
|
||||
|
||||
// Cycle 1: should_restart (first build done).
|
||||
// Cycle 2: build_complete_no_change (everything cached) - but FirstOutput
|
||||
// doesn't terminate cycle 2's tree with a blank line; the stream just ends.
|
||||
// We don't require the second event, but the first must be a restart.
|
||||
var found_restart = false;
|
||||
for (events.items) |e| {
|
||||
if (e == .should_restart) {
|
||||
found_restart = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
try std.testing.expect(found_restart);
|
||||
}
|
||||
|
||||
test "FirstOutput.txt: second cycle is no-change (all cached)" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
// Append a trailing blank line so the second tree finalizes.
|
||||
const padded = try std.mem.concat(allocator, u8, &.{ sample_first, "\n\n" });
|
||||
defer allocator.free(padded);
|
||||
|
||||
try feedLines(&state, padded, &events);
|
||||
|
||||
var restart_count: usize = 0;
|
||||
var no_change_count: usize = 0;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => restart_count += 1,
|
||||
.build_complete_no_change => no_change_count += 1,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expectEqual(@as(usize, 1), restart_count);
|
||||
try std.testing.expectEqual(@as(usize, 1), no_change_count);
|
||||
}
|
||||
|
||||
test "ChangeOutput.txt: server+client success triggers should_restart" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
// Trailing blank to finalize the tree.
|
||||
const padded = try std.mem.concat(allocator, u8, &.{ sample_change, "\n\n" });
|
||||
defer allocator.free(padded);
|
||||
|
||||
try feedLines(&state, padded, &events);
|
||||
|
||||
var found_restart = false;
|
||||
var found_no_change = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => found_restart = true,
|
||||
.build_complete_no_change => found_no_change = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_restart);
|
||||
try std.testing.expect(!found_no_change);
|
||||
}
|
||||
|
||||
test "synthetic: all-cached tree emits no_change, not restart" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"install -C .zig-cache/o/abc/main.wasm /proj/zig-out/static/assets/_/main.wasm\n" ++
|
||||
"install -C .zig-cache/o/abc/ziex_app /proj/zig-out/bin/ziex_app\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install cached\n" ++
|
||||
"├─ install ziex_app cached\n" ++
|
||||
"│ └─ install server ziex_app cached 102ms MaxRSS:32M\n" ++
|
||||
"└─ install client ziex_app cached\n" ++
|
||||
" └─ compile exe main Debug wasm32-freestanding-none cached 80ms\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_restart = false;
|
||||
var found_no_change = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => found_restart = true,
|
||||
.build_complete_no_change => found_no_change = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(!found_restart);
|
||||
try std.testing.expect(found_no_change);
|
||||
}
|
||||
|
||||
test "synthetic: server success only (zx edit rebuilds server)" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install success\n" ++
|
||||
"├─ install ziex_app success\n" ++
|
||||
"│ └─ install server ziex_app success 5s MaxRSS:680M\n" ++
|
||||
"└─ install client ziex_app cached\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_restart = false;
|
||||
for (events.items) |e| if (e == .should_restart) {
|
||||
found_restart = true;
|
||||
};
|
||||
try std.testing.expect(found_restart);
|
||||
}
|
||||
|
||||
test "synthetic: client success only (zx edit rebuilds wasm)" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install success\n" ++
|
||||
"├─ install ziex_app success\n" ++
|
||||
"│ └─ install server ziex_app cached 102ms\n" ++
|
||||
"└─ install client ziex_app success 928ms\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_restart = false;
|
||||
var found_no_change = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.should_restart => found_restart = true,
|
||||
.build_complete_no_change => found_no_change = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_restart);
|
||||
try std.testing.expect(!found_no_change);
|
||||
}
|
||||
|
||||
test "synthetic: asset-only change emits assets_installed" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
const input =
|
||||
"/usr/bin/zig build-exe -ODebug --name x\n" ++
|
||||
"install -C /proj/app/assets/style.css /proj/zig-out/static/assets/style.css\n" ++
|
||||
"Build Summary: 32/32 steps succeeded\n" ++
|
||||
"install success\n" ++
|
||||
"├─ install ziex_app cached\n" ++
|
||||
"│ └─ install server ziex_app cached 102ms\n" ++
|
||||
"│ ├─ install app/assets/ success\n" ++
|
||||
"└─ install client ziex_app cached\n" ++
|
||||
"\n";
|
||||
|
||||
try feedLines(&state, input, &events);
|
||||
|
||||
var found_assets = false;
|
||||
var found_restart = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.assets_installed => |a| {
|
||||
try std.testing.expect(a.files.len >= 1);
|
||||
found_assets = true;
|
||||
},
|
||||
.should_restart => found_restart = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_assets);
|
||||
try std.testing.expect(!found_restart);
|
||||
}
|
||||
|
||||
test "error build cycle emits errors" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
try feedLines(&state, err_sample, &events);
|
||||
|
||||
var found_errors = false;
|
||||
for (events.items) |*e| switch (e.*) {
|
||||
.errors => |r| {
|
||||
try std.testing.expect(r.diagnostics.len > 0);
|
||||
try std.testing.expectEqualStrings("expected ',' after field", r.diagnostics[0].message);
|
||||
try std.testing.expectEqual(DiagKind.@"error", r.diagnostics[0].kind);
|
||||
found_errors = true;
|
||||
},
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(found_errors);
|
||||
}
|
||||
|
||||
test "error then fix: error event then later resolved" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
try feedLines(&state, sample_err_then_fix, &events);
|
||||
|
||||
var saw_error = false;
|
||||
var saw_restart_or_resolved = false;
|
||||
for (events.items) |e| switch (e) {
|
||||
.errors => saw_error = true,
|
||||
.should_restart, .resolved => saw_restart_or_resolved = true,
|
||||
else => {},
|
||||
};
|
||||
try std.testing.expect(saw_error);
|
||||
try std.testing.expect(saw_restart_or_resolved);
|
||||
}
|
||||
|
||||
test "windows watch output detects build start and restart" {
|
||||
const allocator = std.testing.allocator;
|
||||
var state = BuildState.init(allocator);
|
||||
state.os_tag = .windows;
|
||||
state.first_build_done = true;
|
||||
defer state.deinit();
|
||||
|
||||
var events = std.ArrayList(Event).empty;
|
||||
defer freeEvents(allocator, &events);
|
||||
|
||||
// Pad with a trailing blank line to finalize the tree.
|
||||
const padded = try std.mem.concat(allocator, u8, &.{ sample_win, "\n\n" });
|
||||
defer allocator.free(padded);
|
||||
|
||||
try feedLines(&state, padded, &events);
|
||||
|
||||
// Output_Win.txt is two cycles glued together with the summary tree of
|
||||
// the FIRST cycle showing all-cached, then a new build-exe starts cycle 2.
|
||||
var change_count: usize = 0;
|
||||
for (events.items) |e| if (e == .change_detected) {
|
||||
change_count += 1;
|
||||
};
|
||||
try std.testing.expect(change_count >= 1);
|
||||
}
|
||||
|
||||
test "parseDiagnostic - errors" {
|
||||
const allocator = std.testing.allocator;
|
||||
const diag = parseDiagnostic(allocator, ".zig-cache/app/pages/page.zig:95:12: error: expected ',' after field").?;
|
||||
defer allocator.free(diag.file);
|
||||
defer allocator.free(diag.message);
|
||||
try std.testing.expectEqualStrings(".zig-cache/app/pages/page.zig", diag.file);
|
||||
try std.testing.expectEqual(@as(u32, 95), diag.line);
|
||||
try std.testing.expectEqual(@as(u32, 12), diag.col);
|
||||
}
|
||||
|
||||
test "isBuildCommand handles windows zig path and rejects other tools" {
|
||||
try std.testing.expect(isBuildCommandForOs(.windows, "\"C:\\\\Users\\\\x\\\\zig.exe\" build-exe -ODebug"));
|
||||
try std.testing.expect(isBuildCommandForOs(.macos, "/Users/x/.asdf/installs/zig/0.16.0/zig build-lib -ODebug"));
|
||||
try std.testing.expect(!isBuildCommandForOs(.windows, "install -C foo bar"));
|
||||
}
|
||||
|
||||
test "parseDurationMs handles common units" {
|
||||
try std.testing.expectEqual(@as(?u64, 23), parseDurationMs("23ms"));
|
||||
try std.testing.expectEqual(@as(?u64, 1500), parseDurationMs("1.5s"));
|
||||
try std.testing.expectEqual(@as(?u64, null), parseDurationMs("cached"));
|
||||
}
|
||||
|
||||
test "parseUserAssetInstall extracts web path" {
|
||||
const a = parseUserAssetInstall("install -C /proj/app/public/favicon.ico /proj/zig-out/static/favicon.ico").?;
|
||||
try std.testing.expectEqualStrings("favicon.ico", a.web_path);
|
||||
try std.testing.expect(parseUserAssetInstall("install -C .zig-cache/o/abc/main.wasm /proj/zig-out/static/assets/_/main.wasm") == null);
|
||||
}
|
||||
104
test/cli/lsp.zig
Normal file
104
test/cli/lsp.zig
Normal file
@ -0,0 +1,104 @@
|
||||
const std = @import("std");
|
||||
const testing = std.testing;
|
||||
const html_hover = @import("html_hover");
|
||||
|
||||
fn offsetOf(src: []const u8, needle: []const u8, into: u32) u32 {
|
||||
const idx = std.mem.indexOf(u8, src, needle).?;
|
||||
return @intCast(idx + into);
|
||||
}
|
||||
|
||||
test "hover: element tag name" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div class="x">hi</div>);
|
||||
\\}
|
||||
;
|
||||
// Point at the "div" in the start tag.
|
||||
const off = offsetOf(src, "<div", 1);
|
||||
const md = (try html_hover.hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "<div>") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "generic flow-content") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "specification") != null);
|
||||
}
|
||||
|
||||
test "hover: global attribute name" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div class="x">hi</div>);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "class=", 1);
|
||||
const md = (try html_hover.hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "class") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "CSS classes") != null);
|
||||
}
|
||||
|
||||
test "hover: element-specific attribute name" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<a href="/x">link</a>);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "href=", 1);
|
||||
const md = (try html_hover.hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "href") != null);
|
||||
try testing.expect(std.mem.indexOf(u8, md, "hyperlink points to") != null);
|
||||
// The enclosing tag should be reflected.
|
||||
try testing.expect(std.mem.indexOf(u8, md, "<a>") != null);
|
||||
}
|
||||
|
||||
test "hover: unknown element returns null" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<Foo />);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "<Foo", 1);
|
||||
try testing.expect((try html_hover.hoverMarkdown(arena, src, off)) == null);
|
||||
}
|
||||
|
||||
test "hover: cursor outside tag returns null" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div>hi</div>);
|
||||
\\}
|
||||
;
|
||||
// Point at "Page" — plain Zig, not an HTML tag.
|
||||
const off = offsetOf(src, "Page", 1);
|
||||
try testing.expect((try html_hover.hoverMarkdown(arena, src, off)) == null);
|
||||
}
|
||||
|
||||
test "hover: void element self-closing tag" {
|
||||
var arena_state = std.heap.ArenaAllocator.init(testing.allocator);
|
||||
defer arena_state.deinit();
|
||||
const arena = arena_state.allocator();
|
||||
|
||||
const src =
|
||||
\\pub fn Page(a: zx.Allocator) zx.Component {
|
||||
\\ return (<div><br /></div>);
|
||||
\\}
|
||||
;
|
||||
const off = offsetOf(src, "<br", 1);
|
||||
const md = (try html_hover.hoverMarkdown(arena, src, off)) orelse return error.NoHover;
|
||||
try testing.expect(std.mem.indexOf(u8, md, "<br>") != null);
|
||||
}
|
||||
@ -15,6 +15,8 @@ test {
|
||||
_ = @import("core/cache.zig");
|
||||
_ = @import("core/kv.zig");
|
||||
_ = @import("core/style.zig");
|
||||
_ = @import("cli/lsp.zig");
|
||||
_ = @import("cli/dev.zig");
|
||||
}
|
||||
|
||||
pub const std_options = std.Options{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user