bradymiller wrote on Tuesday, July 05, 2016:
Hi,
Building on above commit, decided to see what happens if bring in “react” and “literallycanvas” libraries via bower instead (Rod brought this into the codebase very recently for the drawing widget on the LBF forms). And odd things happen when a package has dependencies (in this case the literallycanvas package has react as a dependency). Here is what happens with the following bower.json file:
{
"name": "openemr",
"homepage": "http://www.open-emr.org",
"authors": [
"OpenEMR"
],
"description": "",
"main": "",
"license": "GPL3",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"font-awesome-4-6-3": "font-awesome#4.6.3",
"literallycanvas-0-4-13": "literallycanvas#0.4.13",
"react-15-1-0": "react#15.1.0"
}
}
If I then do “bower install”, get the following output:
[21:51][brady2@nonsense:~/git/openemr(bower-improvement_2)]$ bower install
bower literallycanvas-0-4-13#0.4.13 cached https://github.com/literallycanvas/literallycanvas-bower.git#0.4.13
bower literallycanvas-0-4-13#0.4.13 validate 0.4.13 against https://github.com/literallycanvas/literallycanvas-bower.git#0.4.13
bower react-15-1-0#15.1.0 cached https://github.com/facebook/react-bower.git#15.1.0
bower react-15-1-0#15.1.0 validate 15.1.0 against https://github.com/facebook/react-bower.git#15.1.0
bower react#0.14.3 cached https://github.com/facebook/react-bower.git#0.14.3
bower react#0.14.3 validate 0.14.3 against https://github.com/facebook/react-bower.git#0.14.3
bower literallycanvas-0-4-13#0.4.13 install literallycanvas-0-4-13#0.4.13
bower react#0.14.3 install react#0.14.3
bower react-15-1-0#15.1.0 install react-15-1-0#15.1.0
literallycanvas-0-4-13#0.4.13 interface/static/literallycanvas-0-4-13
└── react#0.14.3
react#0.14.3 interface/static/react
react-15-1-0#15.1.0 interface/static/react-15-1-0
And when then do a ‘bower list’, get the following output:
[21:51][brady2@nonsense:~/git/openemr(bower-improvement_2)]$ bower list
bower check-new Checking for new versions of the project dependencies...
openemr /home/brady2/git/openemr
├── font-awesome-4-6-3#4.6.3
├─┬ literallycanvas-0-4-13#0.4.13
│ └── react#0.14.3 (latest is 15.2.0)
└── react-15-1-0#15.1.0 (latest is 15.2.0)
The issue here is that bower is creating an unneeded library at interface/static/react/ !!
Here is the commit after I do this (along with changes in Rod’s prior code to use the new libraries). It would be working perfectly except for that pesky unneeded interface/static/react/ library:
Does anybody know of a way to avoid this type of thing in bower?
thanks,
-brady
OpenEMR