generated from blb-ventures/npm-lib-template
-
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.
chore: adds MIT LICENSE file chore: adds github actions build status for the repo chore: adds examples directory link to the reference in the main README.md
- Loading branch information
Showing
3 changed files
with
50 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 BLB Ventures | ||
|
||
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
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 @@ | ||
# Examples | ||
|
||
Currently there are only example files from what we actually use in production for BLB Ventures product's. | ||
|
||
In our projects we usually use: | ||
|
||
- ReactJS | ||
- React Hook Form (with Zod) | ||
- MUI (a implementation of Material UI in ReactJS) | ||
|
||
## Directory Structure | ||
|
||
``` | ||
├── react/ | ||
│ ├── hook-form-zod.tsx (The example component) | ||
│ ├── resource-manager.ts (Example of an instance of Resource Manager (from this lib) being initialized) | ||
│ └── components/ | ||
│ ├── form-control-wrapper.tsx (MUI wrapper for the form fields to add labels and helper/error texts) | ||
│ ├── form-item.tsx (Wrapper around this lib ReactHookFormItem injecting the above FormControlWrapper and loading the initialized resource manager) | ||
│ ├── form.tsx (A form component that injects react-hook-form methods into the child components) | ||
│ └── resource-form.tsx (A utility to convert a list of fields from the resources.json info FormItem components and basically generate the form with validation) | ||
└── resources.json (The definition of the fields of every entity) | ||
``` | ||
|
||
About the `form.tsx` you can see more on the [official react-hook-form documentation example of this](https://react-hook-form.com/advanced-usage#SmartFormComponent) |