Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
David Barratt committed Oct 25, 2017
0 parents commit 3a4dadf
Show file tree
Hide file tree
Showing 22 changed files with 8,491 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [
"transform-react-jsx",
"transform-object-rest-spread"
]
}
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{yaml,yml}]
indent_style = space
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/html
36 changes: 36 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"extends": [
"airbnb",
"wikimedia"
],
"rules": {
"import/extensions": [
"error",
"never",
{
"png": "always",
"scss": "always"
}
],
"import/no-extraneous-dependencies": ["off"],
"import/no-unresolved": ["off"],
"jsx-a11y/label-has-for": ["off"],
"jsx-a11y/anchor-is-valid": ["off"],
"one-var": [
"error",
"never"
],
"react/jsx-filename-extension": [
"error",
{
"extensions": [
".js"
]
}
],
"react/jsx-indent": [
"error",
"tab"
]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/html
3 changes: 3 additions & 0 deletions bin/watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
npm install;
npm run watch;
14 changes: 14 additions & 0 deletions build-claim0-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: build-claim0
name: build-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}
36 changes: 36 additions & 0 deletions build-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.3.0 (4f187a1)
creationTimestamp: null
labels:
io.kompose.service: build
name: build
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
io.kompose.service: build
spec:
containers:
- args:
- ./bin/watch
image: docker-registry.tools.wmflabs.org/toollabs-nodejs-web
name: build
resources: {}
volumeMounts:
- mountPath: /code
name: build-claim0
workingDir: /code
restartPolicy: Always
volumes:
- name: build-claim0
persistentVolumeClaim:
claimName: build-claim0
status: {}
20 changes: 20 additions & 0 deletions build-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.3.0 (4f187a1)
creationTimestamp: null
labels:
io.kompose.service: build
name: build
spec:
clusterIP: None
ports:
- name: headless
port: 55555
targetPort: 0
selector:
io.kompose.service: build
status:
loadBalancer: {}
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
web:
image: docker-registry.tools.wmflabs.org/toollabs-static-web
ports:
- 8888:80
command: lighttpd -D -f /etc/lighttpd/lighttpd.conf
volumes:
- ./etc/lighttpd/lighttpd.conf:/etc/lighttpd/lighttpd.conf:cached
- ./:/var/www:cached
build:
image: docker-registry.tools.wmflabs.org/toollabs-nodejs-web
working_dir: /code
command:
- ./bin/watch
volumes:
- ./:/code:cached
31 changes: 31 additions & 0 deletions etc/lighttpd/lighttpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite",
)

server.document-root = "/var/www/html"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80


index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

# rewrite everything to index.html
url.rewrite-if-not-file = ( "^/.*$" => "/index.html" )
Empty file added images/.gitkeep
Empty file.
10 changes: 10 additions & 0 deletions index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="root"></div>
</body>
</html>
39 changes: 39 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/* eslint-env browser */
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import createHistory from 'history/createBrowserHistory';
import { ConnectedRouter, routerMiddleware } from 'react-router-redux';
import { createEpicMiddleware } from 'redux-observable';
import { composeWithDevTools } from 'redux-devtools-extension';
import App from './src/components/app';
import reducer from './src/reducers/index';
import epic from './src/epics/index';
import './styles/styles.scss';

function main() {
// Create a history of your choosing (we're using a browser history in this case)
const history = createHistory();
// Build the middleware for intercepting and dispatching navigation actions
const router = routerMiddleware( history );
const epicMiddleware = createEpicMiddleware( epic );
// Add the reducer to your store on the `router` key
// Also apply our middleware for navigating
const store = createStore(
reducer,
composeWithDevTools( applyMiddleware( router, epicMiddleware ) ),
);

ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<App />
</ConnectedRouter>
</Provider>,
document.getElementById( 'root' ),
);
}

// Engage!
main();
Loading

0 comments on commit 3a4dadf

Please sign in to comment.