Skip to content

Commit

Permalink
Merge pull request #154 from theangryangel/153-relax-deps
Browse files Browse the repository at this point in the history
build(release): 1.0.0 🎉
  • Loading branch information
theangryangel authored Feb 14, 2024
2 parents f715417 + f515916 commit e6d357b
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 59 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,14 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Run cargo check
run: cargo check --all-targets --all-features

semver:
runs-on: ubuntu-latest
needs: [pre-commit]
steps:
- uses: actions/checkout@v4
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
feature-group: all-features
release-type: minor
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,17 @@ racing simulator and it's [Insim](https://en.lfsmanual.net/wiki/InSim.txt) (prot
The intention is to provide a strongly typed, native rust implementation, rather
than a thin layer over a series of bytes and primitive types.

:warning: The API is not yet stable at this time. Use at your own risk. I am
currently not touching the version number.

You can track the path to stable by monitoring these issues: <https://github.com/theangryangel/insim.rs/issues?q=is%3Aissue+is%3Aopen+label%3A%22target%3A+1.0.0%22>.

If you're not sure where to start, you probably want to look at the [examples](https://github.com/theangryangel/insim.rs/tree/main/examples).

| Crate | Usage |
| ------------ | ----------------------------------------------- |
| `insim` | Connection and protocol implementation. |
| `insim_core` | Contains core types shared across other crates. |
| `insim_pth` | Implements a PTH file read/writer. |
| `insim_smx` | Implements a SMX file reader/writer. |
| Crate | Usage | Documentation |
| ------------ | ----------------------------------------------- | -------------------------- |
| `insim` | Connection and protocol implementation. | https://docs.rs/insim |
| `insim_core` | Contains core types shared across other crates. | https://docs.rs/insim_core |
| `insim_pth` | Implements a PTH file read/writer. | https://docs.rs/insim_pth |
| `insim_smx` | Implements a SMX file reader/writer. | https://docs.rs/insim_smx |

If you're looking for race_directord that has been moved to <https://github.com/theangryangel/race_directord/>.

## Documentation

Until we're released, either:

- Please run `cargo doc --no-deps --open`
- Take a look at the examples

## TODO

