This repository has been archived by the owner on Sep 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d4754b4
Showing
10 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
env: | ||
browser: true | ||
node: true | ||
ecmaFeatures: | ||
jsx: true | ||
arrowFunctions: true | ||
binaryLiterals: true | ||
blockBindings: true | ||
defaultParams: true | ||
forOf: true | ||
generators: true | ||
objectLiteralComputedProperties: true | ||
objectLiteralDuplicateProperties: true | ||
objectLiteralShorthandMethods: true | ||
objectLiteralShorthandProperties: true | ||
octalLiterals: true | ||
regexUFlag: true | ||
regexYFlag: true | ||
superInFunctions: true | ||
templateStrings: true | ||
unicodeCodePointEscapes: true | ||
globalReturn: true | ||
rules: | ||
browser: true | ||
node: true | ||
no-unused-vars: 1 | ||
strict: [2, "never"] | ||
quotes: "single" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
node_modules | ||
config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
export PATH := ./node_modules/.bin:$(PATH) | ||
export SHELL := /bin/bash | ||
|
||
source_dir = src | ||
source_js_path = $(source_dir)/javascripts | ||
source_css_path = $(source_dir)/stylesheets | ||
|
||
source_index = $(source_dir)/index.html | ||
source_js_files = $(shell find $(source_js_path) -name "*.js") | ||
source_app_js = $(source_js_path)/app.js | ||
source_css_files = $(shell find $(source_css_path) -name "*.styl") | ||
source_main_css = $(source_css_path)/main.styl | ||
|
||
app_index = build/index.html | ||
app_js = build/js/main.js | ||
app_css = build/css/main.css | ||
build_dir = build | ||
|
||
js_debug := --debug | ||
css_debug := --sourcemap-inline | ||
|
||
.PHONY: all all_production watch clean production | ||
|
||
all: $(app_index) $(app_js) $(app_css) | ||
|
||
watch: clean all | ||
watchy -w $(source_js_path),$(source_css_path) -- make all | ||
|
||
clean: | ||
rm -rf build | ||
rm -rf production | ||
|
||
# deactivate debugging flags for production | ||
production: js_debug = | ||
production: css_debug = | ||
production: clean $(app_index) $(app_js) $(app_css) | ||
|
||
$(app_index): | ||
mkdir -p $(build_dir) | ||
cp $(source_index) $(app_index) | ||
|
||
$(app_js): $(source_js_files) | ||
mkdir -p $(dir $@) | ||
browserify $(js_debug) -t 6to5ify -t reactify $(source_app_js) > $@ | ||
|
||
$(app_css): $(source_css_files) | ||
mkdir -p $(dir $@) | ||
stylus $(css_debug) --include $(source_css_path) < $(source_main_css) > $(app_css) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# guide-app-sw | ||
|
||
## Installation | ||
|
||
You can run this yourself with: | ||
|
||
$ npm install | ||
$ node app.js | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var express = require('express'); // Express web server framework | ||
var fs = require('fs'); | ||
|
||
var config = require('./config.json'); | ||
|
||
var app = express(); | ||
|
||
app.use(express.static(__dirname + '/build')); | ||
|
||
app.get('/*', function (req, res) { | ||
res.type('html'); | ||
res.send(fs.readFileSync('build/index.html')); | ||
}); | ||
|
||
console.log('Listening on '+config.port); | ||
app.listen(config.port); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"accessToken": "ACCESS_TOKEN", | ||
"space": "SPACE_ID" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"author": "Tiago Rodrigues", | ||
"name": "guide-app-sw", | ||
private: true, | ||
"description": "", | ||
"version": "0.0.1", | ||
"main": "app.js", | ||
"dependencies": { | ||
"axios": "^0.5.0", | ||
"express": "~4.0.0", | ||
"immutable": "^3.6.2", | ||
"react-router": "^0.12.0" | ||
}, | ||
"devDependencies": { | ||
"6to5ify": "^3.1.2", | ||
"browserify": "^8.1.0", | ||
"react": "^0.12.2", | ||
"reactify": "^0.17.1", | ||
"stylus": "^0.49.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title></title> | ||
<link rel="stylesheet" href="/css/main.css" type="text/css" media="screen" charset="utf-8"> | ||
<meta charset="utf-8"> | ||
<script src="/js/main.js"></script> | ||
</head> | ||
|
||
<body></body> | ||
|
||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const React = require('react'); | ||
const Router = require('react-router'); | ||
const {Route, RouteHandler, DefaultRoute, HistoryLocation} = Router; | ||
|
||
const LoginButton = require('./components/login'); | ||
const Home = require('./components/home'); | ||
const SuccessfulLogin = require('./components/successful_login'); | ||
const FailedLogin = require('./components/failed_login'); | ||
|
||
const App = React.createClass({ | ||
render() { | ||
return ( | ||
<main> | ||
<nav> | ||
Some nav maybe | ||
</nav> | ||
|
||
<RouteHandler/> | ||
</main> | ||
); | ||
} | ||
}); | ||
|
||
const routes = ( | ||
<Route handler={App} path="/"> | ||
<DefaultRoute handler={Home}/> | ||
<Route name="successful_login" handler={SuccessfulLogin}/> | ||
<Route name="failed_login" handler={FailedLogin}/> | ||
</Route> | ||
); | ||
|
||
Router.run(routes, HistoryLocation, Handler => { | ||
React.render(<Handler/>, document.getElementById('appContainer')); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
Main styles | ||
Styleguide 1.0 | ||
*/ | ||
|
||
/* | ||
Body styles | ||
Styles the body | ||
Markup: | ||
body | ||
Styleguide 1.1 | ||
*/ | ||
body | ||
font-size: 10px |