Skip to content

Commit 38202bc

Browse files
Gulp-Build-Prozess
1 parent a07c31f commit 38202bc

41 files changed

Lines changed: 115 additions & 143 deletions

Some content is hidden

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

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ cache:
99
- node_modules
1010
script:
1111
- npm test
12-
- npm run build
13-
deploy:
14-
provider: pages
15-
skip_cleanup: true
16-
local_dir: build
17-
github_token: $GITHUB_TOKEN
18-
on:
19-
branch: reborn
20-
condition: "$TRAVIS_OS_NAME = linux"
12+
- npm run compile
13+
#deploy:
14+
# provider: pages
15+
# skip_cleanup: true
16+
# local_dir: build
17+
# github_token: $GITHUB_TOKEN
18+
# on:
19+
# branch: reborn
20+
# condition: "$TRAVIS_OS_NAME = linux"

gulpfile.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
const gulp = require('gulp')
2+
const clean = require('gulp-clean')
3+
const babel = require('gulp-babel')
4+
const exec = require('child_process').exec
5+
const sequence = require('run-sequence')
6+
7+
const path = {
8+
src: './src',
9+
build: './build'
10+
}
11+
12+
gulp.task('clean', () => {
13+
return gulp
14+
.src(path.build, {read: false})
15+
.pipe(clean())
16+
})
17+
18+
gulp.task('compile', () => {
19+
return gulp
20+
.src(path.src + '/**/*.js')
21+
.pipe(babel({
22+
presets: ['env'],
23+
plugins: [
24+
'transform-react-jsx'
25+
]
26+
}))
27+
.pipe(gulp.dest(path.build))
28+
})
29+
30+
gulp.task('assets', () => {
31+
return gulp
32+
.src(path.src + '/**/*.{html,css,sql,png,jpg,jpeg,ico,svg,eot,ttf,woff,woff2,otf}')
33+
.pipe(gulp.dest(path.build))
34+
})
35+
36+
gulp.task('electron', (callback) => {
37+
exec('electron ' + path.build + '/electron/main.js', (error) => {
38+
callback(error)
39+
})
40+
})
41+
42+
gulp.task('default', () => {
43+
sequence('clean', 'compile', 'assets', 'electron')
44+
})

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "plotify",
33
"version": "0.2.0-SNAPHOT",
44
"homepage": ".",
5-
"main": "src/electron/main.js",
5+
"main": "main.js",
66
"private": true,
77
"dependencies": {
88
"classnames": "2.2.5",
@@ -18,10 +18,17 @@
1818
"uuid": "3.1.0"
1919
},
2020
"devDependencies": {
21+
"babel-plugin-transform-react-jsx": "6.24.1",
22+
"babel-preset-env": "1.6.1",
2123
"electron": "1.7.9",
24+
"gulp": "3.9.1",
25+
"gulp-babel": "7.0.0",
26+
"gulp-clean": "0.3.2",
27+
"run-sequence": "2.2.0",
2228
"standard": "10.0.3"
2329
},
2430
"scripts": {
31+
"compile": "gulp compile",
2532
"start": "react-scripts start",
2633
"build": "react-scripts build",
2734
"test": "standard",

src/electron/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const createWindow = () => {
3030
})
3131

3232
mainWindow.loadURL(url.format({
33-
pathname: path.join(__dirname, '/../../build/index.html'),
33+
pathname: path.join(__dirname, '../frontend/static/index.html'),
3434
protocol: 'file:',
3535
slashes: true
3636
}))

src/frontend/about/components/AboutDialog.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { withStyles } from 'material-ui/styles'
44
import Dialog, { DialogContent, DialogActions } from 'material-ui/Dialog'
55
import Typography from 'material-ui/Typography'
66
import Button from 'material-ui/Button'
7-
import AppIcon from '../resources/app-icon-128.png'
87
import { connect } from 'react-redux'
98
import { isAboutDialogOpen } from '../selectors'
109
import { closeAboutDialog, openContributorsDialog } from '../actions'
@@ -20,7 +19,7 @@ const AboutDialog = (props) => {
2019
const openWebsite = () => window.open('https://github.com/plotify/plotify#readme')
2120

2221
const content = [
23-
<img alt='Plotify Icon' src={AppIcon} key={1} />,
22+
<img alt='Plotify Icon' src='./app-icon-128.png' key={1} />,
2423
<div key={2}>
2524
<Typography type='headline'>Plotify</Typography>
2625
<Typography>Version: 0.2.0-SNAPSHOT</Typography>

src/frontend/about/components/ContributorsDialog.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ import Button from 'material-ui/Button'
88
import { isContributorsDialogOpen } from '../selectors'
99
import { closeContributorsDialog } from '../actions'
1010

11-
import SebastianSchmidtImage from '../resources/contributors/sebastian-schmidt.jpg'
12-
import JasperMeyerImage from '../resources/contributors/jasper-meyer.jpg'
13-
import GesaMuellerImage from '../resources/contributors/gesa-mueller.jpg'
14-
1511
const contributors = [
16-
{ name: 'Sebastian Schmidt', url: 'https://github.com/SebastianSchmidt', image: SebastianSchmidtImage },
17-
{ name: 'Jasper Meyer', url: 'https://github.com/itsJASPERr', image: JasperMeyerImage },
18-
{ name: 'Gesa Müller', url: 'https://github.com/GesaMueller', image: GesaMuellerImage },
12+
{ name: 'Sebastian Schmidt', url: 'https://github.com/SebastianSchmidt', image: './contributors/sebastian-schmidt.jpg' },
13+
{ name: 'Jasper Meyer', url: 'https://github.com/itsJASPERr', image: './contributors/jasper-meyer.jpg' },
14+
{ name: 'Gesa Müller', url: 'https://github.com/GesaMueller', image: './contributors/gesa-mueller.jpg' },
1915
{ name: 'Rebecca Rademacher', url: 'https://github.com/RebeccaRademacher' }
2016
]
2117

src/frontend/event-handlers.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import registerViewEventHandlers from './view/event-handlers'
2+
3+
export const registerEventHandlers = () => {
4+
registerViewEventHandlers()
5+
}
6+
7+
export default registerEventHandlers

src/frontend/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ import ReactDOM from 'react-dom'
33
import { Provider } from 'react-redux'
44
import { createStore } from 'redux'
55
import reducers from './reducers'
6-
import ThemeProvider from './theme/components/ThemeProvider'
6+
import { setStore } from './shared/store'
7+
import registerEventHandlers from './event-handlers'
8+
import ThemeProvider from './view/components/ThemeProvider'
79
import App from './App'
8-
import registerServiceWorker from './registerServiceWorker'
910

1011
const store = createStore(reducers)
1112
console.log(store.getState())
1213
store.subscribe(() => console.log(store.getState()))
14+
setStore(store)
15+
16+
registerEventHandlers()
1317

1418
ReactDOM.render(
1519
<Provider store={store}>
@@ -19,5 +23,3 @@ ReactDOM.render(
1923
</Provider>,
2024
document.getElementById('root')
2125
)
22-
23-
registerServiceWorker()

src/frontend/navigation/components/NavigationDrawer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import GroupIcon from 'material-ui-icons/Group'
99
import DeleteIcon from 'material-ui-icons/Delete'
1010
import HelpIcon from 'material-ui-icons/Help'
1111
import FeedbackIcon from 'material-ui-icons/Feedback'
12-
import ToggleDarkThemeDrawerItem from '../../theme/components/ToggleDarkThemeDrawerItem'
12+
import ToggleDarkThemeDrawerItem from '../../view/components/ToggleDarkThemeDrawerItem'
1313
import AboutDrawerItem from '../../about/components/AboutDrawerItem'
1414
import { connect } from 'react-redux'
1515
import { isNavigationDrawerOpen } from '../selectors'

src/frontend/reducers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { combineReducers } from 'redux'
2-
import theme from './theme/reducer'
2+
import view from './view/reducer'
33
import navigation from './navigation/reducer'
44
import about from './about/reducer'
55
import characters from './characters/reducer'
66

77
export default combineReducers({
8-
theme,
8+
view,
99
navigation,
1010
about,
1111
characters

0 commit comments

Comments
 (0)