fix: simplify compile_tpls export in root.zig for dependency usage
This commit is contained in:
21
src/root.zig
21
src/root.zig
@@ -5,8 +5,6 @@
|
||||
// const engine = pugz.ViewEngine.init(.{ .views_dir = "views" });
|
||||
// const html = try engine.render(allocator, "index", .{ .title = "Home" });
|
||||
|
||||
const builtin = @import("builtin");
|
||||
|
||||
pub const pug = @import("pug.zig");
|
||||
pub const view_engine = @import("view_engine.zig");
|
||||
pub const template = @import("template.zig");
|
||||
@@ -14,12 +12,7 @@ pub const parser = @import("parser.zig");
|
||||
pub const mixin = @import("mixin.zig");
|
||||
pub const runtime = @import("runtime.zig");
|
||||
pub const codegen = @import("codegen.zig");
|
||||
|
||||
// Build step for compiling templates (only available in build scripts)
|
||||
pub const compile_tpls = if (builtin.is_test or @import("builtin").output_mode == .Obj)
|
||||
void
|
||||
else
|
||||
@import("compile_tpls.zig");
|
||||
pub const compile_tpls = @import("compile_tpls.zig");
|
||||
|
||||
// Re-export main types
|
||||
pub const ViewEngine = view_engine.ViewEngine;
|
||||
@@ -34,12 +27,6 @@ pub const CompileError = pug.CompileError;
|
||||
// Convenience function for inline templates with data
|
||||
pub const renderTemplate = template.renderWithData;
|
||||
|
||||
// Build step convenience exports (only available in build context)
|
||||
pub const addCompileStep = if (@TypeOf(compile_tpls) == type and compile_tpls != void)
|
||||
compile_tpls.addCompileStep
|
||||
else
|
||||
void;
|
||||
pub const CompileTplsOptions = if (@TypeOf(compile_tpls) == type and compile_tpls != void)
|
||||
compile_tpls.CompileOptions
|
||||
else
|
||||
void;
|
||||
// Build step convenience exports
|
||||
pub const addCompileStep = compile_tpls.addCompileStep;
|
||||
pub const CompileTplsOptions = compile_tpls.CompileOptions;
|
||||
|
||||
Reference in New Issue
Block a user