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

[don't merge] Refactor CSS assets to use Sprockets instead of Webpack #1864

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bd4684b
Move stylesheet assets into Sprockets
Bodacious Sep 6, 2018
5322a29
Add refactored stylesheets
Bodacious Sep 6, 2018
5e0fb12
Move images and videos to app/assets dir
Bodacious Sep 6, 2018
b42470a
Move CSS colour values into variables
Bodacious Sep 6, 2018
ea456fc
Refactor JS assets to use Yarn
Bodacious Sep 7, 2018
ec4dfcc
Remove Yarn Error log from git repo
Bodacious Sep 7, 2018
4976d7b
Add broken Karma tests
Bodacious Sep 7, 2018
bf70104
Add JS tests to travis
Bodacious Sep 7, 2018
880dadd
Add npm install to travis test command
Bodacious Sep 7, 2018
73cb7a6
Fix broken JS tests
Bodacious Sep 10, 2018
b3564f7
Update bundle lockfiles
Bodacious Sep 10, 2018
249bac6
Remove Yarn check from development config file
Bodacious Sep 10, 2018
14de35d
Update assets management for Railsy webpacks setup
Bodacious Sep 10, 2018
36ba718
Fix bug when sorting modifiable sections
Bodacious Sep 10, 2018
27561a5
Add ESLint to webpacker config file
Bodacious Sep 10, 2018
c01d0e5
Update Travis CI for Webpacker support
Bodacious Sep 10, 2018
d347aaa
Fix factory deprecation warnings
Bodacious Sep 10, 2018
68c1ab7
wip: fixing TinyMce CSS issue
Bodacious Sep 10, 2018
2f37ff5
Move TinyMCE styles into public Dir
Bodacious Sep 11, 2018
270cc24
Add NPM installation to travisCI
Bodacious Sep 11, 2018
8659a8b
Add the mini_racer to Bundle
Bodacious Sep 11, 2018
a88a14d
Update Gemfile to remove dupilcate
Bodacious Sep 11, 2018
cf70ae4
Update Pg and MySQL2 gems in Bundle
Bodacious Sep 11, 2018
d51fd87
Revert "Update Pg and MySQL2 gems in Bundle"
Bodacious Sep 11, 2018
151e961
Add Chrome bug fix to TravisCI
Bodacious Sep 11, 2018
e2f53d9
Split up Travis CI config into two steps
Bodacious Sep 11, 2018
e4867e5
Refactor Travis yarn commands
Bodacious Sep 11, 2018
8efacc8
Update chrome config on Karma config
Bodacious Sep 11, 2018
c28ba1f
Add ignore optional to Yarn installation
Bodacious Sep 11, 2018
5a6d8b9
Update bundle install with TravisCI
Bodacious Sep 11, 2018
9c704ee
Updated webpacker version
Bodacious Sep 11, 2018
642aa93
Update node version in TravisCI
Bodacious Sep 11, 2018
c86beab
Update webpacker version
Bodacious Sep 11, 2018
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
18 changes: 18 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": true
},
"useBuiltIns": true
}]
],

"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
["transform-class-properties", { "spec": true }]
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
app/assets/javascripts/locale/**/*.js
app/assets/javascripts/packs/application.js
16 changes: 16 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "airbnb-base",
"env": {
"jasmine": true,
"jquery": true
},
"globals": {
"timeago": true,
"fixture": true,
"spyOnEvent": true
},
"rules": {
"prefer-destructuring": "off",
"no-restricted-globals": "off"
}
}
196 changes: 103 additions & 93 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,93 +1,103 @@

# Ignore rbenv files
.ruby-version

# Ignore bundler config
/.bundle

# Ignore all logfiles, tempfiles, public assets,
/log/*.log
/tmp

# Ignore public subdirectories
public/apidocs/*
public/assets/*
public/fonts/*
public/images/*
public/javascripts/*
public/stylesheets/*
public/system/*
public/videos/*

# Ignore PO/POT backups
*.po.bak
*.pot.bak

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


# Ignore db schema.rb
# db/schema.rb

# Ignore seed DBs
db/data.yml

# Ignore the test DB
db/test.sqlite3
db/test.sqlite3-journal

# Ingore DB dump files
*.sql
*.psql
*.sql.gz
*.psql.gz

# Ignore the SimpleCov output
coverage

# Ignore database configuration and token secrets
config/database.yml
config/secrets.yml
config/branding.yml

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

# Ignore enviroments settings
#config/environments/development.rb
#config/environments/production.rb
#config/environments/test.rb

#config/initializers/contact_us.rb

# ignore IDE files
.idea/*

# Ignore MAC files
.DS_Store

# ignore yard doc files
.yardoc/*

# ignore yard generated documents
/doc/*
!/doc/README_FOR_APP

# ignore auto-generated gettext files when running gettext:find
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

# Ignore rbenv files
.ruby-version

# Ignore bundler config
/.bundle

# Ignore all logfiles, tempfiles, public assets,
/log/*.log
/tmp

# Ignore public subdirectories
public/apidocs/*
public/assets/*
public/fonts/*
public/images/*
public/javascripts/*
public/stylesheets/*
public/system/*
public/videos/*

# Ignore PO/POT backups
*.po.bak
*.pot.bak

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


# Ignore db schema.rb
# db/schema.rb

# Ignore seed DBs
db/data.yml

# Ignore the test DB
db/test.sqlite3
db/test.sqlite3-journal

# Ingore DB dump files
*.sql
*.psql
*.sql.gz
*.psql.gz

# Ignore the SimpleCov output
coverage

# Ignore database configuration and token secrets
config/database.yml
config/secrets.yml
config/branding.yml

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

# Ignore enviroments settings
#config/environments/development.rb
#config/environments/production.rb
#config/environments/test.rb

#config/initializers/contact_us.rb

# ignore IDE files
.idea/*

# Ignore MAC files
.DS_Store

# ignore yard doc files
.yardoc/*

# ignore yard generated documents
/doc/*
!/doc/README_FOR_APP

# ignore auto-generated gettext files when running gettext:find
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
/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity
yarn-error.log
/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity
3 changes: 3 additions & 0 deletions .postcssrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins:
postcss-import: {}
postcss-cssnext: {}
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ addons:
chrome: stable
apt:
packages:
- nodejs
- wkhtmltopdf

matrix:
Expand All @@ -36,12 +35,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 @@ -64,6 +76,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
20 changes: 16 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ 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', '>= 4.0.x'

gem "autoprefixer-rails"

gem 'mini_racer'

# ------------------------------------------------
# EXPORTING
# Provides binaries for WKHTMLTOPDF project in an easily accessible package.
Expand Down Expand Up @@ -123,10 +139,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