From ca64dae63927e8e6653208a17e2e54470ae6a0ff Mon Sep 17 00:00:00 2001 From: "Nurul Huda (Apon)" Date: Sat, 14 Mar 2026 17:34:54 +0600 Subject: [PATCH] refactor: rename pkgs --- build.zig | 8 +++----- build.zig.zon | 4 ++-- pkg/{temporal-rs => temporal}/Cargo.lock | 0 pkg/{temporal-rs => temporal}/Cargo.toml | 0 pkg/{temporal-rs => temporal}/build.zig | 0 pkg/{temporal-rs => temporal}/build.zig.zon | 0 pkg/{temporal-rs => temporal}/src/lib.rs | 0 pkg/{temporal-rs => temporal}/src/root.zig | 0 .../src/stubs/c_headers/assert.h | 0 .../src/stubs/c_headers/stdbool.h | 0 .../src/stubs/c_headers/stddef.h | 0 .../src/stubs/c_headers/stdint.h | 0 .../src/stubs/c_headers/stdio.h | 0 .../src/stubs/unwind.zig | 0 update_zon.js | 15 --------------- 15 files changed, 5 insertions(+), 22 deletions(-) rename pkg/{temporal-rs => temporal}/Cargo.lock (100%) rename pkg/{temporal-rs => temporal}/Cargo.toml (100%) rename pkg/{temporal-rs => temporal}/build.zig (100%) rename pkg/{temporal-rs => temporal}/build.zig.zon (100%) rename pkg/{temporal-rs => temporal}/src/lib.rs (100%) rename pkg/{temporal-rs => temporal}/src/root.zig (100%) rename pkg/{temporal-rs => temporal}/src/stubs/c_headers/assert.h (100%) rename pkg/{temporal-rs => temporal}/src/stubs/c_headers/stdbool.h (100%) rename pkg/{temporal-rs => temporal}/src/stubs/c_headers/stddef.h (100%) rename pkg/{temporal-rs => temporal}/src/stubs/c_headers/stdint.h (100%) rename pkg/{temporal-rs => temporal}/src/stubs/c_headers/stdio.h (100%) rename pkg/{temporal-rs => temporal}/src/stubs/unwind.zig (100%) delete mode 100644 update_zon.js diff --git a/build.zig b/build.zig index 8d28f74..68c8b41 100644 --- a/build.zig +++ b/build.zig @@ -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) diff --git a/build.zig.zon b/build.zig.zon index 1b682a3..43cbe01 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -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 = .{ diff --git a/pkg/temporal-rs/Cargo.lock b/pkg/temporal/Cargo.lock similarity index 100% rename from pkg/temporal-rs/Cargo.lock rename to pkg/temporal/Cargo.lock diff --git a/pkg/temporal-rs/Cargo.toml b/pkg/temporal/Cargo.toml similarity index 100% rename from pkg/temporal-rs/Cargo.toml rename to pkg/temporal/Cargo.toml diff --git a/pkg/temporal-rs/build.zig b/pkg/temporal/build.zig similarity index 100% rename from pkg/temporal-rs/build.zig rename to pkg/temporal/build.zig diff --git a/pkg/temporal-rs/build.zig.zon b/pkg/temporal/build.zig.zon similarity index 100% rename from pkg/temporal-rs/build.zig.zon rename to pkg/temporal/build.zig.zon diff --git a/pkg/temporal-rs/src/lib.rs b/pkg/temporal/src/lib.rs similarity index 100% rename from pkg/temporal-rs/src/lib.rs rename to pkg/temporal/src/lib.rs diff --git a/pkg/temporal-rs/src/root.zig b/pkg/temporal/src/root.zig similarity index 100% rename from pkg/temporal-rs/src/root.zig rename to pkg/temporal/src/root.zig diff --git a/pkg/temporal-rs/src/stubs/c_headers/assert.h b/pkg/temporal/src/stubs/c_headers/assert.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/assert.h rename to pkg/temporal/src/stubs/c_headers/assert.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stdbool.h b/pkg/temporal/src/stubs/c_headers/stdbool.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stdbool.h rename to pkg/temporal/src/stubs/c_headers/stdbool.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stddef.h b/pkg/temporal/src/stubs/c_headers/stddef.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stddef.h rename to pkg/temporal/src/stubs/c_headers/stddef.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stdint.h b/pkg/temporal/src/stubs/c_headers/stdint.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stdint.h rename to pkg/temporal/src/stubs/c_headers/stdint.h diff --git a/pkg/temporal-rs/src/stubs/c_headers/stdio.h b/pkg/temporal/src/stubs/c_headers/stdio.h similarity index 100% rename from pkg/temporal-rs/src/stubs/c_headers/stdio.h rename to pkg/temporal/src/stubs/c_headers/stdio.h diff --git a/pkg/temporal-rs/src/stubs/unwind.zig b/pkg/temporal/src/stubs/unwind.zig similarity index 100% rename from pkg/temporal-rs/src/stubs/unwind.zig rename to pkg/temporal/src/stubs/unwind.zig diff --git a/update_zon.js b/update_zon.js deleted file mode 100644 index 5e1c7f0..0000000 --- a/update_zon.js +++ /dev/null @@ -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);