Skip to content

Commit

Permalink
Release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
unleashy committed May 31, 2021
1 parent e2426a1 commit e3ef050
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
34 changes: 29 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.0] - 2021-05-31

### Added
- `ValidationError`, thrown when a validation error occurs.
- `Infer<S>` takes a `SchemaParser` and returns the final parsed structure.
- `trim` is a transformer that trims both ends of a given string.
- `defaultTo` is a transformer that applies a default value if necessary.

### Changed
- **BREAKING CHANGE:** Vahv now uses a
[parsing](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/)
methodology rather than a validation one. Thus, there are many breaking
changes.
- **BREAKING CHANGES:**
- Vahv now uses a [parsing](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/)
methodology rather than a validation one. Thus, there are many breaking
changes.
- `and` is now always async and can always take async
parsers.
- `Validator` and `AsyncValidator` have been renamed to `SyncParser` and
`AsyncParser` respectively. `Parser` now refers to an union of `SyncParser`
and `AsyncParser`.
- `schema`’s returned function now returns the parsed contents of the given
data object. If there is a validation error, it throws `ValidationError`.
- The internal file structure has changed.
- The messages object may not be exhaustive with regard to the given parsers
anymore, because then you'd need to give error messages for transformers. If
an error message is missing, an error will be thrown at runtime.
- Development dependencies have been upgraded to their latest version.

### Removed
- **BREAKING CHANGE:** `asyncAnd` has been removed. Use `and` instead.

## [0.2.0] - 2020-10-06

Expand All @@ -30,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Added
- Vahv itself! This is its first release.

[Unreleased]: https://github.com/unleashy/vahv/compare/v0.2.0...HEAD
[Unreleased]: https://github.com/unleashy/vahv/compare/v0.3.0...HEAD
[0.3.0]: https://www.npmjs.com/package/vahv/v/0.3.0
[0.2.0]: https://www.npmjs.com/package/vahv/v/0.2.0
[0.1.0]: https://www.npmjs.com/package/vahv/v/0.1.0
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ schema({ ... }, defaultMessages);

Since the error message dictionary is a simple object, you can use object
spread to replace messages as needed with the above technique. Also note that
you get full typing support in the error message dictionary, and it will error
out if a message is missing!
you get full typing support in the error message dictionary.

### Limitations

Expand All @@ -179,6 +178,12 @@ TODO
Vahv uses Yarn for development. Use `yarn install` to install all dependencies,
`yarn test` to run all tests, and `yarn lint` to prettify and lint the codebase.

### Releasing

1. Edit CHANGELOG.md to document each change appropriately
2. Commit with message "Release vx.y.z"
3. `yarn publish`

## License

[MIT.](LICENSE.txt)

0 comments on commit e3ef050

Please sign in to comment.