Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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

@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
Collaborator

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
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.

@timmywil timmywil closed this in 027d470
@timmywil timmywil referenced this pull request from a commit
@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
Collaborator

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
Collaborator

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

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

Done.

@josh

Working great. Thanks again @timmywil

@timmywil
Collaborator

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

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

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

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

Fixes #14798
Close gh-1516
Ref gh-1338
159f51a
@fhemberger fhemberger referenced this pull request from a commit
@timmywil timmywil Bower: stop ignoring yourself, bower
Ref #14798
Ref gh-1516
Ref gh-1338
0341645
@bperel bperel referenced this pull request from a commit
@timmywil timmywil Bower: add main property, move Sizzle to devDependencies, add license…
… property

Fixes #14798
Close gh-1516
Ref gh-1338
bac9810
@bperel bperel referenced this pull request from a commit
@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
Commits on Feb 17, 2014
  1. @fson

    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
View
4 bower.json
@@ -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.