refactor: rename pkgs

This commit is contained in:
Nurul Huda (Apon) 2026-03-14 17:34:54 +06:00
parent 2b5f1a0024
commit ca64dae639
No known key found for this signature in database
GPG key ID: 5D3F1DE2855A2F79
15 changed files with 5 additions and 22 deletions

View file

@ -6,20 +6,18 @@ pub fn build(b: *std.Build) !void {
const is_wasm_freestanding = target.result.cpu.arch.isWasm() and target.result.os.tag == .freestanding;
// --- Rust C ABI & Pre-built via temporal-rs subpackage --- //
const libtemporal_src = b.dependency("libtemporal_src", .{
const temporal = b.dependency("temporal", .{
.target = target,
.optimize = optimize,
});
// --- Zig Module: temporalz --- //
const mod = b.addModule("temporalz", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
// Use the comprehensive mod from the package
mod.addImport("temporal_rs", libtemporal_src.module("temporal_rs"));
mod.addImport("temporal_rs", temporal.module("temporal_rs"));
// --- Zig Executable: temporalz --- //
const exe_root = if (is_wasm_freestanding)

View file

@ -4,8 +4,8 @@
.fingerprint = 0xd8d79d59acc4faae,
.minimum_zig_version = "0.16.0-dev.2860+9c5460316",
.dependencies = .{
.libtemporal_src = .{
.path = "pkg/temporal-rs",
.temporal = .{
.path = "pkg/temporal",
},
},
.paths = .{

View file

@ -1,15 +0,0 @@
const fs = require('fs');
const app_zon = fs.readFileSync('build.zig.zon', 'utf8');
function extractDep(name) {
const regex = new RegExp(`\\.${name}\\s*=\\s*\\{([\\s\\S]*?)\\},`);
return app_zon.match(regex)[0];
}
const p1 = extractDep('temporal_rs');
const p2 = extractDep('libtemporal_prebuilt');
const pkg_zon = fs.readFileSync('pkg/temporal-rs/build.zig.zon', 'utf8');
const new_pkg_zon = pkg_zon.replace(' .dependencies = .{', ` .dependencies = .{\n ${p1}\n ${p2}`);
fs.writeFileSync('pkg/temporal-rs/build.zig.zon', new_pkg_zon);