jpillora / xdomain

A pure JavaScript CORS alternative
https://jpillora.com/xdomain/
3.12k stars 270 forks source link

fixed bower not downloading js files #83

Closed ryan-schroeder closed 10 years ago

ryan-schroeder commented 10 years ago

before, the "*" ignore in bower.json was too strong: despite the "un-ignore" !dist/0.6/xdomain.js and xdomain.min.js, the parent directory had been ignored, so the un-ignores did not work (see gitignore documentation)

ryan-schroeder commented 10 years ago

see this SO question: http://stackoverflow.com/a/23943737/1278921

jpillora commented 10 years ago

I dont use bower, though recieved another PR earlier which made the bower.json the way it is. Thanks for the SO link. Interesting. Can you first test with the * below the !s - maybe that might do it?

ryan-schroeder commented 10 years ago

Hmmm.. Making the * into a /* may fix the problem. Placing the * below the ! s probably won't work:

"An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. "

I'll try /* thought: to avoid needing to list all the individual files, yeah.

jpillora commented 10 years ago

Exactly, I'm hoping for a way only to include the JS files. Seems strange why there's only an ignore...

I'm actually generating all my bower.jsons with https://github.com/jpillora/grunt-source-jslib/blob/master/tasks/bower.coffee (http://js2coffee.org/)

http://stackoverflow.com/a/1279718/977939 says you can "ignore all except..."

ryan-schroeder commented 10 years ago

Sure - yup. Except that .c doesn't exclude the entire folder: * does. And if the parent directory is ignored, you can't un-ignore the inner files, I think. Something like:
"
.", "!xdomain.js"
would probably work, but I gotta roll on some other projects - sorry =) Thanks for chatting about it, if I get some time to putts with it in the next week or so I'll come back with what I find out. Cheers!

jpillora commented 10 years ago
$ bower install xdomain
bower xdomain#*             not-cached git://github.com/jpillora/xdomain.git#*
bower xdomain#*                resolve git://github.com/jpillora/xdomain.git#*
bower xdomain#*               download https://github.com/jpillora/xdomain/archive/0.6.12.tar.gz
bower xdomain#*                extract archive.tar.gz
bower xdomain#*               resolved git://github.com/jpillora/xdomain.git#0.6.12
bower xdomain#~0.6.12          install xdomain#0.6.12

xdomain#0.6.12 bower_components/xdomain
.
└── bower_components
    └── xdomain
        ├── bower.json
        └── dist
            └── 0.6
                ├── xdomain.js
                └── xdomain.min.js

I don't use bower though this is expected behaviour.

Reopen if needed