Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bower.json #175

Closed
necolas opened this issue Jun 18, 2013 · 21 comments
Closed

Add bower.json #175

necolas opened this issue Jun 18, 2013 · 21 comments

Comments

@necolas
Copy link

necolas commented Jun 18, 2013

Please provide first-class support for use with Bower by including a bower.json file to specify the dependency.

@necolas
Copy link
Author

necolas commented Jun 18, 2013

Actually, since you have a browser build, the Bower error issue is more to do with Bower choking on component.json because it's not clever enough to realise it isn't for Bower. However, explicit Bower support would still be nice, in particular once we allow you to publish a built asset (just the chai.js file).

@mysterycommand
Copy link

+1

@logicalparadox
Copy link
Member

Looking through the bower docs I did not see anything about specifying a pre-built asset. Is this coming in the near future? It would be my preference as I can't guarantee that all dependencies will be bower-registry compatible but I can guarantee they will be in the pre-built chai.js file.

@landau
Copy link

landau commented Jun 19, 2013

I'm seeing this issue when trying to install from bower

bower cloning git://github.com/chaijs/chai.git
bower caching git://github.com/chaijs/chai.git
bower fetching chai
bower checking out chai#1.7.0
bower warn Package chai is still using the deprecated "component.json" file
bower copying /Users/204838/.bower/cache/chai/7333909bbdb6ee7aaa74fd94a5175994
bower error chaijs/assertion-error not found

There were errors, here's a summary of them:
- chaijs/assertion-error not found

@necolas
Copy link
Author

necolas commented Jun 19, 2013

Is this coming in the near future?

Not in the near future, but eventually.

The browser-build of chai.js doesn't has any additional dependencies, right? If not, adding a bower.json should at least fix the above error because Bower (pre a 1.0.0 release) will stop trying to parse the component.json.

But yes, being able to publish a single pre-built asset to the Bower registry is the ideal and it's on the roadmap :)

@logicalparadox
Copy link
Member

Correct, the browser-build of chai.js has everything it needs. So adding a bower.json file with the "main" set to chai.js will solve this issue then?

@necolas
Copy link
Author

necolas commented Jun 19, 2013

Yep, should do. Bower only falls back to component.json (the previous config) if it doesn't find a bower.json.

@Gijsjan
Copy link

Gijsjan commented Jun 20, 2013

Having the same 'assertion-error not found' with bower. This is a newly introduced bug? Because a few days ago this used to work like a charm!

@necolas
Copy link
Author

necolas commented Jun 20, 2013

Yes. Chai 1.7.0 was recently released and added a dependency to the component.json (intended for Component(1)). The dependencies format used by Component(1) and Bower are not compatible, so Bower errors parsing it.

logicalparadox added a commit that referenced this issue Jun 24, 2013
* feature/bower:
  bower: add json file
@logicalparadox
Copy link
Member

This should be resolved with chai@1.7.1. Please let me know if there are further issues.

@chikamichi
Copy link

@logicalparadox thank you!

@mysterycommand
Copy link

@logicalparadox just tried bower install chai#1.7.1 --save-dev. Terminal outputs like:

bower cloning git://github.com/chaijs/chai.git
bower cached git://github.com/chaijs/chai.git
bower fetching chai
bower checking out chai#1.7.1
bower copying /Users/fubar/.bower/cache/chai/7333909bbdb6ee7aaa74fd94a5175994
bower installing chai#1.7.1

… but app/bower_components/chai is an empty directory? Running bower list shows:

bower discover Please wait while newer package versions are being discovered
mysterycommand-github-io
├── chai#
├── jquery#2.0.2
├── mocha#1.11.0
├── modernizr#2.6.2
├── normalize-css#2.1.2
└── requirejs#2.1.6

… not sure what's going on here. Maybe one of those ignore globs is too greedy? Is it something I did?

@gregsymons
Copy link

@mysterycommand I see the same thing... empty directory for chai in components.

@logicalparadox
Copy link
Member

Can you test from branch https://github.com/chaijs/chai/tree/feature/bower. I don't want to do another release until we are sure it works. Thanks!

@necolas
Copy link
Author

necolas commented Jun 25, 2013

You used a glob that ignored all files :)
I'm just finding out if negation matching is supported yet, so you can do: [ '**/*', '!chai.js' ]

@logicalparadox
Copy link
Member

Yeah, that was my bad. If negation isn't support I made it per directory: 77f3ab5

@chandlerroth
Copy link

I believe this is related: I just ran bower install chai and I got an empty chai directory. I looked into the cached directory that bower made for chai, and it had all the components in it correctly. Not sure what's going on...but it looks like the cached folder isn't copying over correctly.

@necolas
Copy link
Author

necolas commented Jun 26, 2013

Yeah, that was my bad. If negation isn't support I made it per directory: 77f3ab5

Cool. I'd go with that for now. Couldn't find out from @satazor (the lead dev) if the negation support was fixed.

Thanks for doing this!

@logicalparadox
Copy link
Member

Can you test and confirm that it works before I push another release?

@necolas
Copy link
Author

necolas commented Jun 26, 2013

Yep, worked for me.

@necolas necolas closed this as completed Jun 26, 2013
@necolas necolas reopened this Jun 26, 2013
@logicalparadox
Copy link
Member

In release 1.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants