Skip to content

Commit 87ed007

Browse files
author
Romulo Bordezani
committed
Updating Docs
1 parent 6df7356 commit 87ed007

3 files changed

Lines changed: 177 additions & 14 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at bluebill1049@hotmail.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing to `Formoose`
2+
3+
As the creators and maintainers of this project, we want to ensure that `formoose` lives and continues to grow and evolve. We would like to encourage everyone to help and support this library by contributing.
4+
5+
## Code contributions
6+
7+
Here is a quick guide to doing code contributions to the library.
8+
9+
1. Fork and clone the repo to your local machine `git clone https://github.com/YOUR_GITHUB_USERNAME/formoose.git`
10+
11+
2. Create a new branch from `main` with a meaningful name for a new feature or an issue you want to work on: `git checkout -b your-meaningful-branch-name`
12+
13+
3. Install packages by running:
14+
15+
```shellscript
16+
yarn
17+
```
18+
19+
4. If you've added a code that should be tested, ensure the test suite still passes.
20+
21+
```shellscript
22+
yarn test
23+
```
24+
25+
5. Try to write some unit tests to cover as much of your code as possible.
26+
27+
6. Ensure your code lints without errors.
28+
29+
```shellscript
30+
yarn lint
31+
```
32+
33+
7. Type Script will compile to `dist` folder, use `yarn link`.
34+
35+
Go to the [example repository](https://github.com/romulobordezani/formoose-examples) and run:
36+
37+
```shell
38+
yarn link formoose
39+
```
40+
Run `yarn start` and the browser should open with some examples using your local Formoose's code. Now you can test and debug your changes.
41+
42+
8. Ensure build passes.
43+
44+
```shellscript
45+
yarn build
46+
```
47+
48+
9. Push your branch: `git push -u origin your-meaningful-branch-name`
49+
50+
10. Submit a pull request to the upstream formoose repository.
51+
52+
11. Choose a descriptive title and describe your changes briefly.
53+
54+
## Coding style
55+
56+
Please follow the coding style of the project. Formoose uses eslint and prettier. If possible, enable their respective plugins in your editor to get real-time feedback. The linting can be run manually with the following command: `yarn lint`.
57+
58+
## License
59+
60+
By contributing your code to the formoose GitHub repository, you agree to license your contribution under the MIT license.
61+
62+
### Contributors
63+
64+
Thank you to all the people who have already contributed to Formoose!
65+
66+
<img src="https://opencollective.com/formoose/contributors.svg?width=950" />

README.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,30 @@
77
[![npm version](https://img.shields.io/npm/v/formoose.svg?style=flat)](https://www.npmjs.com/package/formoose)
88
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)
99
<br /><br />
10-
#### Mongoose's schema based validation engine, made to integrate back and front-end validations easily and using same schemas
10+
#### Formoose is a runtime **validation engine**, based on Mongoose's 🐻 schemas.
1111

12-
It **IS NOT** intended to do magic and generate automatically Html forms and fields, styles, and React components.
12+
Meant to integrate `React Controled Forms` with back-end APIs using [MongoDB](https://www.mongodb.com/).
1313

14-
It **DOES** provide tools to validate the same Mongoose Schema using `React & Hooks` and `Node.js` integrating back and front end validations in the same source.
14+
It **IS NOT** intended to do magic and generate automatically HTML forms, fields, nor styles, or React components for you.
15+
16+
It **DOES** provide an easy way to parse and validate the same **Mongoose** Schema using `React & Hooks`, integrating back and front-end validations in the same source of truth.
17+
18+
**IMPORTANT Note**: 🐻 [Mongoose](https://mongoosejs.com/) lib isn't required at the front-side at all, you can use any schemas following [these guide lines](https://mongoosejs.com/docs/guide.html), and validate them using [Mongoose built in validators](https://mongoosejs.com/docs/validation.html#built-in-validators) at the back-end side.
1519

16-
**Important Note**: 🐻 Mongoose isn't required at all, but the supported schema follows [these guide lines](https://mongoosejs.com/docs/guide.html),
17-
what is different of [yup](https://github.com/jquense/yup) with its own .js Schemas, and also different of what [ajv](https://ajv.js.org/) does dealing with [json schemas](http://json-schema.org/).
1820

1921

2022
### Provides:
21-
* Easy to use sync/async validations of Mongoose schemas, both in Client Side using `React Hooks` or on server side using `Node.js Promises`.
23+
* Fast sync/async validations for the whole schema.
2224
* Validation for single fields
23-
* Integration with React Hook `useState`, tools available to set up errors, clean, deal with changes etc.
25+
* Tools to set up errors on specific fields, to clean, deal with changes etc.
2426
* Friendly and consistent error messages with internationalization support using [react-i18next](https://www.npmjs.com/package/react-i18next).
25-
* Configurable Error messages for each type checking
2627
* Real time validation in forms
27-
* Custom validations using simple Java Script functions
28+
* Custom validations using simple Java Script functions, which allows you to validate whatever you want like Regexes, API based validations, custom logic etc.
2829

2930

3031
#### 🚀 Getting started:
3132

32-
Example:
33+
Basic example:
3334

3435
```jsx
3536
import React, { useState } from 'react';
@@ -81,7 +82,7 @@ function FormooseFormExample() {
8182
export default FormooseFormExample;
8283
```
8384

84-
Examples available at [https://github.com/romulobordezani/formoose-example](https://github.com/romulobordezani/formoose-example)
85+
Examples available at [https://github.com/romulobordezani/formoose-example](https://github.com/romulobordezani/formoose-example) or at this [sand box](https://codesandbox.io/s/formoose-typescript-qchwm4?file=/src/components/FormooseForm/FormooseForm.tsx)
8586

8687
#### Contributing:
8788
Fell free to fork and submit changes and improvements, also please let me know if you find any [issues](https://github.com/romulobordezani/formoose/issues).
@@ -96,12 +97,32 @@ yarn
9697

9798

9899
```shell
99-
yarn start
100+
yarn dev
100101
```
101102

103+
Type Script will compile to `dist` folder, use `yarn link`.
104+
105+
Go to the [example repository](https://github.com/romulobordezani/formoose-examples) and run:
102106

103107
```shell
104-
yarn run test
108+
yarn link formoose
105109
```
110+
Run `yarn start` and the browser should open with some examples using your local Formoose's code. Now you can test and debug your changes.
111+
112+
### Looking for something else?
113+
114+
So, you reached the end of these documentation and still thinks that Formoose is not for you?
115+
116+
No problem! If you aren't interested in using `Mogoose schemas` to control your forms, or `i18n` to provide instant translations to your forms, or in the Type Script definitions to provide you a great Development Experience - in a really small package.
117+
118+
Probably you are looking for something else like:
119+
120+
* [zod](https://github.com/colinhacks/zod)
121+
* [yup](https://github.com/jquense/yup)
122+
* [ajv](https://ajv.js.org/) does dealing with [json schemas](http://json-schema.org/)
123+
* [joi](https://github.com/hapijs/joi)
124+
* [superstruct]https://github.com/ianstormtaylor/superstruct
125+
126+
And to use it with [react-hook-form.com](https://react-hook-form.com/) or [formik](https://formik.org/)
106127

107-
Type Script will compile to `dist` folder, use `npm link` within the [example repository](https://github.com/romulobordezani/formoose-examples) to run and debug your changes.
128+
Hope it helps 🍀.

0 commit comments

Comments
 (0)