Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

Commit bc88a49

Browse files
authored
Merge pull request #39 from Rulox/develop
Develop
2 parents 91ba469 + 6276b9c commit bc88a49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+415
-504
lines changed

.babelrc

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

.eslintrc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"extends": "eslint-config-airbnb",
3-
"env": {
4-
"browser": true
5-
},
2+
"extends": "airbnb",
3+
parser: "babel-eslint",
64
"rules": {
5+
"react/prop-types": [2],
6+
"no-unused-vars": 0,
77
"react/no-multi-comp": 0,
88
"import/default": 0,
99
"import/no-duplicates": 0,
@@ -19,16 +19,16 @@
1919
"react/jsx-filename-extension": 0,
2020
"arrow-body-style": 0,
2121
"react/jsx-space-before-closing": 0,
22+
"no-undef": 0, # Should look into this one #
2223
"eol-last": 0,
2324
"max-len": ["error", 120],
2425
"react/forbid-prop-types": 0,
2526
"object-curly-spacing": 0
2627
},
2728
"plugins": [ "react" ],
28-
"settings": {
29-
"import/parser": "babel-eslint",
29+
"settings": {
3030
"import/resolve": {
3131
"moduleDirectory": ["node_modules", "src"]
3232
}
3333
}
34-
}
34+
}

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.idea
22
node_modules
33
npm-debug.log
4+
.webpack.config.js.swp
5+
.eslintcache
46

5-
# Dest assets folders
6-
public/css
7-
public/js
7+
# Build folder
8+
dist/

.stylelintrc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
{
22
"rules": {
3-
"block-no-empty": null,
4-
"color-no-invalid-hex": true,
5-
"comment-empty-line-before": [ "always", {
6-
"ignore": ["stylelint-commands", "between-comments"],
7-
} ],
8-
"declaration-colon-space-after": "always",
9-
"indentation": ["tab", {
10-
"except": ["value"]
11-
}],
123
"max-empty-lines": 2,
13-
"rule-nested-empty-line-before": [ "always", {
14-
"except": ["first-nested"],
15-
"ignore": ["after-comment"],
16-
} ],
17-
"unit-whitelist": ["em", "rem", "%", "s"]
4+
"max-line-length": 90,
5+
"max-nesting-depth": 3,
186
}
197
}

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ before_install:
1010
npm install
1111
npm --version
1212
script:
13-
- npm run js-lint -s
14-
- npm run sass-lint -s
13+
- npm run lint

Gulpfile.js

Lines changed: 0 additions & 106 deletions
This file was deleted.

README.md

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ This base project allows you to have a basic React App folder structure followin
88
It contain some basic components that you can use. All the components are not (or minimally) stylized. The main objective
99
of this project is to have a basic structure, that is the reason we are not doing complex styles and/or adding many libs.
1010

11+
Also, each component is a JSX file and a .scss file that is associated to the component. This means, all the
12+
components for this project should be modular, to make it easy its usage between different apps.
13+
1114
## Tools
1215

1316
Using these package, you will be able to start a new fresh React project with the basic folder and file structures.
@@ -17,17 +20,19 @@ web server in your machine that automatically updates the code and the styles wh
1720

1821
## Features
1922

20-
* ES6 to JS Transpile
21-
* SASS to CSS
22-
* React Router
23+
* Webpack
24+
* ES6
25+
* SASS
26+
* React Router
2327
* Auto watcher for JS and SCSS files
2428
* Atomic design project structure
25-
* Launch server that updates itself every time we change a file with browsersync
29+
* Launch server with hot-reload using webpack
2630
* JS Lint ( extending airbnb eslint styles )
2731
* Styleint
2832

2933
## TODO List
3034
* Tests
35+
* Upgrade to Webpack 2.^ once stable
3136

3237
## Requirements
3338
* nodejs v5.*
@@ -45,11 +50,6 @@ Clone this repo (Be sure you delete the .git file, or move the files to your own
4550
git clone -b master --single-branch --depth 1 git@github.com:Rulox/react-atomic-structure.git
4651
```
4752

48-
##### Install Gulp globally
49-
```bash
50-
npm install -g gulp
51-
```
52-
5353
##### Install npm dependencies
5454
```bash
5555
npm install
@@ -59,13 +59,12 @@ npm install
5959
```bash
6060
npm run start
6161
```
62-
A browser window should open, if not, open it manually and go to http://localhost:3000/ (or any other URL+PORT that your terminal says). You can start working right now in the code, and all the changes will be visible in the browser just opened.
62+
A browser webpack server should be ready on http://localhost:8080/ (or any other URL+PORT that your terminal says). You can start working right now in the code, and all the changes will be visible in the browser just opened.
6363

6464
## Predefined components
6565
But first, [What is Atomic Design?](http://bradfrost.com/blog/post/atomic-web-design/)
6666

67-
These components are just an idea on how to develop your application following the Atomic Design. Feel free to upgrade/delete
68-
them in order to do your own app!
67+
These components are just an idea on how to develop your application following the Atomic Design. Feel free to upgrade/delete them in order to do your own app!
6968

7069
#### Atoms (stateless component)
7170
* Anchor
@@ -94,9 +93,7 @@ them in order to do your own app!
9493
To create a new component, just create a new folder in the atoms/molecules/organisms/templates folder with the
9594
name of your component.
9695

97-
Create now the React component in the js file. Also create your .scss file and remember to import it in the _style.scss
98-
of the parent folder (For example, if you're creating a new atom called Checkbox, you should have `atoms/Checkbox/_style.scss`. So in
99-
the main style file for atoms `atoms/_style.scss` just import your new scss file so it can be imported.
96+
Create now the React component in the jsx file. Also create your .scss file and remember to import it in the component jsx file using `require`.
10097

10198
## NPM Scripts
10299
This project comes with the following scripts to help you.
@@ -105,33 +102,18 @@ This project comes with the following scripts to help you.
105102
npm run start
106103
```
107104
1. Create CSS and JS bundles from Sass and JS.
108-
2. Launch a browsersync web server and open default browser.
105+
2. Launch a web server.
109106
3. Launch watchers on JS/CSS files.
110107

111108
```bash
112-
npm run build-dev
113-
```
114-
1. Build CSS and JS from sources but does not start browsersync server.
115-
116-
```bash
117-
npm run build-prod
109+
npm run build
118110
```
119-
1. Build CSS and JS minified and ready for production but does not start browsersync server.
111+
1. Build CSS and JS files. With this command, the js will be minified, the bundle version will be used in the html.
120112

121113
```bash
122-
npm run start-server
123-
```
124-
1. Run the server serving the `/public` folder using browsersync.
125-
126-
```bash
127-
npm run js-lint
114+
npm run lint
128115
```
129116
1. Launch JS Lint checker.
130117

131-
```bash
132-
npm run sass-lint
133-
```
134-
1. Launch SASS Lint checker.
135-
136118
## Contributions
137119
Feel free to create a pull request or create an issue to add features or fix bugs.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
/* General Styles */
2+
13
html, body, ul, li {
24
margin: 0;
35
padding: 0;
4-
}
6+
}

app/app.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/app.jsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
4+
5+
// Components
6+
import Home from './components/templates/Home/Home';
7+
import Main from './components/templates/Main/Main';
8+
import About from './components/templates/About/About';
9+
10+
require('./_style.scss');
11+
12+
const App = () => (
13+
<Router history={browserHistory}>
14+
<Route path="/" component={Main}>
15+
<IndexRoute component={Home} />
16+
<Route path="/about" component={About} />
17+
</Route>
18+
</Router>
19+
);
20+
21+
if (typeof window !== 'undefined') {
22+
ReactDOM.render(<App />, document.getElementById('app'));
23+
}

0 commit comments

Comments
 (0)