- `git grep '\(TODO\|FIXME\|XXX\)'`
Expand Down
8 changes: 4 additions & 4 deletions insim/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "insim"
version = "1.0.0-alpha.2"
version = "1.0.0"
authors = ["Karl Southern <[email protected]>"]
edition = "2021"
description = "LiveForSpeed Insim implementation that focuses on ergonomics and strong typing"
Expand Down Expand Up @@ -37,9 +37,9 @@ from_variants = "1.0.2"
futures-util = { version = "0.3.28", optional = true }
if_chain = "1"
indexmap = "2.1.0"
insim_core = { path = "../insim_core", version = "1.0.0-alpha.1" }
insim_pth = { path = "../insim_pth", optional = true, version = "1.0.0" }
insim_smx = { path = "../insim_smx", optional = true, version = "1.0.0" }
insim_core = { path = "../insim_core", version = "1.0.0" }
insim_pth = { path = "../insim_pth", optional = true, version = "1" }
insim_smx = { path = "../insim_smx", optional = true, version = "1" }
serde = { version = "1", features = ["derive"], optional = true }
thiserror = "1"
tokio = { version = "1.11.0", features = ["rt", "time", "net", "macros", "sync", "tracing"], optional = true }
Expand Down
45 changes: 13 additions & 32 deletions insim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ Many of the core types, such as [Vehicle](crate::core::vehicle::Vehicle), [Track
the crate `insim_core`, which is re-exported.

You will probably want to use <https://en.lfsmanual.net/wiki/InSim.txt> as a
detailed reference for what each packet describes and can do.
detailed reference for what each packet describes and can do. Where possible
this crate aligns the naming of fields in packets to match the original spec.
In a handful of circumstances we have needed to rename, or separate some fields
(most notably thrbrk and cluhan in the [Con](crate::Packet::Con) packet).

## Supported Features

Expand All @@ -24,13 +27,14 @@ detailed reference for what each packet describes and can do.

The following are a list of [Cargo features][cargo-features] that can be enabled or disabled:

- `serde`: Enable serde support
- `pth`: Pull in insim_pth and re-export
- `smx`: Pull in insim_smx and re-export
- `tokio`: Enable tokio support (default)
- `blocking`: Enable blocking/sync support
- `websocket`: Enable LFSW Relay support over websocket using
Tungstenite (requires tokio)
| Name | Description | Default? |
| --------- | --------------------------------------------------------------------------- | -------- |
| serde | Enable serde support | No |
| pth | Pull in insim_pth and re-export | No |
| smx | Pull in insim_smx and re-export | No |
| tokio | Enable tokio support | Yes |
| blocking | Enable blocking/sync support | Yes |
| websocket | Enable LFSW Relay support over websocket using Tungstenite (requires tokio) | Yes |

## Making a TCP connection (using tokio)

Expand All @@ -52,7 +56,7 @@ loop {
## Making a TCP connection (using blocking)

```rust
let conn = insim::tcp("127.0.0.1:29999", None).connect()?;
let conn = insim::tcp("127.0.0.1:29999").connect()?;
loop {
let packet = conn.read()?;
println!("{:?}", packet);
Expand Down Expand Up @@ -107,26 +111,3 @@ loop {
## Additional examples

For further examples see <https://github.com/theangryangel/insim.rs/tree/main/examples>

## Breaking changes

- [#143](https://github.com/theangryangel/insim.rs/issues/143) blocking/std sync
support added. Tokio (async) support is now able to be disabled via `tokio`
feature. For backwards compatibility `tokio` is enabled by default.
- [#140](https://github.com/theangryangel/insim.rs/issues/140) renamed a significant proportion of
the `insim::Packet` enum, and silbing structs and enums to more closely align with the upstream
spec (`Insim.txt`).
- [#127](https://github.com/theangryangel/insim.rs/issues/127) restructures the crate to more closely
align with the std library:
- `insim::network` was renamed to `insim::net`
- `insim::codec::Codec` was moved to `insim::net::Codec`
- `insim::codec::Mode` was moved to `insim::net::Mode`
- Several convenience aliases were added: `insim::{Result, Error, Packet}`
- `Network` trait was renamed to `TryReadWriteBytes` to better indicate its
usage. Network was too generic.
- [#127](https://github.com/theangryangel/insim.rs/issues/127) `insim::connection` was removed in favour
of the shortcut methods: `insim::tcp`, `insim::udp`, `insim::relay` which now return a reusable builder.
These do not auto-reconnect.
- [#92](https://github.com/theangryangel/insim.rs/issues/92) disables the automatic escaping and
unescaping of strings. For convenience the insim crate now re-exports
`insim::core::string::escape` and `insim::core::string::unescape`.
2 changes: 1 addition & 1 deletion insim_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "insim_core"
version = "1.0.0-alpha.1"
version = "1.0.0"
edition = "2021"
description = """
Core types and traits for the insim crate.
Expand Down
4 changes: 2 additions & 2 deletions insim_pth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "insim_pth"
version = "1.0.0"
version = "1.1.0"
edition = "2021"
description = "Insim PTH file implementation"
rust-version = "1.66"
Expand All @@ -13,5 +13,5 @@ bench = false
doctest = false

[dependencies]
insim_core = { path = "../insim_core", version = "1.0.0-alpha.1" }
insim_core = { path = "../insim_core", version = "1" }
thiserror = "1"
4 changes: 2 additions & 2 deletions insim_smx/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "insim_smx"
version = "1.0.0"
version = "1.1.0"
edition = "2021"
description = "Insim SMX file implementation"
rust-version = "1.66"
Expand All @@ -14,5 +14,5 @@ bench = false
doctest = false

[dependencies]
insim_core = { path = "../insim_core", version = "1.0.0-alpha.1" }
insim_core = { path = "../insim_core", version = "1" }
thiserror = "1"

0 comments on commit e6d357b

Please sign in to comment.