Skip to content

Commit 22f4f2e

Browse files
committed
Merge pull request shakacode#171 from shakacode/use-bundles-folder-structure
[WIP] Convert to bundles directory structure
2 parents 344875f + d17119a commit 22f4f2e

33 files changed

+30
-22
lines changed

Gemfile.lock

+7-5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ GEM
9191
coffee-script-source
9292
execjs
9393
coffee-script-source (1.10.0)
94+
concurrent-ruby (1.0.0)
9495
connection_pool (2.2.0)
9596
coveralls (0.8.9)
9697
json (~> 1.8)
@@ -139,12 +140,12 @@ GEM
139140
mime-types (>= 1.16, < 3)
140141
method_source (0.8.2)
141142
mime-types (2.99)
142-
mini_portile (0.6.2)
143+
mini_portile2 (2.0.0)
143144
minitest (5.8.3)
144145
multi_json (1.11.2)
145146
netrc (0.11.0)
146-
nokogiri (1.6.6.4)
147-
mini_portile (~> 0.6.0)
147+
nokogiri (1.6.7)
148+
mini_portile2 (~> 2.0.0.rc2)
148149
parser (2.2.3.0)
149150
ast (>= 1.1, < 3.0)
150151
pg (0.18.4)
@@ -203,7 +204,7 @@ GEM
203204
rainbow (2.0.0)
204205
rake (10.4.2)
205206
rdoc (4.2.0)
206-
react_on_rails (1.1.0)
207+
react_on_rails (1.1.1)
207208
connection_pool
208209
execjs (~> 2.5)
209210
rails (>= 3.2)
@@ -278,7 +279,8 @@ GEM
278279
spring (1.4.4)
279280
spring-commands-rspec (1.0.4)
280281
spring (>= 0.9.1)
281-
sprockets (3.4.1)
282+
sprockets (3.5.1)
283+
concurrent-ruby (~> 1.0)
282284
rack (> 1, < 3)
283285
sprockets-rails (2.3.3)
284286
actionpack (>= 3.0)

client/app/components/CommentForm.jsx renamed to client/app/bundles/Comments/components/CommentForm.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class CommentForm extends React.Component {
4646
comment = {
4747
// This is different because the input is a native HTML element
4848
// rather than a React element.
49-
author: this.refs.inlineAuthor.getDOMNode().value,
50-
text: this.refs.inlineText.getDOMNode().value,
49+
author: this.refs.inlineAuthor.value,
50+
text: this.refs.inlineText.value,
5151
};
5252
}
5353

client/app/startup/ClientApp.jsx renamed to client/app/bundles/Comments/startup/ClientApp.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { Provider } from 'react-redux';
33

4-
import createStore from '../stores/commentsStore';
4+
import createStore from '../store/commentsStore';
55
import NonRouterCommentScreen from '../components/NonRouterCommentScreen';
66

77
const App = props => {

client/app/startup/ClientRouterApp.jsx renamed to client/app/bundles/Comments/startup/ClientRouterApp.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Provider } from 'react-redux';
33
import Router from 'react-router';
44
import createHistory from 'history/lib/createBrowserHistory';
55

6-
import createStore from '../stores/commentsStore';
6+
import createStore from '../store/commentsStore';
77
import routes from '../routes/routes';
88

