
Library name:       comalakit
Version:            1.7.19
Repository URL:     ssh://git@dvcs.cml.appfire.net:7999/comp/comalakit
License:            Custom: https://corp.comalatech.com/display/Operations/Node
License Text:       ComalaKit
=========
This repo contains a set of custom React components built on top of AtlasKit and that can potentially be reused by other Comalatech apps.


## How to start

Requirements: node 10.16.3

* Install dependencies: `npm install`
* Check lint and tests are ok: `npm run lint:fix` && `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:
* run `npm i comalakit -S`
* make sure component is **exported** at index.js facade
* pick components as usual: `import { Avatar } from 'comalakit'`

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

## I18n support

For components needing i18n support, we follow a slight different approach, basically you need to import /src/i18n (ex import '../../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 mocha/chai 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 `CK` project. If an issue comes from `CWC`, `AWP` or `AHLISTS` projects, a linked Jira issue should be created in `CK` 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 `CK` 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/CK?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 Comalakit Release Queue page https://corp.comalatech.com/display/DEV/Comalakit+release+queue
9. Post a comment on #comala-frontend channel in Slack letting everybody know about the update e.g. "@here Comalakit 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)
