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

wierdness with main overrides for bower angular-ui-grid #171

Closed
ericnewton76 opened this issue Jan 3, 2019 · 5 comments
Closed

wierdness with main overrides for bower angular-ui-grid #171

ericnewton76 opened this issue Jan 3, 2019 · 5 comments

Comments

@ericnewton76
Copy link

ericnewton76 commented Jan 3, 2019

gulpfile.js:

var gulp=require('gulp');
var mainBowerFiles = require('main-bower-files');
var gulpDebug = require('gulp-debug')

gulp.task("deploy-bower", function(done) {
  var mbfOptions = {
    debugging: true,
    overrides: {
       "angular-ui-grid": {
         main: [ "./ui-grid.js", "./ui-grid.css", "./ui-grid.min.*", "./ui-grid.auto-resize.*" ]
       }
    }
  }
  return gulp.src(mainBowerFiles(mbfOptions))
    .pipe(gulpDebug())
    .pipe(gulp.dest('dist/assets/vendor'));
});

setup with just this bower.json works, but with a bower.json and package.json it seems to not work

mkdir mbf-issue
npm init
npm install gulp@3 main-bower-files gulp-debug
bower init
bower install --save [email protected]
gulp deploy-bower

look in dist/assets/vendor and you should see ui-grid.auto-resize.js, and like i mentioned this works in isolation but not with a lot of other packages

log in isolation:

[17:37:15] Using gulpfile R:\mbf-issue-test\gulpfile.js
[17:37:15] Starting 'deploy-bower'...
PackageCollection add                     angular-ui-grid   R:\mbf-issue-test\bower_components\angular-ui-grid
Package           overriding dependencies angular-ui-grid   {"angular":">=1.4.0 1.7.x"}
PackageCollection add                     angular           R:\mbf-issue-test\bower_components\angular
Package           overriding main         angular           ./angular.js
Package           overriding dependencies angular           {}
Package           select file             angular           R:\mbf-issue-test\bower_components\angular\angular.js
Package           select file             angular-ui-grid   R:\mbf-issue-test\bower_components\angular-ui-grid\ui-grid.js
Package           select file             angular-ui-grid   R:\mbf-issue-test\bower_components\angular-ui-grid\ui-grid.css
Package           select file             angular-ui-grid   R:\mbf-issue-test\bower_components\angular-ui-grid\ui-grid.min.css
Package           select file             angular-ui-grid   R:\mbf-issue-test\bower_components\angular-ui-grid\ui-grid.min.js
Package           select file             angular-ui-grid   R:\mbf-issue-test\bower_components\angular-ui-grid\ui-grid.auto-resize.js
Package           select file             angular-ui-grid   R:\mbf-issue-test\bower_components\angular-ui-grid\ui-grid.auto-resize.min.js
[17:37:15] gulp-debug: bower_components\angular\angular.js
[17:37:15] gulp-debug: bower_components\angular-ui-grid\ui-grid.js
[17:37:15] gulp-debug: bower_components\angular-ui-grid\ui-grid.css
[17:37:15] gulp-debug: bower_components\angular-ui-grid\ui-grid.min.css
[17:37:15] gulp-debug: bower_components\angular-ui-grid\ui-grid.min.js
[17:37:15] gulp-debug: bower_components\angular-ui-grid\ui-grid.auto-resize.js
[17:37:15] gulp-debug: bower_components\angular-ui-grid\ui-grid.auto-resize.min.js
[17:37:15] gulp-debug: 7 items
[17:37:15] Finished 'deploy-bower' after 169 ms

log in c:\projects\theproject

[17:24:58] Using gulpfile c:\projects\theproject\gulpfile.js
[17:24:58] Starting 'deploy-bower'...
PackageCollection add                     angular-ui-grid   c:\projects\theproject\bower_components\angular-ui-grid
Package           overriding main         angular-ui-grid   ["./ui-grid.css","./ui-grid.js"]
Package           overriding dependencies angular-ui-grid   {"angular":">=1.4.0 1.7.x"}
PackageCollection add                     angular           c:\projects\theproject\bower_components\angular
Package           overriding main         angular           ./angular.js
Package           overriding dependencies angular           {}
Package           select file             angular           c:\projects\theproject\bower_components\angular\angular.js
Package           select file             angular-ui-grid   c:\projects\theproject\bower_components\angular-ui-grid\ui-grid.css
Package           select file             angular-ui-grid   c:\projects\theproject\bower_components\angular-ui-grid\ui-grid.js
[17:24:58] gulp-debug: bower_components\angular\angular.js
[17:24:58] gulp-debug: bower_components\angular-ui-grid\ui-grid.css
[17:24:58] gulp-debug: bower_components\angular-ui-grid\ui-grid.js
[17:24:58] gulp-debug: 3 items
[17:24:58] Finished 'deploy-bower' after 619 ms

notice how select file operation doesnt respond to the overrides: { "main": [ array ] }

And here's whats really odd... none of the other bower packages exhibit this behavior... any overrides work as expected, and the non-overrides work as expected as well... just angular-ui-grid bower package seems problematic.

@ericnewton76
Copy link
Author

I think its related to #166 where theres a logic problem with the selection algorithm

@ericnewton76
Copy link
Author

OF note, it seems like when it goes to override a value, either show the overidden value or show [old value] => [new value].

It seems strange to display overriding main angular-ui-grid [oldvalues from that bower.json not mine]

@ck86
Copy link
Owner

ck86 commented Jan 4, 2019

main-bower-files uses either your bower.json or your package.json as a starting point to collect all your dependencies not both.

@ericnewton76
Copy link
Author

ericnewton76 commented Jan 12, 2019

Which one is first though... and if package json is first, then can I say use bower.json exclusively?

Seems odd for "main-bower-files" to read from package.json

@ck86
Copy link
Owner

ck86 commented Jan 14, 2019

bower.json will be used as default. have a look at https://github.com/ck86/main-bower-files#paths if you want to specify which file should be used.

@ck86 ck86 closed this as completed Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants