Skip to content

Commit

Permalink
chore: publish 0.2.1 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Jun 7, 2023
1 parent d031a0a commit 0e9e3eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "package_json_schema"
version = "0.2.0"
version = "0.2.1"
authors = ["Ifiok Jr. <[email protected]>"]
categories = ["encoding", "config"]
documentation = "https://docs.rs/package_json_schema"
Expand Down
9 changes: 8 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

## [Unreleased]

> [Compare](https://github.com/ifiokjr/package_json_schema/compare/0.2.0...HEAD)
> [Compare](https://github.com/ifiokjr/package_json_schema/compare/0.2.1...HEAD)
## 0.2.1

- Use the `Repository` enum in the `repository` field [#2](https://github.com/ifiokjr/package_json_schema/pull/2)
- Update readme and crate documentation.

> [Compare](https://github.com/ifiokjr/package_json_schema/compare/0.2.0...0.2.1)
## 0.2.0

Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ You want to load a `package.json` file and interact with it as a struct.
Add this line to the `[dependencies]` section of your `Cargo.toml`:

```toml
package_json_schema = "0.2.0"
package_json_schema = "0.2.1"
```

If you would like to include validation then add the `validate` feature.

```toml
package_json_schema = { version = "0.2.0", features = ["validate"] }
package_json_schema = { version = "0.2.1", features = ["validate"] }
```

This adds the `validator` crate as a dependency and adds the `.validate()` method to the `PackageJson` struct. The fields are validated according to the [JSON schema specification](https://json.schemastore.org/package.json).
Expand All @@ -55,7 +55,7 @@ use package_json_schema::PackageJson;
let contents = r###"
{
"name": "my-package",
"version": "0.2.0",
"version": "0.0.1",
"dependencies": {
"@sveltejs/kit": "1.0.0-next.396"
},
Expand All @@ -67,7 +67,7 @@ let contents = r###"

let package_json = PackageJson::try_from(contents).unwrap();
assert_eq!(package_json.name.unwrap(), "my-package");
assert_eq!(package_json.version.unwrap(), "0.2.0");
assert_eq!(package_json.version.unwrap(), "0.0.1");
```

This crate leaves it to the user to load the `package.json` content from the filesystem. Here is an example of loading the file contents and parsing the contents into a struct.
Expand Down Expand Up @@ -109,7 +109,7 @@ assert_eq!(
To validate the `package.json` fields, enable the `validate` feature.

```toml
package_json_schema = { version = "0.2.0", features = ["validate"] }
package_json_schema = { version = "0.2.1", features = ["validate"] }
```

And then use the `validate` method.
Expand Down

0 comments on commit 0e9e3eb

Please sign in to comment.