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

Use webpacker for bundling and transpiling javascript #484

Merged
merged 15 commits into from
Jun 14, 2018
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 }]
]
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ ruby

## zsh rake pugin
.rake_tasks

/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity
21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
FROM ruby:2.3.7
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
ENV PHANTOM_JS=2.1.1
RUN apt-get update && \
apt-get install build-essential chrpath libssl-dev libxft-dev -y && \

# Add the apt repository for yarn
RUN curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list

# Add the apt-repository for the latest node.js
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -

RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN apt-get install build-essential chrpath libssl-dev libxft-dev -y && \
apt-get install libfreetype6 libfreetype6-dev -y && \
apt-get install libfontconfig1 libfontconfig1-dev -y && \
cd ~ && \
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" && \
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2 && \
tar xvjf $PHANTOM_JS.tar.bz2 && \
mv $PHANTOM_JS /usr/local/share && \
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin && \
apt-get install -y yarn
RUN mkdir /refugerestrooms
WORKDIR /refugerestrooms

COPY Gemfile /refugerestrooms/Gemfile
COPY Gemfile.lock /refugerestrooms/Gemfile.lock
RUN bundle install
COPY . /refugerestrooms

COPY package.json yarn.lock /refugerestrooms/
RUN yarn --pure-lockfile
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ gem 'bootstrap-sass'
gem 'haml'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.5'
gem 'geocoder', '~> 1.2.1'
Expand All @@ -28,6 +27,7 @@ gem 'rack-cors', :require => 'rack/cors'
gem 'rack-jsonp'
gem 'http_accept_language'
gem 'puma'
gem 'webpacker', '~> 3.5'

# Upgraded to 1.0.0 for Rails 5.1.4
gem 'activeadmin', '~> 1.0.0'
Expand Down
8 changes: 7 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ GEM
rack
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-proxy (0.6.4)
rack
rack-test (0.7.0)
rack (>= 1.0, < 3)
rails (5.1.4)
Expand Down Expand Up @@ -351,6 +353,10 @@ GEM
webmock (1.18.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
webpacker (3.5.3)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
Expand Down Expand Up @@ -382,7 +388,6 @@ DEPENDENCIES
http_accept_language
i18n-debug
jbuilder (~> 2.5)
jquery-rails
kaminari (~> 0.17.0)
mail_form (>= 1.7.0)
pg
Expand All @@ -405,6 +410,7 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
webmock (~> 1.18.0)
webpacker (~> 3.5)

RUBY VERSION
ruby 2.3.7p456
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/active_admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= require active_admin/base
1 change: 0 additions & 1 deletion app/assets/javascripts/active_admin.js.coffee

This file was deleted.

11 changes: 0 additions & 11 deletions app/assets/javascripts/application.js.coffee

This file was deleted.

3 changes: 0 additions & 3 deletions app/assets/javascripts/global_vars.js.erb

This file was deleted.

73 changes: 0 additions & 73 deletions app/assets/javascripts/lib/geocoder.coffee

This file was deleted.

4 changes: 0 additions & 4 deletions app/assets/javascripts/lib/global_variables.coffee.erb

This file was deleted.

107 changes: 0 additions & 107 deletions app/assets/javascripts/views/restrooms/new.coffee

This file was deleted.

22 changes: 0 additions & 22 deletions app/assets/javascripts/views/restrooms/restrooms.js.coffee

This file was deleted.

Loading