2019-10-07 17:16:27 +02:00
|
|
|
# foris-js
|
2020-08-18 15:39:00 +02:00
|
|
|
|
2019-12-06 16:18:58 +01:00
|
|
|
Set of utils and common React elements for reForis.
|
2019-10-07 17:16:27 +02:00
|
|
|
|
|
|
|
## Publishing package
|
|
|
|
|
|
|
|
### Beta versions
|
|
|
|
|
|
|
|
Each commit to `dev` branch will result in publishing a new version of library
|
2020-08-18 15:39:00 +02:00
|
|
|
tagged `beta`. Versions names are based on commit SHA, e.g.
|
2019-10-22 10:24:10 +02:00
|
|
|
`foris@0.1.0-beta.d9073aa4`.
|
2019-10-07 17:16:27 +02:00
|
|
|
|
|
|
|
### Preparing a release
|
|
|
|
|
|
|
|
1. Crete a merge request to `dev` branch with version bumped
|
|
|
|
2. When merging add `[skip ci]` to commit message to prevent publishing
|
2020-08-18 15:39:00 +02:00
|
|
|
unnecessary version
|
2019-10-07 17:16:27 +02:00
|
|
|
3. Create a merge request from `dev` to `master` branch
|
|
|
|
4. New version should be published automatically
|
2020-01-17 12:21:21 +01:00
|
|
|
|
|
|
|
## Manually managed dependencies
|
2020-08-18 15:39:00 +02:00
|
|
|
|
|
|
|
Because of `<ForisForm />` component it's required to use exposed
|
|
|
|
`ReactRouterDOM` object from `react-router-dom` library. `ReactRouterDOM` is
|
|
|
|
exposed by
|
2020-01-17 12:21:21 +01:00
|
|
|
[reForis](https://gitlab.labs.nic.cz/turris/reforis/reforis/blob/master/js/webpack.config.js).
|
|
|
|
It can be done by following steps:
|
2020-08-18 15:39:00 +02:00
|
|
|
|
|
|
|
1. Setting `react-router-dom` as `peerDependencies` and `devDependencies` in
|
|
|
|
`package.json`.
|
2020-01-17 12:21:21 +01:00
|
|
|
2. Adding the following rules to `externals` in `webpack.conf.js` of the plugin:
|
|
|
|
|
|
|
|
```js
|
|
|
|
externals: {
|
|
|
|
...
|
|
|
|
"react-router-dom": "ReactRouterDOM",
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-06-04 22:52:24 +02:00
|
|
|
### Docs
|
2020-08-18 15:39:00 +02:00
|
|
|
|
2020-06-04 22:52:24 +02:00
|
|
|
Build or watch docs to get more info about library:
|
2020-08-18 15:39:00 +02:00
|
|
|
|
2020-06-04 22:52:24 +02:00
|
|
|
```bash
|
|
|
|
make docs
|
|
|
|
```
|
2020-08-18 15:39:00 +02:00
|
|
|
|
2020-06-04 22:52:24 +02:00
|
|
|
or
|
2020-08-18 15:39:00 +02:00
|
|
|
|
2020-06-04 22:52:24 +02:00
|
|
|
```bash
|
|
|
|
make docs-watch
|
|
|
|
```
|