Skip to content

Commit eae6b45

Browse files
authored
Merge pull request #155 from rvsia/devel-setup
Add Development setup
2 parents c0b07a8 + bd580e0 commit eae6b45

File tree

8 files changed

+1025
-6
lines changed

8 files changed

+1025
-6
lines changed

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ Used by [ManageIQ](http://manageiq.org/), Red Hat Cloud Services.
3838
- [Basic provided components](#basic-provided-components)
3939
- [Documentation](#documentation)
4040
- [Useful links](#useful-links)
41+
- [Development setup](#development-setup)
42+
- [Tests](#tests)
43+
- [Commits](#commits)
44+
- [Changes to documentation](#changes-to-documentation)
4145
- [Contribution](#contribution)
4246
- [LICENSE](#license)
4347

@@ -154,6 +158,77 @@ Please use our [documentation site](https://data-driven-forms.org/). In case of
154158
- Examples of schemas (PatternFly 3)
155159
- [ManageIQ Form Components](https://github.com/ManageIQ/manageiq-ui-classic/tree/master/app/javascript/components)
156160

161+
### Development setup
162+
163+
Data Driven Forms is a monorepo which uses [Lerna](https://github.com/lerna/lerna), so you can use all its commands as well.
164+
165+
1. Install
166+
167+
```console
168+
yarn install
169+
```
170+
171+
2. Build
172+
173+
```console
174+
yarn build
175+
```
176+
177+
3. Run a package
178+
179+
Each package has a small playground `package/demo`, where you can test your changes.
180+
181+
```console
182+
cd packages/pf3-component-mapper
183+
yarn start
184+
```
185+
186+
4. How to clean?
187+
188+
```console
189+
rm yarn.lock
190+
yarn lerna clean # will delete all node_modules
191+
```
192+
193+
All packages are linked together by default, so if you run a `yarn build` in a package, all other packages are updated to the latest version of that package.
194+
195+
#### Tests
196+
197+
Tests needed to be run from the core folder.
198+
199+
```console
200+
yarn test
201+
202+
yarn test packages/pf3-component-mapper
203+
```
204+
205+
#### Commits
206+
207+
Data Driven Forms uses [Semantic Release](https://github.com/semantic-release/commit-analyzer)
208+
209+
Format:
210+
211+
```
212+
[type]([package]): message
213+
214+
fix(pf3): title accepts node
215+
```
216+
217+
Types:
218+
- `feat`: a new feature, will trigger new `_.X._` release
219+
- `fix`: a fix, will trigger new `_._.X` release
220+
221+
Packages:
222+
- Please describe which package is being changed `pf3`, `renderer`, ...
223+
224+
Please, do not use Semantic Release, if you update only the demo.
225+
226+
All packages are releasing together and they share the version number.
227+
228+
#### Changes to documentation
229+
230+
If your changes influence API or add new features, you should describe these new options in the `demo` repository. Thanks!
231+
157232
### Contribution
158233

159234
We welcome any community contribution. Don't be afraid to report bug or to create issues and pull-requests! :trophy:
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
[![Data Driven Form logo](images/logo.png)](https://data-driven-forms.org/)
2+
3+
Material-UI component mapper for [Data Driven Forms](https://github.com/data-driven-forms/react-forms).
4+
5+
:book: For more information please visit the [documentation](https://data-driven-forms.org/). :book:
6+
7+
Used by [ManageIQ](http://manageiq.org/), Red Hat Cloud Services.
8+
9+
**Table of Contents**
10+
11+
- [Installation](#installation)
12+
- [React Form Renderer](#react-form-renderer)
13+
- [MUI mapper](#mui-mapper)
14+
- [Usage](#usage)
15+
- [Basic provided components](#basic-provided-components)
16+
- [Useful links](#useful-links)
17+
- [Development setup](#development-setup)
18+
- [Tests](#tests)
19+
- [Commits](#commits)
20+
- [Changes to documentation](#changes-to-documentation)
21+
- [Contribution](#contribution)
22+
- [LICENSE](#license)
23+
24+
### Installation
25+
26+
You neet to add React Form Renderer
27+
28+
#### [React Form Renderer](https://www.npmjs.com/package/@data-driven-forms/react-form-renderer)
29+
30+
```console
31+
$ npm install @data-driven-forms/react-form-renderer -S
32+
```
33+
34+
```console
35+
$ yarn add @data-driven-forms/react-form-renderer
36+
```
37+
38+
Optionally you can install one of provided mappers:
39+
40+
#### [MUI mapper](https://www.npmjs.com/package/@data-driven-forms/mui-component-mapper)
41+
42+
```console
43+
$ npm install @data-driven-forms/mui-component-mapper -S
44+
```
45+
46+
```console
47+
$ yarn add @data-driven-forms/mui-component-mapper
48+
```
49+
50+
51+
### Usage
52+
53+
For using Data Driven Forms in your component you need the renderer and a component mapper, which provides formFields components and layoutFields components.
54+
55+
```jsx
56+
import React from 'react';
57+
import FormRenderer, { componentTypes } from '@data-driven-forms/react-form-renderer';
58+
import { formFieldsMapper, layoutMapper } from '@data-driven-forms/mui-component-mapper';
59+
60+
const schema = {
61+
fields: [{
62+
component: componentTypes.TEXT_FIELD,
63+
name: 'name',
64+
label: 'Your name'
65+
}]
66+
}
67+
68+
const Form = () => (
69+
<FormRenderer
70+
schema={schema}
71+
formFieldsMapper={formFieldsMapper}
72+
layoutMapper={layoutMapper}
73+
onSubmit={console.log}
74+
/>
75+
)
76+
```
77+
78+
### Basic provided components
79+
80+
Data Driven Forms supports all kinds of component, basic set is consisted of:
81+
82+
- Text input
83+
- Text area
84+
- Checkbox (Multiple checkboxes)
85+
- Select (dropdown)
86+
- Switch
87+
- Radio buttons
88+
- Date picker
89+
- Time picker
90+
- Tabs
91+
- Sub-form
92+
- Wizard
93+
- Plain-text
94+
95+
### Useful links
96+
97+
- [Data Driven Forms documentation](https://data-driven-forms.org/)
98+
- [Material-UI documentation](https://material-ui.com/)
99+
- NPM
100+
- [React Form Renderer](https://www.npmjs.com/package/@data-driven-forms/react-form-renderer)
101+
- [MaterialUI Mapper](https://www.npmjs.com/package/@data-driven-forms/mui-component-mapper)
102+
103+
104+
### Development setup
105+
106+
Data Driven Forms is a monorepo which uses [Lerna](https://github.com/lerna/lerna), so you can use all its commands as well.
107+
108+
1. Install
109+
110+
```console
111+
yarn install
112+
```
113+
114+
2. Build
115+
116+
```console
117+
yarn build
118+
```
119+
120+
3. Run a package
121+
122+
Each package has a small playground `package/demo`, where you can test your changes.
123+
124+
```console
125+
cd packages/mui-component-mapper
126+
yarn start
127+
```
128+
129+
4. How to clean?
130+
131+
```console
132+
rm yarn.lock
133+
yarn lerna clean # will delete all node_modules
134+
```
135+
136+
All packages are linked together by default, so if you run a `yarn build` in a package, all other packages are updated to the latest version of that package.
137+
138+
#### Tests
139+
140+
Tests needed to be run from the core folder.
141+
142+
```console
143+
yarn test
144+
145+
yarn test packages/mui-component-mapper
146+
```
147+
148+
#### Commits
149+
150+
Data Driven Forms uses [Semantic Release](https://github.com/semantic-release/commit-analyzer)
151+
152+
Format:
153+
154+
```
155+
[type]([package]): message
156+
157+
fix(mui): title accepts node
158+
```
159+
160+
Types:
161+
- `feat`: a new feature, will trigger new `_.X._` release
162+
- `fix`: a fix, will trigger new `_._.X` release
163+
164+
Packages:
165+
- Please describe which package is being changed `pf3`, `renderer`, ...
166+
167+
Please, do not use Semantic Release, if you update only the demo.
168+
169+
All packages are releasing together and they share the version number.
170+
171+
#### Changes to documentation
172+
173+
If your changes influence API or add new features, you should describe these new options in the `demo` repository. Thanks!
174+
175+
### Contribution
176+
177+
We welcome any community contribution. Don't be afraid to report bug or to create issues and pull-requests! :trophy:
178+
179+
### LICENSE
180+
181+
Apache License 2.0

0 commit comments

Comments
 (0)