joliss / broccoli-bower

Load Bower packages into Broccoli
MIT License
10 stars 6 forks source link

Package names with a period (.) in causes errors #6

Open kennethkalmer opened 10 years ago

kennethkalmer commented 10 years ago

Two different bower packages, orbit.js & Snap.js, can't be used with ember-cli & broccoli-bower at present.

The backtrace for Snap.js looks like this:

EISDIR, illegal operation on a directory Error: EISDIR, illegal operation on a directory
    at Object.fs.readSync (fs.js:476:19)
    at Object.fs.readSync (/Users/kenneth/Code/FOSS/ember-cli/node_modules/configstore/node_modules/graceful-fs/polyfills.js:218:23)
    at Object.fs.readSync (/Users/kenneth/Code/FOSS/ember-cli/node_modules/bower-config/node_modules/graceful-fs/polyfills.js:218:23)
    at Object.fs.readFileSync (fs.js:310:28)
    at addLegacyFile (/Users/kenneth/Code/FOSS/ember-cli/node_modules/broccoli-es6-concatenator/index.js:133:31)
    at /Users/kenneth/Code/FOSS/ember-cli/node_modules/broccoli-es6-concatenator/index.js:63:9
    at invokeCallback (/Users/kenneth/Code/FOSS/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/promise.js:228:21)
    at publish (/Users/kenneth/Code/FOSS/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/promise.js:176:9)
    at publishFulfillment (/Users/kenneth/Code/FOSS/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/promise.js:312:5)
    at flush (/Users/kenneth/Code/FOSS/ember-cli/node_modules/rsvp/dist/commonjs/rsvp/asap.js:41:9)
    at process._tickDomainCallback (node.js:459:13)

This is after I forked it, renamed the repo, and fixed up the bower.json file. Similar issue with orbit.js, but that was on an experiment project and I don't have the backtrace on hand.

In the case of Snap.js, we have a mixed casing issue too, the bower package name is Snap.js, and the main file is snap.js.

kennethkalmer commented 10 years ago

It might just be worth noting for users with the same issue that you can tell bower to use a different local name by providing an endpoint that looks like this <name>=<source>#<target>, where name is the name the package will have locally.