-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comprehend Sugared AMD Modules #8
Comments
I'm using this style myself in a project and it seems to work pretty well for me. Can you give me a more detailed example so I can try to reproduce it? |
Well, then....it's highly likely I just have no idea what I'm doing 😄 Here's a link to the code I was trying to generate a graph of: https://github.com/EisenbergEffect/Durandal/tree/master/app/durandal Let me know if I can help any other way. Thanks! |
Hehe, I'm sure you know what you're doing :) I tried running madge on your project and it seems to be working as expected for me. Am I missing something in your code?
http://cl.ly/image/1P1K2Y1e2O0x
|
Well, would you look at that!? It works! I think I must have been using the command incorrectly. I'll give it a try myself and see what happens. |
Ok. I tried it on my machine and I get something different: app It's like it's only tracing the app module and not the other modules. I'm running this on Windows...could that be related? |
Hmm, that's weird! I never tried it in windows before .. I'll boot up my virtual machine and give it a try! |
I tried it now, and confirmed it's a problem when running madge on Windows :( To much modules that I use seems to be incompatible with Windows at this time. I can't even run the unittests. Run it on Mac or Linux and it should be ok. |
Well, that's unfortunate. Hopefully that can be remedied in the future. For now, the image you generated will actually work for me. When I need a new image...I'll swipe my wife's mac while she's not looking ;) Thanks for looking into this issue and for working on this project! |
I also was having this issue and traced it to an issue with the dependent library findit: https://github.com/substack/node-findit/issues/5 If you modify the index.js file within the findit library (as mentioned in the link above) you can enable a workaround and get madge file enumeration to work on windows. findit in turn is using node libraries for file enumeration so a related issue is opened in the node libuv package Per comments in the original issue, an alternative file enumerating library may work on windows, but would be up to pahen if he wants to change to it: https://github.com/soldair/node-walkdir |
Thanks very much @israels for looking into this issue. Since the API of node-walkdir was compatible with node-findit I've now done the switch and it seems to work just fine. Tested it in Windows too, and it works much better now. I published v0.1.4 to NPM with the fix. @EisenbergEffect may be interested to give it a spin again now I suppose :) |
Awesome! On Thu, Jan 10, 2013 at 3:41 PM, Patrik Henningsson <
Rob Eisenberg, |
Running now gives me: module.js:340 If I install the walkdir package manually, it seams to work. |
That seems very weird since package.json is up to date .. Can you list the folders in C:\Users\EisenbergEffect\AppData\Roaming\npm\node_mod Did you install walkdir globally or locally to fix the problem? |
Folder there are: coffee-script, colors, commander, commandir, detective, On Sun, Feb 3, 2013 at 9:49 AM, Patrik Henningsson <[email protected]
Rob Eisenberg, |
Strange .. and you're installing madge with NPM? If so, can you copy the entire output when running "npm install madge" and include it here? If you're installing directly from the GitHub repository can you include the output when running "npm install" in the project folder? |
Here you go: C:\Users\EisenbergEffect>npm install -g madge [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge\n [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge\no [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge\no [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\ma [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge\node_ [email protected]:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge\n [email protected] C:\Users\EisenbergEffect\AppData\Roaming\npm\node_modules\madge (Now I see walkdir...perhaps I just wasn't up to date before?) On Sun, Feb 3, 2013 at 1:53 PM, Patrik Henningsson <[email protected]
Rob Eisenberg, |
Yea, seems correct. Don't know why you had problem before .. but glad it worked for you now :) |
With require.js, you can write AMD modules using the sugared syntax:
define(function(require){
var mod1 = require('mod1') ;
});
I've run madge over a project which uses this, but it only seems to detect the top most module dependencies and not the rest.
The text was updated successfully, but these errors were encountered: