I am currently involved in building a Windows 8 team using JavaScript. We use npm and browse browsers for dependency management and convert our modules into a format compatible with the AMD browser.
One problem we are facing is crazy ways. This is due to the fact that we have a top-level folder inside our "components" of the application. This folder contains a bunch of nested ui components / modules. These modules sometimes require lib utils and helpers, which are located in the lib directory.
So, for example, for a module living in "my / app / components / product / grid / item", you may need a helper module, which is located in "my / app / lib / helpers / view".
The required path is a little crazy and very ugly: they require ("../../../../Library/helpers/view");
We do our best to create applications in a modular way. Now I think that a suitable way to get closer to this is to make the modules of our components dependent on these auxiliary modules. I could put lib helpers in my own external git private repository, but that was painful in terms of providing other commands (plus git private repositories are slow). Plus, since these modules are used only in the application, it is a waste of time to make changes, push the changes, and then return to updating the application and npm. This is good for some, but if we really break it, it can quickly become old.
Could I do npm install "my / app / lib / helpers / view" inside the package.json components? But npm install will not automatically do this for us.
I know several other ways around this (NODE_PATH, maybe use the npm installation hook or maybe the npm preinstall script), but wanted to know if anyone has a similar problem and a good solution.
pbo
source share