From c60616805e5215a1f8a27b85508f78d83e53d8be Mon Sep 17 00:00:00 2001 From: "Nurul Huda (Apon)" Date: Mon, 26 Jan 2026 12:38:42 +0600 Subject: [PATCH] chore: improve readme --- LICENCE | 21 +++++++++++++++++++++ README.md | 47 ++++++++++++++++++++--------------------------- example/build.zig | 6 ++---- 3 files changed, 43 insertions(+), 31 deletions(-) create mode 100644 LICENCE diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..c907f39 --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Nurul Huda (Apon) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index ba8af24..b52044f 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,13 @@ A Zig library for working with temporal types based on the [Temporal Standard](h Temporalz provides Zig bindings to the Rust-based [temporal_rs](https://github.com/boa-dev/temporal) library for handling dates, times, and durations with proper timezone support. -## Features - -- [x] Instant - Exact moment in time -- [x] Duration - Length of time -- [ ] PlainDate - Date without time or timezone -- [ ] PlainTime - Time without date or timezone -- [ ] PlainDateTime - Date and time without timezone -- [ ] PlainYearMonth - Year and month -- [ ] PlainMonthDay - Month and day -- [ ] ZonedDateTime - Date, time, and timezone ## Installation ### Prerequisites -- Zig 0.15.2 or later -- Rust toolchain (only required if prebuilt binaries are not available for your platform) +- Zig 0.15.2 +- Rust toolchain (only required if [prebuilt binaries](#prebuilt) are not available for your platform) ### Add as a Dependency @@ -35,22 +25,26 @@ Add temporalz to your executable in `build.zig`: ```zig const temporalz_dep = b.dependency("temporalz", .{ .target = target, .optimize = optimize }); -const exe = b.addExecutable(.{ - .name = "my_app", - .root_module = b.createModule(.{ - .root_source_file = b.path("src/main.zig"), - .target = target, - .optimize = optimize, - .imports = &.{ - .{ .name = "temporalz", .module = temporalz_dep.module("temporalz") }, - }, - }), -}); +const exe = b.addExecutable(.{...}); + +exe.root_module.addImport("temporalz", temporalz_dep.module("temporalz")); ``` -## Supported Platforms -Prebuilt binaries are available for: +## Checklist + +- [x] Instant +- [x] Duration +- [ ] PlainDate +- [ ] PlainTime +- [ ] PlainDateTime +- [ ] PlainYearMonth +- [ ] PlainMonthDay +- [ ] ZonedDateTime + +## Prebuilt + +Prebuilt libraries are included for the following platforms: - `aarch64-macos` - `x86_64-macos` @@ -59,7 +53,7 @@ Prebuilt binaries are available for: - `x86_64-windows-gnu` - `aarch64-windows-gnu` -For unsupported platforms, the library will automatically build from source if the Rust toolchain is installed. +For other platforms, the library will build from source; you need the Rust toolchain installed. ## Development @@ -73,7 +67,6 @@ cd temporalz ### Build and Run ```bash -zig build zig build run ``` diff --git a/example/build.zig b/example/build.zig index d4cfa15..d080170 100644 --- a/example/build.zig +++ b/example/build.zig @@ -9,14 +9,12 @@ pub fn build(b: *std.Build) void { .name = "example", .root_module = b.createModule(.{ .root_source_file = b.path("src/main.zig"), - .target = target, .optimize = optimize, - .imports = &.{ - .{ .name = "temporalz", .module = temporalz_dep.module("temporalz") }, - }, + .imports = &.{}, }), }); + exe.root_module.addImport("temporalz", temporalz_dep.module("temporalz")); b.installArtifact(exe); const run_step = b.step("run", "Run the app");