chore: improve readme

This commit is contained in:
Nurul Huda (Apon) 2026-01-26 12:38:42 +06:00
parent 69faf52da7
commit f3c6bcdc30
No known key found for this signature in database
GPG key ID: 5D3F1DE2855A2F79
3 changed files with 43 additions and 31 deletions

21
LICENCE Normal file
View file

@ -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.

View file

@ -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
```

View file

@ -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");