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

Update asset structure with webpacker gem #1962

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 15 additions & 8 deletions .gitignore
@@ -1,4 +1,3 @@

# Ignore rbenv files
.ruby-version

Expand All @@ -25,7 +24,6 @@ public/videos/*

# Ignore branded content
app/views/branded/*
app/assets
config/locales/static_pages/*.yml


Expand Down Expand Up @@ -55,7 +53,7 @@ config/branding.yml

# Ignore some of the initializers
config/initializers/recaptcha.rb
config/initializers/devise.rb
# config/initializers/devise.rb
config/initializers/wicked_pdf.rb
config/initializers/fingerprint.rb

Expand Down Expand Up @@ -84,14 +82,23 @@ config/locale/*/app.edit.po
config/locale/*/app.po.time_stamp

# Front-end related
lib/assets/node_modules
lib/assets/npm-debug.log
lib/assets/.eslintcache
!.keep
.byebug_history
lib/data_cleanup/rules/org/fix_blank_abbreviation.yml
.rspec
node_modules

yarn-error.log
yarn-debug.log*

.yarn-integrity
.env
public/packs
package-lock.json
node_modules
/public/packs
/public/packs-test

spec/examples.txt
.babelrc
.eslintignore
.eslintrc.json
.postcssrc.yml
20 changes: 18 additions & 2 deletions .travis.yml
Expand Up @@ -18,7 +18,6 @@ addons:
chrome: stable
apt:
packages:
- nodejs
- wkhtmltopdf

# artifacts:
Expand All @@ -42,12 +41,25 @@ env:
- DB_ADAPTER=postgresql
- DB_ADAPTER=mysql2

before_install:
- nvm install 10.10.0

install:
- bundle install --with development,ci --path=${BUNDLE_PATH:-vendor/bundle}
- yarn install --ignore-optional

# This is a temporary bug fix for Karma tests
# See here: https://github.com/travis-ci/travis-ci/issues/9024
before_script:
- "sudo chown root /opt/google/chrome/chrome-sandbox"
- "sudo chmod 4755 /opt/google/chrome/chrome-sandbox"

# Main test script
script:
- export WICKED_PDF_PATH=./vendor/bundle/ruby/2.4.0/bin/wkhtmltopdf
# Copy over config files needed for setup, and create DB
- bin/setup
# Precompile the assets
- bundle exec rake webpacker:compile
- bundle exec rake assets:precompile
# Default test stage: Run all specs, listing the 10 slowest.
- bundle exec rspec spec --profile=10
Expand All @@ -70,6 +82,10 @@ jobs:
name: "Bundle audit"
script: bundle exec bundle-audit check --update

- stage: test
name: "Karma JS tests"
script: yarn run eslint --ext .js --ext .jsx app/assets/javascripts/**/*.js

- stage: hygiene
name: "Check seeds are valid"
script: bin/setup && bundle exec rake db:seed
26 changes: 22 additions & 4 deletions Gemfile
Expand Up @@ -7,6 +7,8 @@ ruby '>= 2.4.0'
# Full-stack web application framework. (http://www.rubyonrails.org)
gem 'rails', '~> 4.2.10'

gem "rake"

# Tools for creating, working with, and running Rails applications. (http://www.rubyonrails.org)
gem 'railties'

Expand Down Expand Up @@ -92,11 +94,29 @@ gem 'recaptcha'
# Ideal gem for handling attachments in Rails, Sinatra and Rack applications. (http://github.com/markevans/dragonfly)
gem 'dragonfly'

gem 'bootstrap-sass', '~> 3.3.7'

# This is required for Font-Awesome, but not used as the main sass compiler

gem "sass-rails", require: false

gem "sassc-rails"

gem 'font-awesome-sass', '~> 4.2.0'

gem 'webpacker', '~> 3.5'

gem "autoprefixer-rails"

gem 'mini_racer'

# ------------------------------------------------
# EXPORTING
# Provides binaries for WKHTMLTOPDF project in an easily accessible package.
gem 'wkhtmltopdf-binary'

gem 'puma'

# PDF generator (from HTML) gem for Ruby on Rails (https://github.com/mileszs/wicked_pdf)
gem 'wicked_pdf'

Expand All @@ -122,6 +142,8 @@ gem 'gettext', require: false, group: :development
# A pagination engine plugin for Rails 4+ and other modern frameworks (https://github.com/kaminari/kaminari)
gem 'kaminari'

gem "rails_12factor"

# ------------------------------------------------
# ENVIRONMENT SPECIFIC DEPENDENCIES
group :development, :test do
Expand All @@ -131,10 +153,6 @@ group :development, :test do
# RSpec for Rails (https://github.com/rspec/rspec-rails)
gem "rspec-rails"

# factory_bot_rails provides integration between factory_bot and rails 3 or newer (http://github.com/thoughtbot/factory_bot_rails)
# rspec-collection_matchers-1.1.3 (https://github.com/rspec/rspec-collection_matchers)
gem "rspec-collection_matchers"

# factory_bot_rails provides integration between factory_bot and rails 3 or newer (http://github.com/thoughtbot/factory_bot_rails)
gem "factory_bot_rails"

Expand Down