99
const RouterApp = (props, location) => {

client/app/startup/ServerApp.jsx renamed to client/app/bundles/Comments/startup/ServerApp.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { Provider } from 'react-redux';
33

4-
import createStore from '../stores/commentsStore';
4+
import createStore from '../store/commentsStore';
55
import NonRouterCommentScreen from '../components/NonRouterCommentScreen';
66

77
const App = props => {

client/app/startup/ServerRouterApp.jsx renamed to client/app/bundles/Comments/startup/ServerRouterApp.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { Provider } from 'react-redux';
33
import { match, RoutingContext } from 'react-router';
44

5-
import createStore from '../stores/commentsStore';
5+
import createStore from '../store/commentsStore';
66
import routes from '../routes/routes';
77

88
const RouterApp = (props, location) => {

client/app/stores/commentsStore.js renamed to client/app/bundles/Comments/store/commentsStore.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { compose, createStore, applyMiddleware, combineReducers } from 'redux';
55
import thunkMiddleware from 'redux-thunk';
6-
import loggerMiddleware from '../middlewares/loggerMiddleware';
6+
import loggerMiddleware from 'lib/middlewares/loggerMiddleware';
77
import reducers from '../reducers';
88
import { initalStates } from '../reducers';
99

client/test/components/CommentList_spec.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { React, expect, TestUtils } from '../test_helper';
22
import { List, Map } from 'immutable';
3-
import CommentList from '../../app/components/CommentList';
4-
import Comment from '../../app/components/Comment';
3+
import CommentList from '../../app/bundles/Comments/components/CommentList';
4+
import Comment from '../../app/bundles/Comments/components/Comment';
55

66
const {
77
renderIntoDocument,

client/test/components/Comment_spec.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { React, expect, TestUtils } from '../test_helper';
2-
import Comment from '../../app/components/Comment';
2+
import Comment from '../../app/bundles/Comments/components/Comment';
33

44
const {
55
renderIntoDocument,

client/webpack.client.base.config.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Common client-side webpack configuration used by webpack.hot.config and webpack.rails.config.
22

33
const webpack = require('webpack');
4+
const path = require('path');
45

56
const devBuild = process.env.NODE_ENV !== 'production';
67
const nodeEnv = devBuild ? 'development' : 'production';
@@ -21,10 +22,15 @@ module.exports = {
2122
],
2223

2324
// This will contain the app entry points defined by webpack.hot.config and webpack.rails.config
24-
app: [],
25+
app: [
26+
'./app/bundles/Comments/startup/clientGlobals',
27+
],
2528
},
2629
resolve: {
2730
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'],
31+
alias: {
32+
lib: path.join(process.cwd(), 'app', 'lib'),
33+
},
2834
},
2935
plugins: [
3036
new webpack.DefinePlugin({

client/webpack.client.hot.config.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ config.entry.app.push(
1616

1717
// Test out Css & Sass
1818
'./assets/stylesheets/test-stylesheet.css',
19-
'./assets/stylesheets/test-sass-stylesheet.scss',
20-
21-
// App entry point
22-
'./app/startup/clientGlobals'
19+
'./assets/stylesheets/test-sass-stylesheet.scss'
2320
);
2421

2522
config.output = {

client/webpack.client.rails.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ config.entry.vendor.unshift(
1919
'es5-shim/es5-shim',
2020
'es5-shim/es5-sham'
2121
);
22-
config.entry.app.push('./app/startup/clientGlobals');
2322

2423
// See webpack.common.config for adding modules common to both the webpack dev server and rails
2524

client/webpack.server.rails.config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Common webpack configuration for server bundle
22

33
const webpack = require('webpack');
4+
const path = require('path');
45

56
const devBuild = process.env.NODE_ENV !== 'production';
67
const nodeEnv = devBuild ? 'development' : 'production';
@@ -9,13 +10,16 @@ module.exports = {
910

1011
// the project dir
1112
context: __dirname,
12-
entry: ['./app/startup/serverGlobals', 'react-dom/server', 'react'],
13+
entry: ['./app/bundles/Comments/startup/serverGlobals', 'react-dom/server', 'react'],
1314
output: {
1415
filename: 'server-bundle.js',
1516
path: '../app/assets/javascripts/generated',
1617
},
1718
resolve: {
1819
extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', 'config.js'],
20+
alias: {
21+
lib: path.join(process.cwd(), 'app', 'lib'),
22+
},
1923
},
2024
plugins: [
2125
new webpack.DefinePlugin({

0 commit comments

Comments
 (0)