Skip to content

Commit

Permalink
Merge pull request #354 from unepwcmc/fix/js-compilation
Browse files Browse the repository at this point in the history
Fix/js compilation
  • Loading branch information
Levia authored Jan 14, 2020
2 parents f8e9fc9 + 5fd645a commit 9ebd1e1
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 43 deletions.
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ source 'https://rubygems.org'
gem 'rails', '5.2.0'
gem 'webpacker', '~> 4.0.2'

gem 'bourbon'
gem "neat"

gem 'pg', '~> 0.21'
gem 'activerecord-postgis-adapter', '5.1.0'
gem 'dbf', '~> 2.0.7'
Expand All @@ -12,7 +15,7 @@ gem 'elasticsearch', '~> 7.2.0'
gem 'sass-rails', '~> 5.0.7'
gem 'sprockets-rails', '~> 3.2.1'

gem 'uglifier', '~> 2.7.2'
gem 'uglifier', '~> 4.1.17'
gem 'coffee-rails', '~> 4.2.2'
gem "autoprefixer-rails"
gem "exception_notification", '~> 4.3.0'
Expand Down
17 changes: 12 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,9 @@ GEM
best_in_place (3.0.3)
actionpack (>= 3.2)
railties (>= 3.2)
bourbon (4.2.3)
sass (~> 3.4)
thor
builder (3.2.4)
byebug (9.1.0)
capistrano (3.11.0)
Expand Down Expand Up @@ -903,7 +906,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.2.0)
json (2.3.0)
kramdown (2.1.0)
levenshtein (0.2.2)
loofah (2.4.0)
Expand All @@ -929,6 +932,9 @@ GEM
multi_xml (0.6.0)
multipart-post (2.0.0)
mustermann (1.0.3)
neat (1.7.4)
bourbon (>= 4.0)
sass (>= 3.3)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-ssh (5.2.0)
Expand Down Expand Up @@ -1079,9 +1085,8 @@ GEM
tilt (>= 1.4, < 3)
tzinfo (1.2.6)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
version (1.0.0)
vuejs-rails (2.3.2)
warden (1.2.8)
Expand Down Expand Up @@ -1112,6 +1117,7 @@ DEPENDENCIES
autoprefixer-rails
aws-sdk (= 3.0.1)
best_in_place (~> 3.0.1)
bourbon
byebug (~> 9.0, >= 9.0.5)
bystander (= 2.0.0)!
capistrano (= 3.11.0)
Expand Down Expand Up @@ -1143,6 +1149,7 @@ DEPENDENCIES
levenshtein (~> 0.2.2)
minitest (~> 5.10, != 5.10.2)
mocha (~> 1.0.0)
neat
nokogiri (~> 1.10.4)
pg (~> 0.21)
phantompdf (~> 1.2.2)
Expand All @@ -1163,7 +1170,7 @@ DEPENDENCIES
timecop (~> 0.7.1)
tinymce-rails (~> 4.3.2)
turnout (~> 2.5.0)
uglifier (~> 2.7.2)
uglifier (~> 4.1.17)
vuejs-rails (~> 2.3.2)
webmock (~> 1.22.0)
webpacker (~> 4.0.2)
Expand Down
30 changes: 9 additions & 21 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
* *= require_self
*/

// grids
@import 'bourbon/core/bourbon';
@import 'bourbon-neat/app/assets/stylesheets/neat';
// Temporarily comment bourbon
@import 'bourbon';
@import 'neat';

// /core/bourbon';
// @import 'bourbon-neat/app/assets/stylesheets/neat';

// // maps
@import 'leaflet/dist/leaflet';
// // // maps
// @import 'leaflet/dist/leaflet';

@import './resources/mixins/rem-calc';
@import './resources/mixins/media-queries';
Expand Down Expand Up @@ -171,4 +159,4 @@
@import './styles/components/vue-agile';
@import './styles/pages/*';

@import 'utilities/u-classes';
@import 'utilities/u-classes';
11 changes: 11 additions & 0 deletions bin/yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
begin
exec "yarnpkg", *ARGV
rescue Errno::ENOENT
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
end
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Application < Rails::Application
#{config.root}/app/presenters
#{config.root}/app/serializers
)
config.assets.paths << Rails.root.join('node_modules')
# config.assets.paths << Rails.root.join('node_modules')
config.assets.precompile += %w(base.js country.js home.js map.js protected_areas.js search.js resources.js content.js marine.js green_list.js region.js target_dashboard.js)
config.assets.precompile += %w(d3/d3.js)
config.assets.precompile += %w(d3/d3.min.js)
Expand Down
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
config.serve_static_files = false

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
config.assets.js_compressor = Uglifier.new(:harmony => true)
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
Expand Down
1 change: 1 addition & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
#
Rails.application.config.assets.precompile += %w( pdf.css )
Rails.application.config.assets.paths << Rails.root.join('node_modules')
Rails.application.config.assets.paths << Rails.root.join('node_modules/bourbon')
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"dependencies": {
"@rails/webpacker": "^4.0.2",
"axios": "^0.19.0",
"bourbon": "^5.1.0",
"bourbon-neat": "^1.9.0",
"d3": "^5.9.2",
"es6-object-assign": "^1.1.0",
"es6-promise": "^4.2.6",
"leaflet": "^1.4.0",
"leaflet": "^1.6.0",
"save": "^2.4.0",
"scrollmagic": "^2.0.6",
"vue": "^2.6.10",
"vue-agile": "^1.0.11",
Expand Down
Loading

0 comments on commit 9ebd1e1

Please sign in to comment.