chore: improve readme
This commit is contained in:
parent
4befa37361
commit
c60616805e
3 changed files with 43 additions and 31 deletions
21
LICENCE
Normal file
21
LICENCE
Normal 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.
|
||||||
47
README.md
47
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.
|
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
|
## Installation
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- Zig 0.15.2 or later
|
- Zig 0.15.2
|
||||||
- Rust toolchain (only required if prebuilt binaries are not available for your platform)
|
- Rust toolchain (only required if [prebuilt binaries](#prebuilt) are not available for your platform)
|
||||||
|
|
||||||
### Add as a Dependency
|
### Add as a Dependency
|
||||||
|
|
||||||
|
|
@ -35,22 +25,26 @@ Add temporalz to your executable in `build.zig`:
|
||||||
```zig
|
```zig
|
||||||
const temporalz_dep = b.dependency("temporalz", .{ .target = target, .optimize = optimize });
|
const temporalz_dep = b.dependency("temporalz", .{ .target = target, .optimize = optimize });
|
||||||
|
|
||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{...});
|
||||||
.name = "my_app",
|
|
||||||
.root_module = b.createModule(.{
|
exe.root_module.addImport("temporalz", temporalz_dep.module("temporalz"));
|
||||||
.root_source_file = b.path("src/main.zig"),
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
.imports = &.{
|
|
||||||
.{ .name = "temporalz", .module = 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`
|
- `aarch64-macos`
|
||||||
- `x86_64-macos`
|
- `x86_64-macos`
|
||||||
|
|
@ -59,7 +53,7 @@ Prebuilt binaries are available for:
|
||||||
- `x86_64-windows-gnu`
|
- `x86_64-windows-gnu`
|
||||||
- `aarch64-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
|
## Development
|
||||||
|
|
||||||
|
|
@ -73,7 +67,6 @@ cd temporalz
|
||||||
### Build and Run
|
### Build and Run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
zig build
|
|
||||||
zig build run
|
zig build run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,12 @@ pub fn build(b: *std.Build) void {
|
||||||
.name = "example",
|
.name = "example",
|
||||||
.root_module = b.createModule(.{
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("src/main.zig"),
|
.root_source_file = b.path("src/main.zig"),
|
||||||
|
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
.imports = &.{
|
.imports = &.{},
|
||||||
.{ .name = "temporalz", .module = temporalz_dep.module("temporalz") },
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
exe.root_module.addImport("temporalz", temporalz_dep.module("temporalz"));
|
||||||
b.installArtifact(exe);
|
b.installArtifact(exe);
|
||||||
|
|
||||||
const run_step = b.step("run", "Run the app");
|
const run_step = b.step("run", "Run the app");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue