zont / gulp-bower

MIT License
82 stars 22 forks source link

gulp-bower filles up the "cwd" folder with bower dependencies #28

Closed karl-gustav closed 9 years ago

karl-gustav commented 9 years ago

gulp-bower filles up the "cwd" folder with bower dependencies (i.e. it doesn't use the "bower_components" folder)

This error exists both in version 0.0.8 and 0.0.9.

Before gulp bower

On branch change_back_to_gulp-bower
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   gulpfile.js
    modified:   package.json

no changes added to commit (use "git add" and/or "git commit -a")

After gulp bower

On branch change_back_to_gulp-bower
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   gulpfile.js
    modified:   package.json

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    source/angular-animate/
    source/angular-aria/
    source/angular-bootstrap/
    source/angular-gettext/
    source/angular-mocks/
    source/angular-route/
    source/angular-sanitize/
    source/angular/
    source/bootstrap-sass-official/
    source/fng-pure-angularjs-event-accordion/
    source/fontawesome/
    source/harmonyArrayPolyfill/
    source/jquery/
    source/moment/
    source/source/

no changes added to commit (use "git add" and/or "git commit -a")

Our gulp bower config:

gulp.task('bower', function () {
    return $.bower({
        cwd: 'source/'
    }).pipe(gulp.dest('source/'));
});
karl-gustav commented 9 years ago

1a816a129e5b1e28909731c32ce3c0af92dbb65d didn't fix the issue:-S My source/ dir is still full of bower dependencies...

i.e. I tested with 0.0.10 and the issue was still there. I even checked the node_modules/gulp-bower/index.js file to make sure that the changes from 1a816a129e5b1e28909731c32ce3c0af92dbb65d was there.

zont commented 9 years ago
gulp.task('bower', function () {
    return $.bower({
        cwd: 'source/'
    }).pipe(gulp.dest('source/'));
});

1) bower work directory is 'source/' 2) bower path name in which installed components is 'bower_components'. Full path is 'source/bower_components' 3) bower load all dependencies in 'source/bower_components' 4) after all loaded gulp-bower create stream and send all loaded data from 'source/bower_components' to it 5) you pipe stream and out all data to 'source/'

It is not a bug.

karl-gustav commented 9 years ago

It might not be a bug but at the very least it's a change in behavior. Because the setup we have in gulp was the way you had to write it in gulp-bower < 0.0.8

karl-gustav commented 9 years ago

Or to be more specific the .pipe(gulp.dest('source/')) had no effect in gulp-bower < 0.0.8

zont commented 9 years ago

You cannot correct check this behavior on old versions because they has incorrect dependency of latest 'walk'

karl-gustav commented 9 years ago

That's easy to test, just use gulp-bower2 since that is how your codebase looked before 0.0.8, with the only difference being a fixed working version of walk...

But it doesn't matter, I have removed .pipe(gulp.dest('source/')) from our gulpfile.js and now everything works:-)