Skip to content

Commit 02cecd3

Browse files
author
Alex Tharp
authored
Merge pull request #47 from cortex-cms/react-foundation
React Foundation
2 parents b2dd112 + 5867170 commit 02cecd3

File tree

19 files changed

+254
-5
lines changed

19 files changed

+254
-5
lines changed

.gitignore

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,68 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
/vendor/bundle
10+
/vendor/assets
11+
12+
# Ignore the default SQLite database.
13+
/db/*.sqlite3
14+
/db/*.sqlite3-journal
15+
16+
# Ignore all logfiles and tempfiles.
17+
/log/*.log
18+
/tmp
19+
20+
# Debug
21+
.byebug_history
22+
23+
# OS Files
24+
.DS_Store
25+
._.DS_Store
26+
.directory
27+
28+
# Text-editor/IDE generated files
29+
*.sublime-workspace
30+
*.sublime-project
31+
/.idea
32+
*.iml
33+
34+
*.rbc
35+
*.sassc
36+
.sass-cache
37+
capybara-*.html
38+
.powrc
39+
/public/system
40+
/coverage/
41+
/spec/tmp
42+
**.orig
43+
rerun.txt
44+
.env
45+
146
Gemfile.lock
2-
.bundle/
3-
log/*.log
4-
pkg/
47+
.ruby-version
48+
.ruby-gemset
49+
50+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
51+
.rvmrc
52+
53+
# React on Rails
54+
npm-debug.log*
55+
node_modules
56+
57+
# Generated js bundles
58+
/app/assets/webpack/*
59+
60+
# Test app
561
test/dummy/db/*.sqlite3
662
test/dummy/db/*.sqlite3-journal
763
test/dummy/log/*.log
864
test/dummy/tmp/
9-
.idea/
65+
66+
# build artifacts
1067
*.gem
68+
pkg/

.npmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CHANGELOG.md
2+
Gemfile
3+
README.md
4+
app
5+
coverage
6+
docs
7+
examples
8+
node_modules
9+
react_on_rails.gemspec
10+
Dockerfile_tests
11+
Gemfile.lock
12+
Rakefile
13+
bin
14+
docker-compose.yml
15+
etc
16+
lib
17+
rakelib
18+
ruby-lint.yml
19+
spec
20+
node_modules
21+
tmp
22+
gen-examples

app/cells/plugins/core/cell.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module Plugins
22
module Core
33
class Cell < FieldCell
4+
include ReactOnRailsHelper
5+
46
view_paths << "#{Cortex::Plugins::Core::Engine.root}/app/cells"
57

68
def required?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
= react_component("HelloWorld2App", props: hello_world_props)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module Plugins
2+
module Core
3+
class ReactTestCell < Plugins::Core::Cell
4+
def show
5+
render
6+
end
7+
8+
private
9+
10+
def hello_world_props
11+
{ name: 'Stranger' }
12+
end
13+
end
14+
end
15+
end

config/initializers/react_on_rails.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ActiveSupport.on_load(:action_view) do
2+
include ReactOnRailsHelper
3+
end

cortex-plugins-core.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
1717
s.files = Dir["{app,config,db,lib}/**/*", "LICENSE.md", "Rakefile", "README.md"]
1818

1919
s.add_dependency "rails", ">= 4"
20+
s.add_dependency "react_on_rails", "~> 6"
2021
s.add_dependency "cells", "~> 4.1"
2122
s.add_dependency "cells-rails", "~> 0.0.6"
2223
s.add_dependency "cells-haml", "~> 0.0.10"

lib/cortex/plugins/core/engine.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'jsonb_accessor'
2+
require 'react_on_rails'
23

34
module Cortex
45
module Plugins

lib/cortex/plugins/core/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Cortex
22
module Plugins
33
module Core
4-
VERSION = '0.10.4'
4+
VERSION = '0.11.0'
55
end
66
end
77
end

node_package/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "stage-0", "react"]
3+
}

0 commit comments

Comments
 (0)