The leading slash is a Meteor thing. My experiments led me to the exact same point. The namedExports gets around the “/” problem in addition to using the import syntax I like, but creates another maintenance issue.
I found that Cmd-Shift+I worked as long as I didn’t ask it to find any packages. i.e. if I deleted a line importing one of my methods, it added it back with no problem. But, if I deleted the import of SimpleSchema or Meteor, it gave me an exception.
Following a hunch, I defined namedExports for all of the packages that one of my modules used and Cmd-Shift+I then worked fine.
So, this is quite usable if you go through your .meteor/packages file and define namedExports corresponding to every package. But then, that seems to defeat some of the purpose.
I’m just in my initial stages of trying to understand the code, but thinking that this needs to be altered to parse and use the information from Meteor’s .meteor/package, .meteor/versions, and package.js files in the same way that it already parses package.json files. It also needs to support Meteors absolute path implementation so that we don’t have to define namedExports for our modules just to get paths right. And it needs to know what a “core” meteor package is in order to perform the grouping.
One thought that makes me hesitate to do a whole lot on this is… how much of these problems will go away in 1.5? The “/” thing, probably not. And it wouldn’t go away for legacy packages. But npm packages should work fine with this out of the box.
Maybe, due to the legacy package issue (they might be around for a long time), it’s worth customizing this to support them.
Anytway, it appears to be a promising starting point!