
Library name:       workflowskit
Version:            2.8.1
Repository URL:     ssh://git@dvcs.comalatech.com:7999/comp/workflowskit
License:            Custom: https://nexus.comalatech.com/repository/npm-releases/
License Text:       # Workflows Kit

Collection of reusable (React-based ATM) components for workflows

## How to start

Requirements: node8 LTS

* Install dependencies: `npm install`
* Check lint and tests are ok: `npm run lint` && `npm test`
* Generate a production build: `npm run build`, yeah, it'll check both tests and lint :)
* Watch the storybook: `npm run storybook`

## How to integrate (and dev mode)

As easy as:
* add `npm install --save workflowskit`
* make sure component is **exported** at index.js facade
* add the following line to webpack config `exclude: /node_modules\/(?!(workflowskit|comalakit))/` in js(x) module, so both workflowskit and comalakit are included as ESM modules in the bundle
* pick components as usual: `import { Avatar } from 'workflowskit`

**DEV MODE**: you want to make changes into workflowskit and see them live in client code (ex. rioja)
* download the workflowskit repository (ex. into <path>/workflowskit)
* install it **locally** into client: `npm i <path>/workflowskit`: this will replace dep with a sym link (you can check with `ls -la node_modules/workflowskit`)
* start watchers for workflowskit (`npm run watch`) and rioja (or client code)
* do changes into rioja and/or workflowskit
* this is it!!

## I18n support

For components needing i18n support, we follow a slight different approach, basically you need to import /src/i18n (ex ìmport '../../i18n'), and add a customized translate hoc.  All components needing i18n should be wrapped with following code:

```
import { translate } from '<path-to>/i18n';

const MyComponent = ...

export default translate(MyComponent);
```

Please check /src/i18n/TestI18n component as POC

## Tests

We're using Jest stack for unit tests and Enzyme for integration tests

Just add a file `XXX.spec.js` under a folder in /test and it'll be run as part of the suite

## How to release

```
TODO
The following process is going to receive some improvements and automation in a near future.
```

**DISCLAIMER:** All Jira issues in a release should belong to `WK` project. If an issue comes from `CWC` or `AWP` projects, a linked Jira issue should be created in `WK` project and the branch and commits should be linked to that issue.
All Jira issues need a fix version. If you can't create a new release version in Jira in the `WK` project, ask someone to create it for you. Do not link issues to released fix versions.

1. When all issues linked to the fix version are ready to be released, create a `release` branch from `develop` and update the package version in `package.json` with the fix version. Make sure there is no `-SNAPSHOT.X` suffix in the version.
2. Run `npm install` to make sure `package-lock.json` is up to date.
3. Update `CHANGELOG.md` with the issues fixed in the new release.
4. Run `npm run build` to make sure the build works and all tests pass.
5. Push changes to the `release` branch and create a PR to `master`. Usually a `release` PR does not need review, since every issue belonging to it has already been reviewed in their corresponding PRs.
6. Merge the PR to `master`.
7. Checkout `master`, `pull` changes and run the following command:
```
npm publish --registry https://nexus.comalatech.com/repository/npm-releases/
```
8. Once you confirm the version has been published to the nexus repository, create a `tag` from the last commit to `master` using the version as the `tag` name.
9. Checkout `develop` branch and merge `master` to `develop`, then push. Confirm both `develop` and `master` branches look alike.
10. Increase `package.json` minor version by one and append `-SNAPSHOT.0` to ease the next testing / release iteration. Run `npm i` to update `package-lock.json`, commit and push to `develop`.
11.  Change the release status in JIRA to Released. If you don't see the buttons for Create version and Release, ask a Senior Frontend Developer in the team to do this.
https://comalatech.jira.com/projects/WK?selectedItem=com.atlassian.jira.jira-projects-plugin:release-page 

```
On the app that is using the snapshot version, workflows in this case, if you want it to use the latest snapshot after already using one (the x.y.z-SNAPSHOT.0 one probably) there are some manual steps to be performed until we develop the tooling to automate it, although there is a script already available that can be used) you would need to remove the snapshot dep entry from package-lock.json and the remove the lib from ./node_modules
```

11. Update Workflowskit Release Queue page https://corp.comalatech.com/pages/resumedraft.action?draftId=129439703&draftShareId=87730d22-1ae0-42b5-a7fd-447a906f30f1&

12. Post a comment on #comala-frontend channel in Slack letting everybody know about the update e.g. "@here Workflowskit version x.y.z released".



## Doco

TBD, but as a component library, we should keep both an component index and a good doco about them (work in progress)
