Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Ville Immonen Sam Simmons Timmy Willison Joshua Peek
Ville Immonen

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.

Ville Immonen 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
Sam Simmons

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

Timmy Willison
Collaborator

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

Joshua Peek

@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

Timmy Willison
Collaborator

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.

Timmy Willison timmywil closed this in 027d470
Timmy Willison timmywil referenced this pull request from a commit
Timmy Willison timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338

Conflicts:
	bower.json
833d7a6
Timmy Willison
Collaborator

Tags 1.11.0 and 2.1.0 should now be fixed.

Joshua Peek

Thank you!

Joshua Peek

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.

Timmy Willison
Collaborator

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

Timmy Willison timmywil referenced this pull request from a commit
Timmy Willison timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
a359961
Timmy Willison timmywil referenced this pull request from a commit
Timmy Willison timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
f361f03
Timmy Willison
Collaborator

Done.

Joshua Peek

Working great. Thanks again @timmywil

Timmy Willison
Collaborator

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

David Schroh dschroh referenced this pull request from a commit in dschroh/jquery
Timmy Willison timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
4533783
David Schroh dschroh referenced this pull request from a commit in dschroh/jquery
Timmy Willison timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
9434e03
Paul Bonser pib referenced this pull request from a commit in pib/jquery
Timmy Willison timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
741bb6a
Paul Bonser pib referenced this pull request from a commit in pib/jquery
Timmy Willison timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
91cd158
Mescoda mescoda referenced this pull request from a commit in mescoda/jquery
Timmy Willison 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 referenced this pull request from a commit in mescoda/jquery
Timmy Willison timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
c883b8f
Frederic Hemberger fhemberger referenced this pull request from a commit in fhemberger/jquery
Timmy Willison timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
159f51a
Frederic Hemberger fhemberger referenced this pull request from a commit in fhemberger/jquery
Timmy Willison timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
0341645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 17, 2014
  1. Ville Immonen

    Add recommended 'main' field to bower.json to help build tools find t…

    fson authored
    …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.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 bower.json
4 bower.json
View
@@ -1,6 +1,7 @@
{
"name": "jquery",
"version": "2.1.1pre",
+ "main": "dist/jquery.js",
"ignore": [
"**/.*",
"build",
@@ -9,8 +10,7 @@
"*.md",
"AUTHORS.txt",
"Gruntfile.js",
- "package.json",
- "bower.json"
+ "package.json"
],
"dependencies": {
"sizzle": "1.10.18"
Something went wrong with that request. Please try again.