-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add reschema back to the monorepo
- Loading branch information
1 parent
3864e68
commit fa82583
Showing
40 changed files
with
4,960 additions
and
28 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
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,15 @@ | ||
name: build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: 14 | ||
|
||
- run: npm i | ||
- run: npm run rescript:build |
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,39 @@ | ||
name: Create version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
versionType: | ||
description: Version type | ||
required: true | ||
default: 'patch' | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
- premajor | ||
- preminor | ||
- prepatch | ||
- prerelease | ||
|
||
|
||
jobs: | ||
create-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ssh-key: ${{ secrets.ADMIN_SSH_KEY }} | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 15 | ||
- run: | | ||
git config user.name rescriptbr-admin | ||
git config user.email [email protected] | ||
- name: Generate new version ${{ github.event.inputs.versionType }} | ||
run: npm version ${{ github.event.inputs.versionType }} | ||
|
||
- name: Push the tags | ||
run: git push origin master --tags |
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,29 @@ | ||
name: publish package on npm | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- run: npm i | ||
- run: npm run rescript:build | ||
|
||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm publish --access=public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.ADMIN_NPM_TOKEN}} |
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,4 @@ | ||
lib/ | ||
*.bs.js | ||
.merlin | ||
node_modules |
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,5 @@ | ||
lib | ||
*.bs.js | ||
__tests__ | ||
.merlin | ||
demo/ |
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 @@ | ||
15.0.1 |
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,89 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
## [2.0.3](https://github.com/Astrocoders/reform/compare/[email protected]@2.0.3) (2021-01-07) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* **regex:** export ([3a880d0](https://github.com/Astrocoders/reform/commit/3a880d045de867b33b983b29b05ba29c64f0879e)) | ||
|
||
|
||
|
||
|
||
|
||
## [2.0.2](https://github.com/Astrocoders/reform/compare/[email protected]@2.0.2) (2021-01-07) | ||
|
||
|
||
### Features | ||
|
||
* **regexp:** better email regexp ([03e105b](https://github.com/Astrocoders/reform/commit/03e105bce60e842945641b83d5a45a645e39196a)) | ||
|
||
|
||
|
||
|
||
|
||
## [2.0.2-alpha.0](https://github.com/Astrocoders/reform/compare/[email protected]@2.0.2-alpha.0) (2020-08-31) | ||
|
||
|
||
### Features | ||
|
||
* **reschema:** add true_ and false_ validators ([b05d3d6](https://github.com/Astrocoders/reform/commit/b05d3d60564cd2a412935efe2e924a2156f19575)) | ||
* **reschema:** make errors straight strings ([72f7da4](https://github.com/Astrocoders/reform/commit/72f7da4133cf68492f8357b750814e0b4ab95807)) | ||
|
||
|
||
|
||
|
||
|
||
## [2.0.1-alpha.0](https://github.com/Astrocoders/reform/compare/[email protected]@2.0.1-alpha.0) (2020-07-30) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* **optimisations:** minor optimizations ([24ce4ca](https://github.com/Astrocoders/reform/commit/24ce4cace3eefbbab656e8349f3a3eab22d67922)) | ||
|
||
|
||
### Features | ||
|
||
* **meta:** meta field ([78ec9aa](https://github.com/Astrocoders/reform/commit/78ec9aa68f0f07246e2e3863dd6efd95b7b60c88)) | ||
|
||
|
||
|
||
|
||
|
||
# [2.0.0-alpha.0](https://github.com/Astrocoders/reform/compare/[email protected]@2.0.0-alpha.0) (2020-07-30) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* **setup:** setup for monorepo watcher ([c4dd831](https://github.com/Astrocoders/reform/commit/c4dd8315574a1d74e90b930cb10c1b01a9ef4d38)) | ||
|
||
|
||
### Features | ||
|
||
* **monorepo:** setup BS monorepo ([f702b09](https://github.com/Astrocoders/reform/commit/f702b0934f772c77ccd6e0eb01d98bdb5fc46c1e)) | ||
* **nested-errors,custom-errors:** add nested errors for field array ([8dcf20a](https://github.com/Astrocoders/reform/commit/8dcf20aa5e20bd383a2836c16ae64b8cbe38c5ca)) | ||
* **reschema:** use inline records for validators ([bdefa25](https://github.com/Astrocoders/reform/commit/bdefa25041429264f733bbdf8eb2ee7bc96884a5)) | ||
* **reschema:** validator helpers ([a4e404c](https://github.com/Astrocoders/reform/commit/a4e404c77637c3b7e13a702186f21d68c6b1419f)) | ||
* **validators:** easier composition ([43c9bb8](https://github.com/Astrocoders/reform/commit/43c9bb8c8bacc7497d91ac43d948bcf69a5a0edf)) | ||
|
||
|
||
|
||
|
||
|
||
## [1.3.1](https://github.com/Astrocoders/reform/compare/[email protected]@1.3.1) (2020-06-23) | ||
|
||
**Note:** Version bump only for package reschema | ||
|
||
|
||
|
||
|
||
|
||
# [1.3.0](https://github.com/Astrocoders/reform/compare/[email protected]@1.3.0) (2019-11-22) | ||
|
||
|
||
### Features | ||
|
||
* **reschema:** add method validateFields ([4b712a3](https://github.com/Astrocoders/reform/commit/4b712a3)) |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 | ||
|
||
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. |
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,43 @@ | ||
<p align="center"> | ||
<img src="./assets/cover.svg" /> | ||
<br /> | ||
</p> | ||
<p align="center"> | ||
<a href="#what-is-this-">What is this?</a> • | ||
<a href="#features-">Features</a> • | ||
<a href="#installation-">Installation</a> • | ||
<a href="#documentation-">Documentation</a> • | ||
<a target="_blank" href="https://reform-demo.rescriptbrasil.org">Live demo (with ReForm)</a> | ||
</p> | ||
<br/> | ||
|
||
## What is this? 💡 | ||
ReSchema is a schema builder for ReScript. We created ReSchema to be deadly simple, leveraging ReScript's powerful typesytem. | ||
Schemas created with ReSchema are nothing more than constructors built-in in the language itself with a small size footprint. | ||
|
||
## Features ⚡ | ||
- Schema validation using GADT's | ||
- Built-in validators | ||
- Type-safe validation | ||
- I18n support | ||
- Regex support | ||
- Custom validations | ||
|
||
## Installation 📦 | ||
|
||
```sh | ||
yarn add @rescriptbr/reschema | ||
``` | ||
and then, add `ReSchema` as a dependency in your `bsconfig.json` | ||
```js | ||
{ | ||
... | ||
"bs-dependencies": [ | ||
"@rescriptbr/reschema" | ||
], | ||
} | ||
``` | ||
|
||
## Documentation 🔎 | ||
- [Getting Started](./docs/1-getting-started.md) | ||
- [API Reference](./docs/2-api-reference.md) |
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 @@ | ||
type testable<'a> | ||
type jestFn | ||
|
||
@val @scope("jest") external fn0: (unit => 'a) => jestFn = "fn" | ||
@val @scope("jest") external fn1: ('a => 'b) => jestFn = "fn" | ||
@val @scope("jest") external fn2: (('a, 'b) => 'c, 'a, 'b) => 'c = "fn" | ||
|
||
@val external describe: (string, (. unit) => unit) => unit = "describe" | ||
@val external it: (string, (. unit) => unit) => unit = "it" | ||
@val external test: (string, (. unit) => unit) => unit = "test" | ||
|
||
@val external expect: 'value => testable<'value> = "expect" | ||
@val external expectFn: jestFn => testable<'value> = "expect" | ||
@val external expectArray: array<'value> => testable<'value> = "expect" | ||
|
||
@send external toBe: (testable<'value>, 'value) => unit = "toBe" | ||
@send external toEqual: (testable<'value>, 'value) => testable<'value> = "toEqual" | ||
@send external toStrictEqual: (testable<'value>, 'value) => testable<'value> = "toStrictEqual" | ||
@send external toContain: (testable<'value>, 'value) => testable<'value> = "toContain" | ||
@send external toHaveBeenCalled: (testable<'value>, unit) => testable<'value> = "toHaveBeenCalled" | ||
@send | ||
external toHaveBeenCalledTimes: (testable<'value>, int) => testable<'value> = | ||
"toHaveBeenCalledTimes" | ||
|
||
@get external not: testable<'value> => testable<'value> = "not" |
Oops, something went wrong.