ecwyne / meteor-polymer

Meteor smart package for Google's opinionated web component framework 'Polymer'
https://atmospherejs.com/ecwyne/polymer
141 stars 17 forks source link

Installing components #11

Closed lukejagodzinski closed 9 years ago

lukejagodzinski commented 10 years ago

I've installed few components using bower install from command line being in public directory. Now when I start meteor project polymer package is trying to download polymer one more time and it shouldn't and it creates public folder inside public folder etc.

In your polymer-elements package you are using this piece of code to download elements:

var dir = path.join(path.relative(process.cwd(), process.env.PWD), 'public/bower_components');
Bower.install(['Polymer/core-elements#0.4.0', 'Polymer/paper-elements'], {save: true}, {directory: dir});

I don't think that users of your package should use this kind of solution to import components. Could you describe the process of importing components?

lukejagodzinski commented 10 years ago

Sorry my mistake. I was starting Meteor from public directory. However it should take it into account that someone can be in another directory and then relative directory will change.

ecwyne commented 10 years ago

Does anyone know how to get the application's root path. process.env.PWD gives the working directory, but as noted above it is possible to launch a meteor application from within subdirectories.

Any ideas?

lukejagodzinski commented 10 years ago

You can use __meteor_bootstrap__.serverDir what gives following result /Users/jagi/workspace/app/web/.meteor/local/build/programs/server and then you can strip it down to .meteor location. Meteor finds root directory by going up in directories tree starting from process.env.PWD.

ecwyne commented 9 years ago

Totally new method with new package.