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

Problem installing 'main' files with bower #11296

Closed
ghelton opened this issue Oct 30, 2013 · 18 comments
Closed

Problem installing 'main' files with bower #11296

ghelton opened this issue Oct 30, 2013 · 18 comments
Labels
Milestone

Comments

@ghelton
Copy link

ghelton commented Oct 30, 2013

I'm receiving the following message when using grunt-bower-task or bower-installer to grab the main files from the repository:

no such file or directory 'bower_components/bootstrap/dist/fonts/*'

The folder is there, and the build tools dont seem to recognize the wildcard. Is this a problem for anyone else, or is could it be a problem with my installation? Any info is appreciated.

My Gruntfile looks like so:

module.exports = function(grunt) {

    grunt.initConfig({
        bower: {
            install: {
                options: {
                    targetDir: './bower',
                    layout: 'byType',
                    install: true,
                    verbose: true,
                    cleanTargetDir: true,
                    cleanBowerDir: true
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-bower-task');

    // Default task(s).
    grunt.registerTask('default', ['bower']);

};

The commit that added the wildcard is here:
56f1ff6#diff-0a08a7565aba4405282251491979bb6b

@cvrebert
Copy link
Collaborator

Have escalated to the Bower folks.

@zlatanvasovic
Copy link
Contributor

@cvrebert It looks like Bower doesn't support regexes in main, so you need to use complete file list. :(

@ghost
Copy link

ghost commented Oct 31, 2013

csomag elérhető NuGet . A reaktív Extensions (Rx) rajongók, mi is egy IObservable alapú " Octokit.Reactive "társa csomagot.

juthilo referenced this issue Nov 1, 2013
When using bower the "main" property is used to specify the files that should be consumed by applications including the package as a dependency.
Without including the fonts in this array the glyphicons do not work correctly as the relative font paths do not work after the "main" files are copied into my projects public dir using tools like https://github.com/yatskevich/grunt-bower-task

For now I have manually copied the fonts dir in the location needed for my project. But by accepting this pull request this will not be necessary for me or for other people that use bower.
@thomaswelton
Copy link
Contributor

Urgh. Well my original PR listed out the individual files. But was asked to resubmit it like this.

@zlatanvasovic
Copy link
Contributor

@thomaswelton Everyone gets many failures, this is one of them. Will you resubmit your origin pull request, or wait the Bower folks for fix? :)

@cvrebert
Copy link
Collaborator

cvrebert commented Nov 1, 2013

@zdroid @thomaswelton We'll fix it ourselves once we hear back from the Bower folks.

@thomaswelton
Copy link
Contributor

I feel pretty bad. Like I totally broke the bower install of bootstrap by trying to make it better.
I hear by tender my resignation for submitting open source contributions.

On 1 Nov 2013, at 21:23, Chris Rebert notifications@github.com wrote:

@zdroid @thomaswelton We'll fix it ourselves once we hear back from the Bower folks.


Reply to this email directly or view it on GitHub.

@zlatanvasovic
Copy link
Contributor

@thomaswelton Wait, why? I made million bad pull requests and commits, don't worry about this fail! :)

@thomaswelton
Copy link
Contributor

Was joking :)
@BrenoC did this previously work for you? Have you had wildcards in bower work. Could this be that wildcards were only supported since a certain bower version?

#9964

@zlatanvasovic
Copy link
Contributor

@thomaswelton :P

@klzns
Copy link
Contributor

klzns commented Nov 1, 2013

@thomaswelton sorry, I thought this would work, but it doesn't, my bad!

@cvrebert
Copy link
Collaborator

Okay, the Bower folks say that main should just be a single JS file.

@zlatanvasovic
Copy link
Contributor

@cvrebert So, do it.

@thomaswelton
Copy link
Contributor

Bower is nice, put it's also kinda awful...
It downloads an entire repo and expects you to deal with it. To overcome this there are several tools and grunt plugins that use the main files and copies those into another location.
For example I have my bower_components in the root but ignored, and the main files copied into the public/assets dir. This works very well for me and many other people with a similar setup.

My original PR listed out the font files as individual declarations, which would have worked for the above setup.
So the main files should ideally contain all the files that your project needs. Which for this case includes the font and CSS files.

http://bower.io/#defining-a-package states that main [string|array]: The primary endpoints of your package. For and app that depends on CSS files I'd say the CSS and fonts should be included along with the JS file.

I thought the reason you were talking to the bower folks was to find out if the wildcard should have been supported. Not wether the CSS and font files should be removed. The css has been specified in that file since v2.2.0 https://github.com/twbs/bootstrap/blob/v2.2.0/component.json

@westonplatter
Copy link
Contributor

Can we fix the issue via #11599?

@cvrebert
Copy link
Collaborator

Looks like the Bower folk are in reality still sorting out their spec/implementation.

@cvrebert
Copy link
Collaborator

Merged #11599, which fixes the issue until such time as Bower ratifies a new spec and then implements it.

@westonplatter
Copy link
Contributor

@cvrebert thanks!

@ghelton
Copy link
Author

ghelton commented Dec 8, 2013

Thanks for all the help guys, it's working great!

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

No branches or pull requests

6 participants