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

Package: improving NPM and Bower published files #523

Merged
merged 1 commit into from
Feb 11, 2014

Conversation

leobalter
Copy link
Member

@JamesMGreene
Copy link
Member

Huh, I've never seen the files property before... that's extremely useful!

@leobalter
Copy link
Member Author

I wonder why is not yet implemented on Bower, or if it is, it's not documented.

@JamesMGreene
Copy link
Member

Speaking of which, what's the rationale behind adding the license file to the Bower main? Does that actually change anything when installing the package?

@leobalter
Copy link
Member Author

I think it is needed to include the file regarding the license text

@JamesMGreene
Copy link
Member

Right but I'm confused as to why we need to include it in the main listing...?

Doesn't Bower just include all files in a repo by default, minus any exclusions? My understanding was that main was just informational for users to see what the "main entry points" to a Bower component were.

@leobalter
Copy link
Member Author

Humm, that's why I haven't found any example or documentation about the possibility to negate files in the ignore list, but I did a new research after your question and found an unusual documentation that lead me to the following phrase: "The ignore rules follow the same rules specified in the gitignore pattern spec."

So I can remove license file from main.

I'll also apply the license link to a new option on the bower.json, according to the documentation

@leobalter
Copy link
Member Author

@JamesMGreene bower.json is already modified and I also noticed in the documentation the license entry doesn't accept an array of hashes like package.json.

@JamesMGreene
Copy link
Member

Oh, so you're saying that the files included in Bower's main essentially does work similarly to NPM's files property?

Bower: main provides inclusions that cannot be excluded with ignores.
NPM: files provides inclusions, excludes everything else; inclusions CAN be excluded with an ".npmignore" file.

Is that right? I didn't realize that Bower's main actually provided any such functionality.

Sorry if this is getting confusing/frustrating for you as well. Both of these package managers need some serious documentation improvements, IMHO.

@leobalter
Copy link
Member Author

It's really confusing and frustrating. :)

It looks like having a files on NPM would exclude the necessity to fill a .npmignore file/prop, except on complex cases not present on QUnit.

Before this patch, I experimented the files attribute on other repo to check it that worked. You can just try the npm install dexter (don't mind the tool, just the files). I'm not using a ignore file/prop to npm at that project.

@JamesMGreene
Copy link
Member

I think NPM is the less confusing of the two, honestly. 😛

So was I correct about my earlier assertion?

Bower: main provides inclusions that cannot be excluded with ignores.

 
Because before this PR, I just thought that main was strictly informational.

@scottgonzalez
Copy link
Contributor

@danheberden

@JamesMGreene
Copy link
Member

From the Bower spec:

main [string|array of strings]
The primary acting files necessary to use your package. While Bower does not directly use these files, they are listed with the commands bower list --json and bower list --paths, so they can be used by build tools. Do not include minified files. Files should not be versioned (Bad: package.1.1.0.js; Good: package.js).

Related issues/discussion:

@JamesMGreene
Copy link
Member

Looks like this is the new issue for main discussion, though:

@leobalter
Copy link
Member Author

I can assure you atm I am just seeing this working like magic - when I don't know how and why it works.

The main and ignore props were already there before this patch and it looks like we have to be afraid of a bower update that wouldn't include main files or those could be surpassed by the **/.* rule in the ignore list.

OMG, I've got FUD.

I don't see anything reliable we can do about it without they clarify the doubts on bower specification, like the mentioned issues. If there's something, please tell me. I am sparing like all my free time with QUnit and it's being cool so far.

@JamesMGreene
Copy link
Member

Hopefully @danheberden can set us straight. 😉

@JamesMGreene
Copy link
Member

Just talked to @danheberden. He confirmed that the main property currently is only informational to Bower.

This PR should be fine to merge now.

- Package.json using files prop: https://npmjs.org/doc/json.html#files
- Added license file and link to bower
@leobalter
Copy link
Member Author

rebased with the master branch

@jzaefferer jzaefferer merged commit d3a6c7f into qunitjs:master Feb 11, 2014
@jzaefferer
Copy link
Member

Thanks!

@leobalter leobalter deleted the pkg-files branch July 30, 2014 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants