Skip to content

Commit

Permalink
Remove bower
Browse files Browse the repository at this point in the history
removes any remaining bower references
(except changelog, comments in eslintrc.json and cleanup which should be removed in a month or so)
  • Loading branch information
himdel committed Oct 8, 2018
1 parent 5ed9e2f commit 3f6f08e
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 67 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
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 3f6f08e

Please sign in to comment.