Data Driven Forms is a monorepo that uses Lerna and yarn workspaces, so you can use all its commands as well.
yarn install
yarn build
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.
Don't forget to build all packages, which are linked together!
Each package has a small playground package/demo
, where you can test your changes.
cd packages/pf3-component-mapperyarn start
The documentation is a server-side rendered React application based on NextJS framework.
cd packages/react-renderer-demoyarn dev
yarn lerna clean # will delete all node_modules
Tests needed to be run from the core folder.
yarn testyarn test packages/pf3-component-mapper
Data Driven Forms uses Semantic Release
Format:
[type]([package]): messagefix(pf3): title accepts node
Types:
feat
: a new feature, will trigger new_.X._
releasefix
: a fix, will trigger new_._.X
release
Packages:
- Please describe which package is being changed
pf3
,renderer
, ...
Please, do not use Semantic Release, if you update only the demo.
All packages are releasing together and they share the version number.
If your changes influence API or add new features, you should describe these new options in the react-renderer-demo
repository. Thanks!
To generate a mapper template, run:
yarn generate-template
This command starts a CLI, that provides an interface for generating mappers. A mapper folder will be created and it will be populated with all neccesary files.
To add additional examples of custom form components, please follow these steps.
- Create a new markdown file in this directory: https://github.com/data-driven-forms/react-forms/tree/master/packages/react-renderer-demo/src/pages/examples.
- Wrap the whole content into
DocPage
component:
import DocPage from '@docs/doc-page';<DocPage>Your content</DocPage>
- Add this information to the file:
- Description of the component
- A problem it may help to solve
- Example of the component implementation and usage in a form
- To create an example follow these steps:
- Create a new JS file in this directory: https://github.com/data-driven-forms/react-forms/tree/master/packages/react-renderer-demo/src/examples/components/examples
- Import the code example using this path
components/examples/<file name without extenstion>
import CodeExample from '@docs/code-example';<CodeExample source="components/examples/sample-example" mode="preview" />
- Add the component to the navigation. Add a new object to this file: https://github.com/data-driven-forms/react-forms/blob/master/packages/react-renderer-demo/src/components/navigation/schemas/custom-examples.schema.js
- Title: text of the link
- Component: exact filename of the markdown file