
Library name:       workflowskit
Version:            3.0.23
Repository URL:     ssh://git@dvcs.comalatech.com:7999/comp/workflowskit
License:            Custom: https://corp.comalatech.com/display/Operations/Node
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.
```

## How to release ([Node library publicacion](https://corp.comalatech.com/display/Operations/Node+Library+publication))

**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. Create a `feature/X.X.X` 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. (### MUST BE UPDATED ####)
3. Update `CHANGELOG.md` with the issues fixed in the new release.
4. Push changes to the `feature/X.X.X` branch. A new SNAPSHOT will be created in Nexus.
5. Merge the PR to `develop`.
6. A new node library will be created automatically in Nexus and the last commit of develop branch will be tagged with the new version.
7.  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
```

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

9. 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)


## Publish StoryBook
The storyBook will be uploaded into a S3 when a new library has been published successfully
StoryBook URL: https://workflowskit.ci.comala.zone
