|
|
|
|
|
|
1
|
+# Tracim lib
|
|
|
2
|
+
|
|
|
3
|
+This project is used to centralize generic components that are used either in Tracim and in Tracim's apps.
|
|
|
4
|
+
|
|
|
5
|
+### For development
|
|
|
6
|
+While working on Tracim and on tracim_lib, if you change tracim_lib, for the changes to be effective in Tracim you must:
|
|
|
7
|
+- run `$ npm run build` on tracim_lib
|
|
|
8
|
+- add the generated dist/tracim_lib.js to git stage
|
|
|
9
|
+- commit and push changes to tracim_lib
|
|
|
10
|
+- increase version number of tracim_lib (package.json)
|
|
|
11
|
+- commit push the new version
|
|
|
12
|
+- run `$ npm update tracim_lib` in Tracim to get the new version
|
|
|
13
|
+
|
|
|
14
|
+#### Alternatively you can (faster for development)
|
|
|
15
|
+- create a link of tracim_lib using npm: in tracim_lib `$ npm link`
|
|
|
16
|
+- get that link in tracim: in tracim (repo) `$ npm link tracim_lib`
|
|
|
17
|
+- in tracim_lib: run `$ npm run build`
|
|
|
18
|
+
|
|
|
19
|
+now, you only have to rebuild tracim_lib and tracim will update it's tracim_lib dependency automatically
|
|
|
20
|
+
|
|
|
21
|
+Problem: eslint will parse tracim_lib.js since it will come from another repository.
|
|
|
22
|
+
|
|
|
23
|
+Solution: you must add `/* eslint-disable */` at the beginning and `/* eslint-enable */` at the end of tracim_lib.js
|
|
|
24
|
+
|
|
|
25
|
+To automatize this: build tracim_lib with that command:
|
|
|
26
|
+
|
|
|
27
|
+`npm run build && echo '/* eslint-disable */' | cat - dist/tracim_lib.js > temp && mv temp dist/tracim_lib.js && printf '\n/* eslint-enable */\n' >> dist/tracim_lib.js`
|
|
|
28
|
+
|
|
|
29
|
+You can also create an alias for this in your .bashrc
|