Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 2-0-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanRoberts committed May 3, 2016
2 parents baa1e41 + c3f6a82 commit 6ad0756
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 110 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test/dummy/public/ckeditor
test/dummy/public/system
test/dummy/tmp/
test/dummy/node_modules
test/dummy/client/build
node_modules
tags
vendor/ruby
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2.0.2 2016-05-03
* Fix issues with ClientSideValidations gem
* Bump to Rails 5.0.0beta4

2.0.1 2016-05-02
* Improve systems for building, serving, and deploying webpack assets w/ Rails in the test/dummy app. These systems can (and will) be used as a sample for creating new Tenon-based projects.

2.0.0 2016-04-01
* Removed standard resources from base Tenon. They have been placed in the dummy amp:
- Tenon::Comment
Expand Down
115 changes: 58 additions & 57 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GIT

GIT
remote: git://github.com/rack/rack.git
revision: deec4854c0ca8efcfc6fddfd11df1dfb93bb1b82
revision: f3a108619037d7f1e51230a8437af8f23764eca7
specs:
rack (2.0.0.alpha)
json
Expand All @@ -38,18 +38,18 @@ GIT

GIT
remote: https://github.com/DavyJonesLocker/client_side_validations
revision: 28561bc23da13b8124a675e406236bdbae7b1a4c
revision: e89ba8a452bcf37a7ad453f37359820d41f040d0
branch: rails5
specs:
client_side_validations (5.0.0)
jquery-rails (~> 4.0, >= 4.0.1)
js_regex (~> 1.0, >= 1.0.9)
rails (>= 5.0.0.beta3, < 5.1.0)
rails (>= 5.0.0.beta4, < 5.1.0)

