Skip to content

Commit

Permalink
Merge pull request #4735 from himdel/npm-bower
Browse files Browse the repository at this point in the history
Remove bower
  • Loading branch information
mzazrivec authored Oct 8, 2018
2 parents 15915b2 + e333a0b commit 043448b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 75 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ app/assets/javascripts/locale/**/*.js

# not ours or already processed or not javascript
node_modules/
vendor/assets/bower_components/
public/
tmp/
db/
Expand Down
16 changes: 8 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
"vanillaJsAPI": false, // local: http_api/api.js - deprecated
"API": false, // local: http_api/api.js
"ManageIQ": false, // local: mig_global.js
"Promise": false, // bower: es6-shim
"_": false, // bower: lodash
"Promise": false, // modern browser / npm: es6-shim
"_": false, // npm: lodash
"__": false, // local: i18n.js
"angular": false, // bower: angular
"c3": false, // bower: c3
"d3": false, // bower: d3
"angular": false, // npm: angular
"c3": false, // npm: c3
"d3": false, // npm: d3
"http": false, // local: http_api/http.js
"i18n": false, // gem: gettext_i18n_rails_js
"moment": false, // bower: moment
"numeral": false, // bower: numeral
"sprintf": false // bower: sprintf
"moment": false, // npm: moment
"numeral": false, // npm: numeral
"sprintf": false // npm: sprintf-js
},

"rules": {
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ tmp/
.idea/
.vscode/
.ruby-version
vendor/assets/bower_components/
vendor/assets/bower/bower_components/
node_modules/
config/webpack/paths.json
*.sw[po]
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ sudo: false
cache:
bundler: true
yarn: true
directories:
- vendor/assets/bower/bower_components
addons:
postgresql: '9.4'
env:
Expand All @@ -28,8 +26,6 @@ bundler_args: "--no-deployment"
before_install: source tools/ci/before_install.sh
before_script: bundle exec rake $TEST_SUITE:setup
script: bundle exec rake $TEST_SUITE
before_cache:
- cp bower.json vendor/assets/bower/bower_components
after_script: source tools/ci/after_install.sh
notifications:
webhooks:
Expand Down
22 changes: 0 additions & 22 deletions bower.json

This file was deleted.

1 change: 0 additions & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Rails.application.config.assets.paths << ManageIQ::UI::Classic::Engine.root.join('vendor', 'assets', 'bower') # all bower deps need to be prefixed by bower_components/, but vendor/assets/* can't be removed from paths :(
Rails.application.config.assets.paths << ManageIQ::UI::Classic::Engine.root.join('node_modules')

Rails.application.config.assets.precompile << proc do |filename, path|
Expand Down
12 changes: 4 additions & 8 deletions lib/tasks/manageiq/ui_tasks.rake
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
namespace :update do
task :bower do
Dir.chdir ManageIQ::UI::Classic::Engine.root do
system("bower update --allow-root -F --config.analytics=false") || abort("\n== bower install failed ==")
end
end

task :yarn do
asset_engines.each do |engine|
Dir.chdir engine.path do
Expand All @@ -15,8 +9,10 @@ namespace :update do
end

task :clean do
# clean up old bower install to prevent it from winning over npm
# clean up old bower packages
# FIXME: remove 2018-11 or so, hammer/no
FileUtils.rm_rf(ManageIQ::UI::Classic::Engine.root.join('vendor', 'assets', 'bower_components'))
FileUtils.rm_rf(ManageIQ::UI::Classic::Engine.root.join('vendor', 'assets', 'bower'))

# clean up old webpack packs to prevent stale packs now that we're hashing the filenames
FileUtils.rm_rf(Rails.root.join('public', 'packs'))
Expand All @@ -33,7 +29,7 @@ namespace :update do
puts
end

task :actual_ui => ['update:clean', 'update:bower', 'update:yarn', 'webpack:compile', 'update:print_engines']
task :actual_ui => ['update:clean', 'update:yarn', 'webpack:compile', 'update:print_engines']

task :ui do
# when running update:ui from ui-classic, asset_engines won't see the other engines
Expand Down
25 changes: 0 additions & 25 deletions tools/ci/setup_js_env.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
which bower || npm install -g bower

# Clean up old bower_components location
if [ -d vendor/assets/bower_components ]; then
rm -rf vendor/assets/bower_components
fi

# Check if the bower cache is valid, otherwise delete it
if ! cmp --silent bower.json vendor/assets/bower/bower_components/bower.json; then
rm -rf vendor/assets/bower/bower_components
fi

if [ -d vendor/assets/bower/bower_components ]; then
# Using bower_components from cache
echo "bower assets installed... moving on."
else
bower install --allow-root -F --config.analytics=false
STATUS=$?
echo bower exit code: $STATUS

# fail the whole test suite if bower install failed
[ $STATUS = 0 ] || exit 1
#[ -d vendor/assets/bower/bower_components ] || exit 1
fi

# make sure yarn is installed, in the right version
bundle exec rake webpacker:check_yarn || npm install -g yarn

Expand Down

0 comments on commit 043448b

Please sign in to comment.