
EchoCore
Everything a Echo app needs to communicate with the core.


Install
NPM
$ npm install @equinor/echo-core --save
Development
First time usage, run following command first:
$ npm install
NPM build
$ npm run build
NPM build watch
$ npm run start
Writing and running tests
First time usage, run following command first:
$ npm install
- Install jest globally
- Run tests:
- Run this command for running test with watch:
$ npm test
- And run this command for test coverage:
$ npm test-coverage
- And run this command to not do npm clean install when running tests:
$ npm test-wo-install
Link echo-core
- Navigate to cloned echo-core repository
cd ~/repos/EchoCore
npm link
- Navigate to repository to link to
cd ~/repo/my-app-to-link-to
npm link @equinor/echo-core
-
Install npm-local-development if not already done: npm i -g npm-local-development
my-app-to-link-to must have a links.json file with link to react (and other peerDependencies in use), if not you will experience multiple versions of react when running my-app-to-link-to
-
Navigate to cloned echo-core repository and then run npm install
and npm start
cd ~/repos/EchoCore
npm install
npm start
- In link repository run following,
npm-local-development ../EchoCore
should be run in background. open new terminal and run npm start
cd ~/repo/my-app-to-link-to
npm-local-development ../EchoCore
cd ~/repo/my-app-to-link-to
npm start
Linking of echo-core should now be set up and you can run both builds with watch
OBS! Run npm install
before linking, if not you might have to unlink to be able to install packages
Unlinking echo-core
- Navigate to repository to link to
cd ~/repos/my-app-to-link-to
npm unlink --no-save @equinor/echo-core
- Navigate to cloned echo-core repository
cd ~/repos/EchoCore
npm unlink
- Stop
npm-local-development ../EchoCore
script (it watches for changes to echo-core dependencies)
Order is important
OBS: Errors when switching branches can happen if link is not unlinked properly before linking in the branch switched to. Symlink is unable to find the package after switching branch because the folders don’t exist. When this happens, check out your original branch and start from the beginning with linking the package and the project.