Add recommended `main` field to bower.json to help build tools find the source. #1516

Closed
wants to merge 1 commit into from

4 participants

@fson

This makes it possible for build tools such as Webpack to resolve the package using bower.json.

bower.json specification recommends adding this field.

Also removed bower.json from the ignore list in bower.json,
to prevent it from being removed when the package is installed,
so it can be used for this purpose.

@fson fson Add recommended 'main' field to bower.json to help build tools find t…
…he source.

This makes it possible for build tools such as
[Webpack](https://github.com/webpack/webpack)
to [resolve the package using bower.json.](webpack/webpack#143 (comment))

[bower.json specification](https://github.com/bower/bower.json-spec#main) recommends adding this field.

Also removed bower.json from the ignore list in bower.json,
to prevent it from being removed when the package is installed,
so it can be used for this purpose.
4c01bda
@samiconductor

+1 grunt-bower-install needs this as well. Thanks for the PR @fson!

@timmywil
jQuery Foundation member

I think it might be better to only add this property in tagged commits where the distributed files are present.

@josh

@timmywil I think thats fine, but it looks like some tags are missing the directive.

See 2.1.0. https://github.com/jquery/jquery/blob/2.1.0/bower.json

Just for reference, the jquery bower package was pointing to https://github.com/components/jquery. This is how the previous json file was configured: https://github.com/components/jquery/blob/master/bower.json

@timmywil
jQuery Foundation member

You're right, they are currently missing the main property, but I'd like to see the addition in the release script. I'm working on this.

@timmywil timmywil added a commit that closed this pull request Feb 19, 2014
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
027d470
@timmywil timmywil closed this in 027d470 Feb 19, 2014
@timmywil timmywil added a commit that referenced this pull request Feb 19, 2014
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338

Conflicts:
	bower.json
833d7a6
@timmywil
jQuery Foundation member

Tags 1.11.0 and 2.1.0 should now be fixed.

@josh

Thank you!

@josh

O, no, another problem. I don't think you wanted to ignore bower.json from itself.

https://github.com/jquery/jquery/blob/master/bower.json#L15

When you bower install the package, the bower.json is never written out for tools to even read the main property from.

@timmywil
jQuery Foundation member

You're right! I meant to do that. One second.

@timmywil timmywil added a commit that referenced this pull request Feb 19, 2014
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
a359961
@timmywil timmywil added a commit that referenced this pull request Feb 19, 2014
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
f361f03
@timmywil
jQuery Foundation member

Done.

@josh

Working great. Thanks again @timmywil

@timmywil
jQuery Foundation member

Glad it's working. Thanks for confirming for me.

@dschroh dschroh pushed a commit to dschroh/jquery that referenced this pull request Feb 26, 2014
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
4533783
@dschroh dschroh pushed a commit to dschroh/jquery that referenced this pull request Feb 26, 2014
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
9434e03
@pib pib pushed a commit to pib/jquery that referenced this pull request Apr 29, 2014
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
741bb6a
@pib pib pushed a commit to pib/jquery that referenced this pull request Apr 29, 2014
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
91cd158
@mescoda mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338

Conflicts:
	bower.json
e246753
@mescoda mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
c883b8f
@fhemberger fhemberger added a commit that referenced this pull request Dec 9, 2014
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
159f51a
@fhemberger fhemberger added a commit that referenced this pull request Dec 9, 2014
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
0341645
@bperel bperel pushed a commit that referenced this pull request Jul 21, 2015
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
bac9810
@bperel bperel pushed a commit that referenced this pull request Jul 21, 2015
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
b937d5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment