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 support. #426

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add bower support. #426

wants to merge 1 commit into from

Conversation

philipwalton
Copy link
Contributor

Today I was surprised to discover that there was no bower package for csslint. I wanted to use csslint on the client in one of my apps, and it would be great to not have to manage it manually.

The only thing you need to add for bower to work is a bower.json file in the project root. This pull request adds that. I've also been pretty liberal with the ignores, because presumably anyone wanting to use this on the client only needs the release/csslint.js file.

The only unresolved issue I see is how to automate the bumping of the version in bower.json for releases. I looked through the Gruntfile to hook into that logic, but it doesn't look like you're currently doing any automated version bumping other than for the CHANGELOG (for instance, the npm package is currently not up-to-date). Anyway, I figured that issue could be solved in a separate pull request, which I'd be happy to help with.

If/when this pull request is merged you can simply run the following command to publish csslint to the bower repo. Note that you'll have to do a release first as bower will look for a specific tag corresponding to a specific version number.

# install bower globally
npm install -g bower

# register csslint
bower register csslint https://github.com/stubbornella/csslint

Let me know if you have any questions or need me to change anything.

@philipwalton
Copy link
Contributor Author

Is there any way I can bug someone to take a look at this? It's a super painless and low risk change, but I'd love to be able to use CSS Lint with Bower.

I could add CSS Lint to the Bower repo myself, but it'd be a pain to have to download all those unnecessary files.

@nschonni
Copy link
Member

nschonni commented Dec 9, 2013

I could add CSS Lint to the Bower repo myself, but it'd be a pain to have to download all those unnecessary files.

You download all those files either why with bower. The excludes just deletes them after the git clone completes.

@nschonni
Copy link
Member

nschonni commented Dec 9, 2013

PS: even from the bower main page suggests that isn't a good use case (emphasis theirs)

Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management

You won't find (m)any linting tools on Bower that have been put their by the authors because it is not the intended use case for Bower.

@philipwalton
Copy link
Contributor Author

You download all those files either why with bower. The excludes just deletes them after the git clone completes.

OK fair enough, I should have reworded. For projects that check-in their bower dependencies, it's a pain to have to check in unnecessary files.

You won't find (m)any linting tools on Bower that have been put their by the authors because it is not the intended use case for Bower.

I don't see how the fact that this is a linting tool is relevant. The more important question is whether it's being used on the front-end or the back-end. If I use CSS Lint from the command line, then yes it doesn't make sense to use bower (npm is all you need), but if I've included it as part of my app (as in, at the route /csslint/:stylesheet) then it makes it quite convenient to be able to update all of my client-side assets with the same tool.

Perhaps I should have been more clear as to why I wanted to use bower, but the point is that I do use CSS Lint on the front-end, so, at least in my case, it fits quite nicely into the intended use of bower.

@nschonni
Copy link
Member

nschonni commented Dec 9, 2013

OK fair enough, I should have reworded. For projects that check-in their bower dependencies, it's a pain to have to check in unnecessary files.

They can check in the one file and not the node wsh and rhino versions that they would with Bower.


The point i was trying to make is that CSSLint is a build/linting tool and you don't have any other linting tools using Bower because they aren't front-end packages. I love Bower for jQuery, Bootstrap, and other front-end products, but I don't think a build tool fits.

@philipwalton
Copy link
Contributor Author

They can check in the one file and not the node wsh and rhino versions that they would with Bower.

But if you have to do that manually, it defeats the point of the package manager.

you don't have any other linting tools using Bower because they aren't front-end packages

That's not true, there are other linting tools on Bower. HTML Inspector is one example.

@nschonni If we disagree I don't want to get into an argument with you about this. But my point is I'm using it as a front-end package in my app, so there's at least one known use-case for it. csslint.net also uses it on the client, so there are at least two use-cases for it. I mean, the mere fact that CSS Lint works in the browser and isn't Node/Rhino only suggests that it's intended to be (sometimes) used as a front-end package.

I'd like to hear some other opinions on this, but I personally don't see what the problem or the big deal is. As a user, promoter, and contributor to CSS Lint, I'd think my use case should count for something. If the maintainers of this project aren't interested in adding bower support, I'll understand, and I'll just add it myself and deal with the extra weight.

/cc @stubbornella @nzakas

@Chris2011
Copy link

I need to install csslint via bower too, incase of using codemirror, so I did a bower install https://github.com/CSSLint/csslint.git but inside the package.json, the main maps to ./dist/csslint-node,js but I need it for the browser/client. So please create a bower package for this.

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

Successfully merging this pull request may close these issues.

4 participants