oortcloud / meteorite

Installer & smart package manager for Meteor
http://oortcloud.github.com/meteorite/
MIT License
841 stars 106 forks source link

question: app-C -> smart-pack-A -> smart-pack-B: C can't find template from B #219

Closed tony-kerz closed 10 years ago

tony-kerz commented 10 years ago

hi,

having this issue which is probably stupid, but not sure how to handle.

getting:

Exception from Deps recompute: Error: No such template 'some-template'

at run-time.

what do i need to do to insure that a template provided by smart-pack-B is visible to app-C in the dependency described in the headline above (other than just add smart-pack-B to the smart.json of smart-pack-A)?

something in the package.js of smart-pack-A...?

P.S. i seem to find some-template if i have app-C depend directly on smart-pack-B...

tmeasday commented 10 years ago

Hey,

So I think there's two solutions:

  1. add smart-pack-B in the app, as you've said.
  2. Make smart-pack-A use api.implies('smart-pack-b') (in package.js, like standard-app-packages).
tony-kerz commented 10 years ago

thx tom,

to be clear, i had already done your step (1) from above, but that didn't address the issue by itself.

but then i also added your step (2) from above api.imply('smart-pack-b', 'client') and that seemed to do the trick.

sorry, i'm having trouble finding good doc on package.js format, can you recommend best reference for that at this time?

regards, tony.

tmeasday commented 10 years ago

Hey Tony,

Slightly confused.

I thought you said if you meteor add smart-pack-b from inside your app (app-C), then you have the template available?

I would expect you have to do one or the other, not both.

Just to be clear, what we are talking about is adding the line smart-pack-b to .meteor/packages, nothing to do with smart.X.

Meteorite manages smart.X and ultimately the packages linked in packages/. Any problems with symbols not being available (as opposed to "package not found" type problems) are problems at the Meteor package level.

The best documentation of packages themselves is probably: http://docs.meteor.com/#writingpackages

tony-kerz commented 10 years ago

sorry tom,

i mis-read your suggested solution (1) from above.

for some reason i thought you were saying "add smart-pack-B to smart.json of smart-pack-A" (which i had already done, but was not sufficient without the api.imply).

having confused you and re-read your suggestion (1) i understand what you are saying, but would generally prefer to keep smart-pack-A's transitive dependencies unbeknownst to its consumers.

what i was trying to say was that i had to both:

  1. add smart-pack-B to smart.json of smart-pack-A, and
  2. add api.imply('smart-pack-B', 'client') to package.js of smart-pack-A

to get some love.

does that sound correct that both of those steps are required for this use case, or should i be able to get away with solely the api.imply...?

regards, tony.

tmeasday commented 10 years ago

Oh, great, yes, that makes sense.

So your step 1. is required so Meteor even knows the package smart-pack-B exists (when it knows smart-pack-A exists).

And your step 2. is required so Meteor knows you want to use (and have symbols available from) smart-pack-B wherever smart-pack-A is used.

Anyway, I think all is well now. Sorry if I wasn't entirely clear.