PATH
remote: .
specs:
tenon (2.0.0)
tenon (2.0.2)
active_model_serializers
awesome_nested_set
cocoon
Expand All @@ -64,7 +64,7 @@ PATH
paperclip
pg
pundit
rails (= 5.0.0.beta3)
rails (= 5.0.0.beta4)
rails-settings-cached
react-rails
sprockets
Expand All @@ -75,41 +75,41 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
actioncable (5.0.0.beta4)
actionpack (= 5.0.0.beta4)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
actionview (= 5.0.0.beta3)
activejob (= 5.0.0.beta3)
actionmailer (5.0.0.beta4)
actionpack (= 5.0.0.beta4)
actionview (= 5.0.0.beta4)
activejob (= 5.0.0.beta4)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (5.0.0.beta3)
actionview (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
actionpack (5.0.0.beta4)
actionview (= 5.0.0.beta4)
activesupport (= 5.0.0.beta4)
rack (~> 2.x)
rack-test (~> 0.6.3)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
actionview (5.0.0.beta4)
activesupport (= 5.0.0.beta4)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
active_model_serializers (0.9.4)
active_model_serializers (0.9.5)
activemodel (>= 3.2)
activejob (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
activejob (5.0.0.beta4)
activesupport (= 5.0.0.beta4)
globalid (>= 0.3.6)
activemodel (5.0.0.beta3)
activesupport (= 5.0.0.beta3)
activerecord (5.0.0.beta3)
activemodel (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
activemodel (5.0.0.beta4)
activesupport (= 5.0.0.beta4)
activerecord (5.0.0.beta4)
activemodel (= 5.0.0.beta4)
activesupport (= 5.0.0.beta4)
arel (~> 7.0)
activesupport (5.0.0.beta3)
activesupport (5.0.0.beta4)
concurrent-ruby (~> 1.0)
i18n (~> 0.7)
minitest (~> 5.1)
Expand Down Expand Up @@ -138,9 +138,9 @@ GEM
activesupport (>= 3.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
cocoon (1.2.8)
cocoon (1.2.9)
coffee-script-source (1.10.0)
concurrent-ruby (1.0.1)
concurrent-ruby (1.0.2)
connection_pool (2.2.0)
database_cleaner (1.5.1)
date_time_attribute (0.1.2)
Expand All @@ -163,22 +163,24 @@ GEM
actionpack (>= 3.1)
railties (>= 3.1)
sass (>= 3.2)
jquery-rails (4.1.0)
rails-dom-testing (~> 1.0)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
js_regex (1.0.13)
regexp_parser (= 0.3.2)
js_regex (1.0.14)
regexp_parser (= 0.3.3)
json (1.8.3)
launchy (2.4.3)
addressable (~> 2.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mail (2.6.4)
mime-types (>= 1.16, < 4)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (2.99.1)
mime-types (3.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0221)
mimemagic (0.3.0)
mini_portile2 (2.0.0)
minitest (5.8.4)
Expand All @@ -195,7 +197,7 @@ GEM
non-stupid-digest-assets (1.0.8)
sprockets (>= 2.0)
orm_adapter (0.5.0)
paperclip (4.3.5)
paperclip (4.3.6)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
cocaine (~> 0.5.5)
Expand All @@ -208,17 +210,17 @@ GEM
railties (>= 3.1, < 5.0)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.0.beta3)
actioncable (= 5.0.0.beta3)
actionmailer (= 5.0.0.beta3)
actionpack (= 5.0.0.beta3)
actionview (= 5.0.0.beta3)
activejob (= 5.0.0.beta3)
activemodel (= 5.0.0.beta3)
activerecord (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
rails (5.0.0.beta4)
actioncable (= 5.0.0.beta4)
actionmailer (= 5.0.0.beta4)
actionpack (= 5.0.0.beta4)
actionview (= 5.0.0.beta4)
activejob (= 5.0.0.beta4)
activemodel (= 5.0.0.beta4)
activerecord (= 5.0.0.beta4)
activesupport (= 5.0.0.beta4)
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.0.beta3)
railties (= 5.0.0.beta4)
sprockets-rails (>= 2.0.0)
rails-controller-testing (0.1.1)
actionpack (~> 5.x)
Expand All @@ -232,32 +234,32 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails-settings-cached (0.5.4)
rails-settings-cached (0.6.3)
rails (>= 4.2.0)
railties (5.0.0.beta3)
actionpack (= 5.0.0.beta3)
activesupport (= 5.0.0.beta3)
railties (5.0.0.beta4)
actionpack (= 5.0.0.beta4)
activesupport (= 5.0.0.beta4)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.1.2)
react-rails (1.6.2)
react-rails (1.7.0)
babel-transpiler (>= 0.7.0)
coffee-script-source (~> 1.8)
connection_pool
execjs
rails (>= 3.2)
tilt
regexp_parser (0.3.2)
regexp_parser (0.3.3)
request_store (1.3.0)
responders (2.1.1)
railties (>= 4.2.0, < 5.1)
ruby-progressbar (1.8.0)
sass (3.4.21)
sprockets (3.5.2)
sass (3.4.22)
sprockets (3.6.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.0.3)
sprockets-rails (3.0.4)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
Expand All @@ -266,9 +268,8 @@ GEM
tilt (2.0.2)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
uuidtools (2.1.5)
warden (1.2.4)
rack (>= 1.0)
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/tenon/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
//= require cocoon
//= require jquery-fileupload/basic
//= require jquery-fileupload/vendor/tmpl
//= require rails.validations
12 changes: 3 additions & 9 deletions app/views/layouts/tenon/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@
= @page_title + " | " if @page_title
= Tenon::MySettings.site_title.present? ? Tenon::MySettings.site_title : 'Tenon'
= stylesheet_link_tag '//fonts.googleapis.com/icon?family=Material+Icons'
= javascript_include_tag '/ckeditor/ckeditor'
= javascript_include_tag 'tenon/application'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/pickadate.js/3.5.6/compressed/picker.js'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/pickadate.js/3.5.6/compressed/picker.date.js'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/pickadate.js/3.5.6/compressed/picker.time.js'
- if Rails.env.development?
= javascript_include_tag 'http://localhost:9999/bundle.js'
= yield :pre_scripts
= render 'tenon/shared/assets'
= yield :post_scripts
%body{data: { controller: params[:controller], action: params[:action] } }
= flash_messages
Expand Down
13 changes: 13 additions & 0 deletions app/views/tenon/shared/_assets.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
= stylesheet_link_tag '//fonts.googleapis.com/icon?family=Material+Icons'
= javascript_include_tag '/ckeditor/ckeditor'
= javascript_include_tag 'tenon/application'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/pickadate.js/3.5.6/compressed/picker.js'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/pickadate.js/3.5.6/compressed/picker.date.js'
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/pickadate.js/3.5.6/compressed/picker.time.js'
= javascript_include_tag TENON_FRONTEND_ASSET_PATH

- # Only load separate stylesheets in production, they're included in
- # the JS in development
- if Rails.env.production?
= stylesheet_link_tag TENON_FRONTEND_ASSET_PATH
2 changes: 1 addition & 1 deletion lib/tenon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def self.configure
class Configuration
attr_accessor :mobile_layout, :languages, :seo_callout, :front_end,
:after_create_path, :after_update_path, :client_color,
:primary_color
:primary_color, :dev_assets
end
end
2 changes: 1 addition & 1 deletion lib/tenon/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Tenon
VERSION = '2.0.0'
VERSION = '2.0.2'
end
14 changes: 0 additions & 14 deletions test/dummy/app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
// Replace default Sprocket's directives with Webpack loaders!
import 'script!imports?this=>window!jquery';
import 'script!jquery_ujs';
import 'script!coffee!turbolinks.js.coffee';

// Basically, if you're importing anything from sprockets, you'll want to use
// the script-loader. While this is possible, it's best to move as many things
// as you can to being managed by npm and Webpack.
//
// Sometimes you may run into Gem provided asset that has deep Sprocket's
// directives. In this scenario, my best advice is to grab the precompiled asset
// from sprockets via http://rails-app.dev/assets/some-asset.js, and copy into
// your vendor folder at vendor/assets/javascripts/some-asset.js, and import it
// using the script-loader.
1 change: 1 addition & 0 deletions test/dummy/app/assets/javascripts/tenon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//= require tenon-main
3 changes: 1 addition & 2 deletions test/dummy/app/views/layouts/tenon/login.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
= Tenon::MySettings.site_title.present? ? Tenon::MySettings.site_title : 'Tenon'
= stylesheet_link_tag '//fonts.googleapis.com/icon?family=Material+Icons'
= stylesheet_link_tag 'tenon/tenon'
= javascript_include_tag 'tenon/tenon_manifest'
= render 'tenon/shared/assets'
= yield :scripts
%body{ data: {controller: controller_name, action: action_name} }
Expand Down
14 changes: 14 additions & 0 deletions test/dummy/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

mkdir -p public/assets
rm -f public/assets/*.chunk.*

npm run build

mv client/build/assets/*.chunk.* public/assets/

RAILS_ENV=production rake assets:precompile

rm -rf client/build/assets
rm -f client/build/stats.json

Empty file added test/dummy/client/app.js
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (module.hot) module.hot.accept();

require('./stylesheets/application.scss');
require('./tenon.scss')
require('tenon');
require('./components/posts');
require('./components/post-categories');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
@import 'tenon/vendor_override';
@import 'tenon/global';
@import 'tenon/modules';

// body { font-family: 'Comic Sans MS'; }
7 changes: 7 additions & 0 deletions test/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
# Raises helpful error messages.
config.assets.raise_runtime_errors = true

config.action_controller.asset_host = proc { |source|
if source =~ /wp-bundle/i
src = Tenon.config.dev_assets
"#{src[:protocol]}://#{src[:host]}:#{src[:port]}#{src[:dir]}"
end
}

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

Expand Down
2 changes: 2 additions & 0 deletions test/dummy/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
# yet still be able to expire them through the digest params.
config.assets.digest = true

config.assets.paths << "#{Rails.root}/client/build/assets"

# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb

# Enable serving of images, stylesheets, and JavaScripts from an asset server.
Expand Down
Loading

0 comments on commit 6ad0756

Please sign in to comment.