From c6fb7b4962778c12f786d7d4de96787459a3b4dc Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 20 May 2026 17:29:28 +0200 Subject: frontend: add comptime bundler --- src/frontend/Component.zig | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/frontend/Component.zig (limited to 'src/frontend/Component.zig') diff --git a/src/frontend/Component.zig b/src/frontend/Component.zig new file mode 100644 index 0000000..d90ed3b --- /dev/null +++ b/src/frontend/Component.zig @@ -0,0 +1,30 @@ +const std = @import("std"); + +const File = @import("File.zig"); + +const Self = @This(); + +name: []const u8, +parent_dir: []const u8, + +pub fn path(p: []const u8) Self { + const name = p[if (std.mem.lastIndexOfScalar( + u8, + std.mem.trim(u8, p, "/"), + '/', + )) |index| index + 1 else 0..]; + + return .{ + .name = name, + .parent_dir = p, + }; +} + +pub fn to_html_string(comptime self: Self) []const u8 { + const html: File.Html = .minify(self.parent_dir ++ "/index.html"); + const js: File.Script = .minify(self.parent_dir ++ "/index.js"); + const css: File.Style = .minify(self.parent_dir ++ "/index.css"); + return ""; +} + +test {} -- cgit v1.2.3-70-g09d2