akanix42 / meteor-css-modules

MIT License
92 stars 20 forks source link

Cannot import from other packages #61

Closed RafaelVidaurre closed 8 years ago

RafaelVidaurre commented 8 years ago

The latest update apparently fixed the compose not working for packages. But I cannot do the following:

@import "{francocatena:compass}/compass";

It apparently can't find the file on import:

[Error: File '/Users/rafaelvidaurre/Code/pathable/pathable-admin/packages/francocatena_compass/compass' not found at any of the following paths: ["/Users/rafaelvidaurre/Code/pathable/pathable-admin/packages/francocatena_compass/compass","/Users/rafaelvidaurre/Code/pathable/pathable-admin/packages/francocatena_compass/compass.scss","/Users/rafaelvidaurre/Code/pathable/pathable-admin/packages/francocatena_compass/_compass","/Users/rafaelvidaurre/Code/pathable/pathable-admin/packages/francocatena_compass/_compass.scss"]]
akanix42 commented 8 years ago

There are 2 issues here:

  1. I wasn't checking to make sure a path was a file instead of directory, so importing {francocatena:compass}/compass attempted to import the compass directory instead of the _compass.scss file. This is now fixed.
  2. francocatena:compass uses fourseven:scss. This means that my plugin cannot access its files unless it is installed locally and named appropriately. The simplest way to do this is to clone the git repo into packages/francocatena_compass. Alternatively you could clone the package and set it to use nathantreid:css-modules@2.1.3 instead of fourseven:scss. Then the folder name would be irrelevant, and it would work if it was published on Atmosphere.

Also, a side note: you're probably aware of this, but the version of compass in use by francocatena:compass is quite outdated. I would have suggested you install a version from npm instead, but I personally haven't tested importing SCSS from npm inside of a meteor package. Some quick searching revealed the package compass-importer but I haven't tried it to see if that would work.

RafaelVidaurre commented 8 years ago

Thanks for thw quick reply, Ill see how it goes and update you here

On Wed, Jul 27, 2016, 12:40 AM Nathan Reid notifications@github.com wrote:

There are 2 issues here:

  1. I wasn't checking to make sure a path was a file instead of directory, so importing {francocatena:compass}/compass attempted to import the compass directory instead of the _compass.scss file. This is now fixed.
  2. francocatena:compass uses fourseven:scss. This means that my plugin cannot access its files unless it is installed locally and named appropriately. The simplest way to do this is to clone the git repo https://github.com/francocatena/meteor-compass into packages/francocatena_compass. Alternatively you could clone the package and set it to use nathantreid:css-modules@2.1.3 instead of fourseven:scss. Then the folder name would be irrelevant, and it would work if it was published on Atmosphere.

Also, a side note: you're probably aware of this, but the version of compass in use by francocatena:compass is quite outdated. I would have suggested you install a version from npm instead, but I personally haven't tested importing SCSS from npm inside of a meteor package. Some quick searching revelead the package compass-importer https://www.npmjs.com/package/compass-importer but I haven't tried it to see if that would work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nathantreid/meteor-css-modules/issues/61#issuecomment-235482246, or mute the thread https://github.com/notifications/unsubscribe-auth/ABuZIsD3OFRdDE_7HIGU6V0DK2d1cdNsks5qZuE0gaJpZM4JVmJy .

RafaelVidaurre commented 8 years ago

@nathantreid This works for me now, thanks. I have another (not-so-urgent) issue that I'm not sure everyone's getting as it is fairly common: #63