Skip to content

Commit

Permalink
Add initial deps
Browse files Browse the repository at this point in the history
  • Loading branch information
JaciBrunning committed Jul 6, 2019
1 parent ffcf76f commit ce41fdb
Show file tree
Hide file tree
Showing 21 changed files with 7,684 additions and 2 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@

*.swp
*.zip

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'

gem 'sidekiq', '5.2.6'
gem 'sidekiq-enqueuer', '2.1.1'

gem "google-cloud-storage", require: false

gem 'bootsnap', '>= 1.1.0', require: false

gem 'prometheus-client'

gem 'nokogiri', '~> 1.10.3'
gem 'active_model_serializers', '~> 0.10.9'
gem 'goldiloader', '~> 3.1.1'

gem 'webpacker'
gem 'react-rails'
gem 'bootstrap'
gem 'rails-fontawesome5'

group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
Expand Down
64 changes: 64 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_model_serializers (0.10.9)
actionpack (>= 4.1, < 6)
activemodel (>= 4.1, < 6)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (5.2.3)
activesupport (= 5.2.3)
globalid (>= 0.3.6)
Expand All @@ -47,9 +52,19 @@ GEM
archive-zip (0.12.0)
io-like (~> 0.3.0)
arel (9.0.0)
autoprefixer-rails (9.6.1)
execjs
babel-source (5.8.35)
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
bindex (0.7.0)
bootsnap (1.4.4)
msgpack (~> 1.0)
bootstrap (4.3.1)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
builder (3.2.3)
byebug (11.0.1)
capybara (3.25.0)
Expand All @@ -60,6 +75,8 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
case_transform (0.2)
activesupport
childprocess (1.0.1)
rake (< 13.0)
chromedriver-helper (2.1.1)
Expand All @@ -73,6 +90,7 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
crass (1.0.4)
declarative (0.0.10)
declarative-option (0.1.0)
Expand All @@ -84,6 +102,9 @@ GEM
ffi (1.11.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
goldiloader (3.1.1)
activerecord (>= 4.2, < 6.1)
activesupport (>= 4.2, < 6.1)
google-api-client (0.28.7)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.5, < 0.10.0)
Expand Down Expand Up @@ -115,6 +136,7 @@ GEM
io-like (0.3.0)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
jsonapi-renderer (0.2.2)
jwt (2.1.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand Down Expand Up @@ -144,12 +166,17 @@ GEM
mini_portile2 (~> 2.4.0)
os (1.0.0)
pg (1.1.4)
popper_js (1.14.5)
prometheus-client (0.9.0)
quantile (~> 0.2.1)
public_suffix (3.1.1)
puma (3.12.1)
quantile (0.2.1)
rack (2.0.7)
rack-protection (2.0.5)
rack
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.3)
Expand All @@ -168,6 +195,8 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-fontawesome5 (0.2.0)
rails
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.3)
Expand All @@ -180,6 +209,13 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
react-rails (2.5.0)
babel-transpiler (>= 0.7.0)
connection_pool
execjs
railties (>= 3.2)
tilt
redis (4.1.2)
regexp_parser (1.5.1)
representable (3.0.4)
declarative (< 0.1.0)
Expand All @@ -199,9 +235,24 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.0.1)
ffi (~> 1.9)
rake
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (3.142.3)
childprocess (>= 0.5, < 2.0)
rubyzip (~> 1.2, >= 1.2.2)
sidekiq (5.2.6)
connection_pool (~> 2.2, >= 2.2.2)
rack (>= 1.5.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
sidekiq-enqueuer (2.1.1)
signet (0.11.0)
addressable (~> 2.3)
faraday (~> 0.9)
Expand Down Expand Up @@ -235,6 +286,10 @@ GEM
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webpacker (4.0.7)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
Expand All @@ -245,27 +300,36 @@ PLATFORMS
ruby

DEPENDENCIES
active_model_serializers (~> 0.10.9)
bootsnap (>= 1.1.0)
bootstrap
byebug
capybara (>= 2.15)
chromedriver-helper
coffee-rails (~> 4.2)
goldiloader (~> 3.1.1)
google-cloud-storage
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
nokogiri (~> 1.10.3)
pg (>= 0.18, < 2.0)
prometheus-client
puma (~> 3.11)
rails (~> 5.2.3)
rails-fontawesome5
react-rails
sass-rails (~> 5.0)
selenium-webdriver
sidekiq (= 5.2.6)
sidekiq-enqueuer (= 2.1.1)
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
webpacker

RUBY VERSION
ruby 2.6.0p0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/
@import "bootstrap";
Empty file added app/javascript/components/.keep
Empty file.
22 changes: 22 additions & 0 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint no-console:0 */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb


// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)

console.log('Hello World from Webpacker')
// Support component names relative to this directory:
var componentRequireContext = require.context("components", true);
var ReactRailsUJS = require("react_ujs");
ReactRailsUJS.useContext(componentRequireContext);
26 changes: 26 additions & 0 deletions app/javascript/packs/hello_react.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Run this example by adding <%= javascript_pack_tag 'hello_react' %> to the head of your layout file,
// like app/views/layouts/application.html.erb. All it does is render <div>Hello React</div> at the bottom
// of the page.

import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'

const Hello = props => (
<div>Hello {props.name}!</div>
)

Hello.defaultProps = {
name: 'David'
}

Hello.propTypes = {
name: PropTypes.string
}

document.addEventListener('DOMContentLoaded', () => {
ReactDOM.render(
<Hello name="React" />,
document.body.appendChild(document.createElement('div')),
)
})
5 changes: 5 additions & 0 deletions app/javascript/packs/server_rendering.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// By default, this pack is loaded for server-side rendering.
// It must expose react_ujs as `ReactRailsUJS` and prepare a require context.
var componentRequireContext = require.context("components", true);
var ReactRailsUJS = require("react_ujs");
ReactRailsUJS.useContext(componentRequireContext);
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application' %>
</head>

<body>
Expand Down
85 changes: 85 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
var isTestEnv = api.env('test')

if (!validEnv.includes(currentEnv)) {
throw new Error(
'Please specify a valid `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: ' +
JSON.stringify(currentEnv) +
'.'
)
}

return {
presets: [
isTestEnv && [
require('@babel/preset-env').default,
{
targets: {
node: 'current'
}
}
],
(isProductionEnv || isDevelopmentEnv) && [
require('@babel/preset-env').default,
{
forceAllTransforms: true,
useBuiltIns: 'entry',
corejs: 3,
modules: false,
exclude: ['transform-typeof-symbol']
}
],
[
require('@babel/preset-react').default,
{
development: isDevelopmentEnv || isTestEnv,
useBuiltIns: true
}
]
].filter(Boolean),
plugins: [
require('babel-plugin-macros'),
require('@babel/plugin-syntax-dynamic-import').default,
isTestEnv && require('babel-plugin-dynamic-import-node'),
require('@babel/plugin-transform-destructuring').default,
[
require('@babel/plugin-proposal-class-properties').default,
{
loose: true
}
],
[
require('@babel/plugin-proposal-object-rest-spread').default,
{
useBuiltIns: true
}
],
[
require('@babel/plugin-transform-runtime').default,
{
helpers: false,
regenerator: true,
corejs: false
}
],
[
require('@babel/plugin-transform-regenerator').default,
{
async: false
}
],
isProductionEnv && [
require('babel-plugin-transform-react-remove-prop-types').default,
{
removeImport: true
}
]
].filter(Boolean)
}
}
19 changes: 19 additions & 0 deletions bin/webpack
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env ruby

ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require "rubygems"
require "bundler/setup"

require "webpacker"
require "webpacker/webpack_runner"

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
end
Loading

0 comments on commit ce41fdb

Please sign in to comment.