forked from influxdata/pbjson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add disclaimer to README * Bump version to 0.6.0 * Add changelog * Add `no_std` compatibility test (#4) * Add `no_std` compatibility test * fix: enable prost-derive feature for prost --------- Co-authored-by: Farhad Shabani <[email protected]>
- Loading branch information
1 parent
a8b9f59
commit 9c18a04
Showing
11 changed files
with
87 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Changelog | ||
|
||
## v0.6.0 | ||
|
||
## Breaking changes | ||
|
||
- The crates have been prefixed with `informalsystems-`, but the library names have been kept the same, for drop-in compatibility with former versions. | ||
|
||
| Former crate | New crate | Library name | | ||
|-----------------|---------------------------------|-----------------| | ||
| `pbjson` | `informalsystems-pbjson` | `pbjson` | | ||
| `pbjson-types` | `informalsystems-pbjson-types` | `pbjson_types` | | ||
| `pbjson-build` | `informalsystems-pbjson-build` | `pbjson_build` | | ||
| `pbjson-test` | `informalsystems-pbjson-test` | `pbjson_test` | | ||
|
||
## Features | ||
|
||
- Add `no_std` support to the generated code ([#1](https://github.com/informalsystems/pbjson/pull/1)) | ||
The `informal-pbjson-types` crate now has an `std` feature which is enabled by default. | ||
To enable `no_std` compatibility, disable the default features on that crate. | ||
|
||
## Previous versions | ||
|
||
There was no changelog for versions prior to 0.6.0. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ members = [ | |
"pbjson-test", | ||
"pbjson-types", | ||
] | ||
|
||
exclude = [ | ||
"pbjson-no-std" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Pbjson | ||
|
||
> This is a fork of [`influxdata/pbjson`](https://github.com/influxdata/pbjson) maintained by Informal Systems. | ||
Pbjson is a set of crates to automatically generate [serde](https://serde.rs/) [Serialize](https://docs.rs/serde/1.0.130/serde/trait.Serialize.html) and [Deserialize](https://docs.rs/serde/1.0.130/serde/trait.Deserialize.html) implementations for auto-generated prost types. | ||
|
||
See [pbjson-build](https://docs.rs/pbjson-build) for usage instructions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "informalsystems-pbjson-build" | ||
version = "0.5.1" | ||
version = "0.6.0" | ||
authors = ["Raphael Taylor-Davies <[email protected]>"] | ||
edition = "2021" | ||
description = "Generates Serialize and Deserialize implementations for prost message types" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "pbjson-no-std" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
description = "A library for testing no_std compatibility of pbjson" | ||
|
||
[profile.dev] | ||
panic = "abort" | ||
|
||
[profile.release] | ||
panic = "abort" | ||
|
||
[dependencies] | ||
informalsystems-pbjson = { path = "../pbjson", default-features = false } | ||
informalsystems-pbjson-types = { path = "../pbjson-types", default-features = false } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#![no_std] | ||
|
||
use core::panic::PanicInfo; | ||
|
||
/// This function is called on panic. | ||
#[panic_handler] | ||
fn panic(_info: &PanicInfo) -> ! { | ||
loop {} | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "C" fn _start() -> ! { | ||
loop {} | ||
} | ||
|
||
#[allow(unused_imports)] | ||
use pbjson; | ||
#[allow(unused_imports)] | ||
use pbjson_types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "informalsystems-pbjson-test" | ||
version = "0.5.1" | ||
version = "0.6.0" | ||
authors = ["Raphael Taylor-Davies <[email protected]>"] | ||
edition = "2021" | ||
description = "Test resources for pbjson converion" | ||
|
@@ -11,7 +11,7 @@ publish = false | |
name = "pbjson_test" | ||
|
||
[dependencies] | ||
prost = { version = "0.11", default-features = false} | ||
prost = { version = "0.11", default-features = false, features = ["prost-derive"] } | ||
informalsystems-pbjson = { path = "../pbjson" , default-features = false} | ||
informalsystems-pbjson-types = { path = "../pbjson-types" , default-features = false} | ||
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "informalsystems-pbjson-types" | ||
version = "0.5.1" | ||
version = "0.6.0" | ||
authors = ["Raphael Taylor-Davies <[email protected]>"] | ||
description = "Protobuf well known types with serde serialization support" | ||
edition = "2021" | ||
|
@@ -15,18 +15,19 @@ name = "pbjson_types" | |
|
||
[features] | ||
default = ["std"] | ||
std = ["chrono/std", "informalsystems-pbjson/std", "prost/std", "serde/std"] | ||
std = ["bytes/std", "chrono/std", "informalsystems-pbjson/std", "prost/std", "serde/std", "serde_json/std"] | ||
|
||
[dependencies] # In alphabetical order | ||
bytes = "1.0" | ||
informalsystems-pbjson = { path = "../pbjson", version = "0.6.0" , default-features = false } | ||
|
||
bytes = { version = "1.0", default-features = false } | ||
chrono = { version = "0.4", default-features = false, features = ["alloc"] } | ||
informalsystems-pbjson = { path = "../pbjson", version = "0.5" , default-features = false } | ||
prost = { version = "0.11", default-features = false } | ||
prost = { version = "0.11", default-features = false, features = ["prost-derive"] } | ||
serde = { version = "1.0", features = ["derive"], default-features = false } | ||
|
||
[dev-dependencies] | ||
serde_json = "1.0" | ||
serde_json = { version = "1.0", default-features = false, features = ["alloc"] } | ||
|
||
[build-dependencies] # In alphabetical order | ||
[build-dependencies] | ||
informalsystems-pbjson-build = { path = "../pbjson-build", version = "0.6.0" } | ||
prost-build = "0.11" | ||
informalsystems-pbjson-build = { path = "../pbjson-build", version = "0.5" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "informalsystems-pbjson" | ||
version = "0.5.1" | ||
version = "0.6.0" | ||
authors = ["Raphael Taylor-Davies <[email protected]>"] | ||
edition = "2021" | ||
description = "Utilities for pbjson conversion" | ||
|